rcrewai 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (53) hide show
  1. checksums.yaml +7 -0
  2. data/CHANGELOG.md +108 -0
  3. data/LICENSE +21 -0
  4. data/README.md +328 -0
  5. data/Rakefile +130 -0
  6. data/bin/rcrewai +7 -0
  7. data/docs/_config.yml +59 -0
  8. data/docs/_layouts/api.html +16 -0
  9. data/docs/_layouts/default.html +78 -0
  10. data/docs/_layouts/example.html +24 -0
  11. data/docs/_layouts/tutorial.html +33 -0
  12. data/docs/api/configuration.md +327 -0
  13. data/docs/api/crew.md +345 -0
  14. data/docs/api/index.md +41 -0
  15. data/docs/api/tools.md +412 -0
  16. data/docs/assets/css/style.css +416 -0
  17. data/docs/examples/human-in-the-loop.md +382 -0
  18. data/docs/examples/index.md +78 -0
  19. data/docs/examples/production-ready-crew.md +485 -0
  20. data/docs/examples/simple-research-crew.md +297 -0
  21. data/docs/index.md +353 -0
  22. data/docs/tutorials/getting-started.md +341 -0
  23. data/examples/async_execution_example.rb +294 -0
  24. data/examples/hierarchical_crew_example.rb +193 -0
  25. data/examples/human_in_the_loop_example.rb +233 -0
  26. data/lib/rcrewai/agent.rb +636 -0
  27. data/lib/rcrewai/async_executor.rb +248 -0
  28. data/lib/rcrewai/cli.rb +39 -0
  29. data/lib/rcrewai/configuration.rb +100 -0
  30. data/lib/rcrewai/crew.rb +292 -0
  31. data/lib/rcrewai/human_input.rb +520 -0
  32. data/lib/rcrewai/llm_client.rb +41 -0
  33. data/lib/rcrewai/llm_clients/anthropic.rb +127 -0
  34. data/lib/rcrewai/llm_clients/azure.rb +158 -0
  35. data/lib/rcrewai/llm_clients/base.rb +82 -0
  36. data/lib/rcrewai/llm_clients/google.rb +158 -0
  37. data/lib/rcrewai/llm_clients/ollama.rb +199 -0
  38. data/lib/rcrewai/llm_clients/openai.rb +124 -0
  39. data/lib/rcrewai/memory.rb +194 -0
  40. data/lib/rcrewai/process.rb +421 -0
  41. data/lib/rcrewai/task.rb +376 -0
  42. data/lib/rcrewai/tools/base.rb +82 -0
  43. data/lib/rcrewai/tools/code_executor.rb +333 -0
  44. data/lib/rcrewai/tools/email_sender.rb +210 -0
  45. data/lib/rcrewai/tools/file_reader.rb +111 -0
  46. data/lib/rcrewai/tools/file_writer.rb +115 -0
  47. data/lib/rcrewai/tools/pdf_processor.rb +342 -0
  48. data/lib/rcrewai/tools/sql_database.rb +226 -0
  49. data/lib/rcrewai/tools/web_search.rb +131 -0
  50. data/lib/rcrewai/version.rb +5 -0
  51. data/lib/rcrewai.rb +36 -0
  52. data/rcrewai.gemspec +54 -0
  53. metadata +365 -0
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: 238ca2da0ed667c87b39f231b6894b255149a50fa387dcc46c24ad45ce1b43d0
4
+ data.tar.gz: 8b297c1c3aeee3c90cc4ae2f11dfe789b9d81461a866c1d0e3ac7bf5e4be0269
5
+ SHA512:
6
+ metadata.gz: 305fdb4e2a01c16a0100dc14acb2171e66b9584d46aa94f61b64427e3951590a8c7d90eac0fe8df25216ecdf8b04684f0131255f5426206793725e6e874b88d0
7
+ data.tar.gz: faee1733ba9df9e40cbb74cfd756c0c95e3cdc5a4b25e59f0e712e24f9a32778c295a2de84b1d57f45bde53ec43d09f5442eb8a4ab32365fc117f4341410f812
data/CHANGELOG.md ADDED
@@ -0,0 +1,108 @@
1
+ # Changelog
2
+
3
+ All notable changes to this project will be documented in this file.
4
+
5
+ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6
+ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
+
8
+ ## [Unreleased]
9
+
10
+ ## [0.1.0] - 2025-01-12
11
+
12
+ ### Added
13
+
14
+ #### Core Features
15
+ - **Intelligent Agent System**: AI agents with reasoning loops, memory, and tool usage capabilities
16
+ - **Multi-LLM Support**: Complete implementations for OpenAI, Anthropic, Google Gemini, Azure OpenAI, and Ollama
17
+ - **Advanced Task Orchestration**: Sequential, hierarchical, and async/concurrent execution modes
18
+ - **Human-in-the-Loop Integration**: Interactive approval workflows, real-time guidance, and collaborative decision making
19
+
20
+ #### Agent Capabilities
21
+ - Reasoning loops with configurable iterations and timeouts
22
+ - Short-term and long-term memory systems
23
+ - Tool usage with intelligent selection
24
+ - Manager agents with delegation capabilities
25
+ - Human interaction support (approval, guidance, reviews)
26
+
27
+ #### Task System
28
+ - Task dependencies and context sharing
29
+ - Retry logic with exponential backoff
30
+ - Async/concurrent execution with dependency management
31
+ - Human confirmation and review points
32
+ - Callback support and error handling
33
+
34
+ #### Tool Ecosystem
35
+ - **Web Search**: DuckDuckGo integration for research
36
+ - **File Operations**: Read/write files with security controls
37
+ - **SQL Database**: Secure database querying with connection management
38
+ - **Email Integration**: SMTP email sending with attachment support
39
+ - **Code Execution**: Sandboxed code execution environment
40
+ - **PDF Processing**: Text extraction and document processing
41
+ - **Custom Tool Framework**: Easy framework for building specialized tools
42
+
43
+ #### Orchestration Modes
44
+ - **Sequential Process**: Tasks execute one after another with dependency resolution
45
+ - **Hierarchical Process**: Manager agents coordinate and delegate to specialist agents
46
+ - **Async Execution**: Parallel task processing with intelligent dependency management
47
+ - **Human Oversight**: Interactive workflows with human collaboration points
48
+
49
+ #### LLM Provider Support
50
+ - **OpenAI**: GPT-4, GPT-3.5-turbo, and legacy completion models
51
+ - **Anthropic**: Claude-3 Opus/Sonnet/Haiku, Claude-2.1/2.0
52
+ - **Google**: Gemini Pro, Gemini Pro Vision, Gemini 1.5 models
53
+ - **Azure OpenAI**: Full compatibility with Azure OpenAI deployments
54
+ - **Ollama**: Local LLM support with model management
55
+
56
+ #### Human-in-the-Loop Features
57
+ - Task execution confirmation workflows
58
+ - Tool usage approval systems
59
+ - Real-time human guidance during agent reasoning
60
+ - Final answer review and revision capabilities
61
+ - Error recovery with human intervention options
62
+ - Session tracking and interaction history
63
+
64
+ #### Production Features
65
+ - Comprehensive error handling and recovery
66
+ - Security controls and input validation
67
+ - Detailed logging and debugging support
68
+ - Memory management and cleanup
69
+ - Configuration validation and environment variable support
70
+ - CLI interface for crew management
71
+
72
+ #### Development & Testing
73
+ - Comprehensive test suite with >90% coverage
74
+ - RSpec tests for all core components
75
+ - Mock LLM responses for reliable testing
76
+ - WebMock/VCR for HTTP interaction testing
77
+ - Continuous Integration setup
78
+ - Code quality checks with RuboCop
79
+
80
+ ### Technical Details
81
+
82
+ #### Dependencies
83
+ - **thor**: CLI framework for command-line interface
84
+ - **zeitwerk**: Code loading and autoloading
85
+ - **faraday**: HTTP client for API interactions
86
+ - **concurrent-ruby**: Thread-safe concurrent execution
87
+ - **nokogiri**: HTML/XML parsing for web scraping
88
+ - **pdf-reader**: PDF text extraction capabilities
89
+ - **mail**: SMTP email functionality
90
+
91
+ #### Architecture
92
+ - Modular design with clear separation of concerns
93
+ - Plugin-based tool system for extensibility
94
+ - Event-driven human interaction system
95
+ - Thread-safe concurrent execution
96
+ - Memory-efficient resource management
97
+ - Flexible configuration system
98
+
99
+ ### Documentation
100
+ - Complete API documentation with examples
101
+ - Human-in-the-loop integration guide
102
+ - LLM provider configuration examples
103
+ - Production deployment guidelines
104
+ - CLI usage documentation
105
+ - Real-world use cases and examples
106
+
107
+ [Unreleased]: https://github.com/gkosmo/rcrewAI/compare/v0.1.0...HEAD
108
+ [0.1.0]: https://github.com/gkosmo/rcrewAI/releases/tag/v0.1.0
data/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 gkosmo
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,328 @@
1
+ # RCrewAI
2
+
3
+ ![Ruby](https://img.shields.io/badge/ruby-%23CC342D.svg?style=for-the-badge&logo=ruby&logoColor=white)
4
+ ![AI](https://img.shields.io/badge/AI-Agents-blue?style=for-the-badge)
5
+ ![Production Ready](https://img.shields.io/badge/Production-Ready-green?style=for-the-badge)
6
+
7
+ Build powerful AI agent crews in Ruby that work together to accomplish complex tasks.
8
+
9
+ RCrewAI is a Ruby implementation of the CrewAI framework, allowing you to create autonomous AI agents that collaborate to solve problems and complete tasks with human oversight and enterprise-grade features.
10
+
11
+ ## 🚀 Features
12
+
13
+ - **🤖 Intelligent Agents**: AI agents with reasoning loops, memory, and tool usage capabilities
14
+ - **🔗 Multi-LLM Support**: OpenAI, Anthropic (Claude), Google (Gemini), Azure OpenAI, and Ollama
15
+ - **🛠️ Rich Tool Ecosystem**: Web search, file operations, SQL, email, code execution, PDF processing, and custom tools
16
+ - **🧠 Agent Memory**: Short-term and long-term memory for learning from past executions
17
+ - **🤝 Human-in-the-Loop**: Interactive approval workflows, human guidance, and collaborative decision making
18
+ - **⚡ Advanced Task System**: Dependencies, retries, async/concurrent execution, and context sharing
19
+ - **🏗️ Hierarchical Teams**: Manager agents that coordinate and delegate tasks to specialist agents
20
+ - **🔒 Production Ready**: Security controls, error handling, logging, monitoring, and sandboxing
21
+ - **🎯 Flexible Orchestration**: Sequential, hierarchical, and concurrent execution modes
22
+ - **💎 Ruby-First Design**: Built specifically for Ruby developers with idiomatic patterns
23
+
24
+ ## 📦 Installation
25
+
26
+ Add this line to your application's Gemfile:
27
+
28
+ ```ruby
29
+ gem 'rcrewai'
30
+ ```
31
+
32
+ And then execute:
33
+
34
+ ```bash
35
+ $ bundle install
36
+ ```
37
+
38
+ Or install it yourself as:
39
+
40
+ ```bash
41
+ $ gem install rcrewai
42
+ ```
43
+
44
+ ## 🏃‍♂️ Quick Start
45
+
46
+ ```ruby
47
+ require 'rcrewai'
48
+
49
+ # Configure your LLM provider
50
+ RCrewAI.configure do |config|
51
+ config.llm_provider = :openai # or :anthropic, :google, :azure, :ollama
52
+ config.temperature = 0.1
53
+ end
54
+
55
+ # Create intelligent agents with specialized tools
56
+ researcher = RCrewAI::Agent.new(
57
+ name: "researcher",
58
+ role: "Senior Research Analyst",
59
+ goal: "Uncover cutting-edge developments in AI",
60
+ backstory: "Expert at finding and analyzing the latest tech trends",
61
+ tools: [RCrewAI::Tools::WebSearch.new],
62
+ verbose: true
63
+ )
64
+
65
+ writer = RCrewAI::Agent.new(
66
+ name: "writer",
67
+ role: "Tech Content Strategist",
68
+ goal: "Create compelling technical content",
69
+ backstory: "Skilled at transforming research into engaging articles",
70
+ tools: [RCrewAI::Tools::FileWriter.new]
71
+ )
72
+
73
+ # Create crew with sequential process
74
+ crew = RCrewAI::Crew.new("ai_research_crew")
75
+ crew.add_agent(researcher)
76
+ crew.add_agent(writer)
77
+
78
+ # Define tasks with dependencies
79
+ research_task = RCrewAI::Task.new(
80
+ name: "research_ai_trends",
81
+ description: "Research the latest developments in AI for 2024",
82
+ agent: researcher,
83
+ expected_output: "Comprehensive report on AI trends with key insights"
84
+ )
85
+
86
+ writing_task = RCrewAI::Task.new(
87
+ name: "write_article",
88
+ description: "Write an engaging 1000-word article about AI trends",
89
+ agent: writer,
90
+ context: [research_task], # Uses research results as context
91
+ expected_output: "Publication-ready article saved as ai_trends.md"
92
+ )
93
+
94
+ crew.add_task(research_task)
95
+ crew.add_task(writing_task)
96
+
97
+ # Execute - agents will reason, search, and produce real results!
98
+ results = crew.execute
99
+ puts "✅ Crew completed #{results[:completed_tasks]}/#{results[:total_tasks]} tasks"
100
+ ```
101
+
102
+ ## 🎯 Key Capabilities
103
+
104
+ ### 🧠 Advanced Agent Intelligence
105
+ - **Multi-step Reasoning**: Complex problem decomposition and solving
106
+ - **Tool Selection**: Intelligent tool usage based on task requirements
107
+ - **Context Awareness**: Memory-driven decision making from past executions
108
+ - **Learning Capability**: Short-term and long-term memory systems
109
+
110
+ ### 🛠️ Comprehensive Tool Ecosystem
111
+ - **Web Search**: DuckDuckGo integration for research
112
+ - **File Operations**: Read/write files with security controls
113
+ - **SQL Database**: Secure database querying with connection management
114
+ - **Email Integration**: SMTP email sending with attachment support
115
+ - **Code Execution**: Sandboxed code execution environment
116
+ - **PDF Processing**: Text extraction and document processing
117
+ - **Custom Tools**: Extensible framework for building specialized tools
118
+
119
+ ### 🤝 Human-in-the-Loop Integration
120
+ - **Interactive Approval**: Human confirmation for sensitive operations
121
+ - **Real-time Guidance**: Human input during agent reasoning processes
122
+ - **Task Confirmation**: Human approval before executing critical tasks
123
+ - **Result Validation**: Human review and revision of agent outputs
124
+ - **Error Recovery**: Human intervention when agents encounter failures
125
+
126
+ ### 🏗️ Enterprise-Grade Orchestration
127
+ - **Hierarchical Teams**: Manager agents coordinate and delegate to specialists
128
+ - **Async Execution**: Parallel task processing with intelligent dependency management
129
+ - **Delegation Systems**: Automatic task assignment based on agent capabilities
130
+ - **Process Types**: Sequential, hierarchical, and consensual execution modes
131
+
132
+ ## 🔧 LLM Provider Support
133
+
134
+ ```ruby
135
+ # OpenAI (GPT-4, GPT-3.5, etc.)
136
+ RCrewAI.configure do |config|
137
+ config.llm_provider = :openai
138
+ config.openai_api_key = ENV['OPENAI_API_KEY']
139
+ config.model = 'gpt-4'
140
+ end
141
+
142
+ # Anthropic Claude
143
+ RCrewAI.configure do |config|
144
+ config.llm_provider = :anthropic
145
+ config.anthropic_api_key = ENV['ANTHROPIC_API_KEY']
146
+ config.model = 'claude-3-sonnet-20240229'
147
+ end
148
+
149
+ # Google Gemini
150
+ RCrewAI.configure do |config|
151
+ config.llm_provider = :google
152
+ config.google_api_key = ENV['GOOGLE_API_KEY']
153
+ config.model = 'gemini-pro'
154
+ end
155
+
156
+ # Azure OpenAI
157
+ RCrewAI.configure do |config|
158
+ config.llm_provider = :azure
159
+ config.azure_api_key = ENV['AZURE_OPENAI_API_KEY']
160
+ config.azure_endpoint = ENV['AZURE_OPENAI_ENDPOINT']
161
+ config.model = 'gpt-4'
162
+ end
163
+
164
+ # Local Ollama
165
+ RCrewAI.configure do |config|
166
+ config.llm_provider = :ollama
167
+ config.ollama_url = 'http://localhost:11434'
168
+ config.model = 'llama2'
169
+ end
170
+ ```
171
+
172
+ ## 💡 Examples
173
+
174
+ ### Hierarchical Team with Human Oversight
175
+
176
+ ```ruby
177
+ # Create a hierarchical crew with manager coordination
178
+ crew = RCrewAI::Crew.new("enterprise_team", process: :hierarchical)
179
+
180
+ # Manager agent coordinates the team
181
+ manager = RCrewAI::Agent.new(
182
+ name: "project_manager",
183
+ role: "Senior Project Manager",
184
+ goal: "Coordinate team execution efficiently",
185
+ manager: true,
186
+ allow_delegation: true
187
+ )
188
+
189
+ # Specialist agents with human-in-the-loop capabilities
190
+ data_analyst = RCrewAI::Agent.new(
191
+ name: "data_analyst",
192
+ role: "Senior Data Analyst",
193
+ goal: "Analyze data with human validation",
194
+ tools: [RCrewAI::Tools::SqlDatabase.new],
195
+ human_input: true, # Enable human interaction
196
+ require_approval_for_tools: true, # Human approves SQL queries
197
+ require_approval_for_final_answer: true # Human validates analysis
198
+ )
199
+
200
+ crew.add_agent(manager)
201
+ crew.add_agent(data_analyst)
202
+
203
+ # Execute with async/hierarchical coordination
204
+ results = crew.execute(async: true, max_concurrency: 2)
205
+ ```
206
+
207
+ ### Async/Concurrent Execution
208
+
209
+ ```ruby
210
+ # Tasks that can run in parallel
211
+ research_task = RCrewAI::Task.new(
212
+ name: "market_research",
213
+ description: "Research market trends",
214
+ async: true
215
+ )
216
+
217
+ analysis_task = RCrewAI::Task.new(
218
+ name: "competitive_analysis",
219
+ description: "Analyze competitors",
220
+ async: true
221
+ )
222
+
223
+ crew.add_task(research_task)
224
+ crew.add_task(analysis_task)
225
+
226
+ # Execute with parallel processing
227
+ results = crew.execute(
228
+ async: true,
229
+ max_concurrency: 4,
230
+ timeout: 300
231
+ )
232
+ ```
233
+
234
+ ## 🛠️ CLI Usage
235
+
236
+ ```bash
237
+ # Create a new crew
238
+ $ rcrewai new my_research_crew --process sequential
239
+
240
+ # Create agents with tools
241
+ $ rcrewai agent new researcher \
242
+ --role "Senior Research Analyst" \
243
+ --tools web_search,file_writer \
244
+ --human-input
245
+
246
+ # Create tasks with dependencies
247
+ $ rcrewai task new research \
248
+ --description "Research latest AI developments" \
249
+ --agent researcher \
250
+ --async
251
+
252
+ # Run crews
253
+ $ rcrewai run --crew my_research_crew --async
254
+ ```
255
+
256
+ ## 📚 Examples & Documentation
257
+
258
+ - **[Getting Started Guide](docs/tutorials/getting-started.md)**: Learn the basics
259
+ - **[Human-in-the-Loop Example](examples/human_in_the_loop_example.rb)**: Interactive AI workflows
260
+ - **[Hierarchical Teams](examples/hierarchical_crew_example.rb)**: Manager coordination
261
+ - **[Async Execution](examples/async_execution_example.rb)**: Performance optimization
262
+ - **[API Documentation](docs/api/)**: Complete API reference
263
+
264
+ ## 🎯 Use Cases
265
+
266
+ RCrewAI excels in scenarios requiring:
267
+
268
+ - **🔍 Research & Analysis**: Multi-source research with data correlation
269
+ - **📝 Content Creation**: Collaborative content development workflows
270
+ - **🏢 Business Intelligence**: Data analysis and strategic planning
271
+ - **🛠️ Development Workflows**: Code analysis, testing, and documentation
272
+ - **📊 Data Processing**: ETL workflows with validation
273
+ - **🤖 Customer Support**: Intelligent routing and response generation
274
+ - **🎯 Decision Making**: Multi-criteria analysis with human oversight
275
+
276
+ ## 🏗️ Architecture
277
+
278
+ RCrewAI provides a flexible, production-ready architecture:
279
+
280
+ ```
281
+ ┌─────────────────┐ ┌─────────────────┐ ┌─────────────────┐
282
+ │ Crew Layer │ │ Human Layer │ │ Tool Layer │
283
+ │ │ │ │ │ │
284
+ │ • Orchestration │ │ • Approvals │ │ • Web Search │
285
+ │ • Process Types │ │ • Guidance │ │ • File Ops │
286
+ │ • Async Exec │ │ • Reviews │ │ • SQL Database │
287
+ │ • Dependencies │ │ • Interventions │ │ • Email │
288
+ └─────────────────┘ └─────────────────┘ └─────────────────┘
289
+ │ │ │
290
+ └──────────────┬─────────────────┬─────────────────┘
291
+ │ │
292
+ ┌─────────────────┐ ┌─────────────────┐
293
+ │ Agent Layer │ │ LLM Layer │
294
+ │ │ │ │
295
+ │ • Reasoning │ │ • OpenAI │
296
+ │ • Memory │ │ • Anthropic │
297
+ │ • Tool Usage │ │ • Google │
298
+ │ • Delegation │ │ • Azure │
299
+ └─────────────────┘ └─────────────────┘
300
+ ```
301
+
302
+ ## 🤝 Contributing
303
+
304
+ We welcome contributions! Please see our [Contributing Guide](CONTRIBUTING.md) for details.
305
+
306
+ 1. Fork the repository
307
+ 2. Create your feature branch (`git checkout -b my-new-feature`)
308
+ 3. Commit your changes (`git commit -am 'Add some feature'`)
309
+ 4. Push to the branch (`git push origin my-new-feature`)
310
+ 5. Create a new Pull Request
311
+
312
+ ## 📄 License
313
+
314
+ RCrewAI is released under the [MIT License](LICENSE).
315
+
316
+ ## 📞 Support
317
+
318
+ - **Documentation**: [https://gkosmo.github.io/rcrewAI/](https://gkosmo.github.io/rcrewAI/)
319
+ - **Issues**: [GitHub Issues](https://github.com/gkosmo/rcrewAI/issues)
320
+ - **Discussions**: [GitHub Discussions](https://github.com/gkosmo/rcrewAI/discussions)
321
+
322
+ ## 🌟 Star History
323
+
324
+ [![Star History Chart](https://api.star-history.com/svg?repos=gkosmo/rcrewAI&type=Date)](https://star-history.com/#gkosmo/rcrewAI&Date)
325
+
326
+ ---
327
+
328
+ Made with ❤️ by the RCrewAI community
data/Rakefile ADDED
@@ -0,0 +1,130 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "bundler/gem_tasks"
4
+ require "rspec/core/rake_task"
5
+ require "rubocop/rake_task"
6
+
7
+ # Default task
8
+ task default: [:spec, :rubocop]
9
+
10
+ # RSpec task
11
+ RSpec::Core::RakeTask.new(:spec) do |task|
12
+ task.rspec_opts = "--color --format documentation"
13
+ end
14
+
15
+ # RuboCop task
16
+ RuboCop::RakeTask.new do |task|
17
+ task.options = ["--display-cop-names", "--display-style-guide"]
18
+ end
19
+
20
+ # Test with coverage
21
+ desc "Run specs with coverage report"
22
+ task :spec_coverage do
23
+ ENV['COVERAGE'] = 'true'
24
+ Rake::Task[:spec].invoke
25
+ end
26
+
27
+ # Clean coverage files
28
+ desc "Clean coverage files"
29
+ task :clean_coverage do
30
+ FileUtils.rm_rf("coverage/")
31
+ end
32
+
33
+ # Build and install gem locally
34
+ desc "Build and install gem locally"
35
+ task :install_local do
36
+ sh "gem build rcrewai.gemspec"
37
+ sh "gem install rcrewai-*.gem"
38
+ FileUtils.rm(Dir.glob("rcrewai-*.gem"))
39
+ end
40
+
41
+ # Run all tests and checks
42
+ desc "Run all tests and code quality checks"
43
+ task :ci do
44
+ puts "Running RSpec tests..."
45
+ Rake::Task[:spec].invoke
46
+
47
+ puts "\nRunning RuboCop..."
48
+ Rake::Task[:rubocop].invoke
49
+
50
+ puts "\nAll checks passed! ✅"
51
+ end
52
+
53
+ # Console task for development
54
+ desc "Start interactive console with gem loaded"
55
+ task :console do
56
+ require "irb"
57
+ require_relative "lib/rcrewai"
58
+ IRB.start
59
+ end
60
+
61
+ # Generate documentation
62
+ desc "Generate documentation"
63
+ task :docs do
64
+ sh "yard doc lib/**/*.rb"
65
+ puts "Documentation generated in doc/ directory"
66
+ end
67
+
68
+ # Benchmark task
69
+ desc "Run performance benchmarks"
70
+ task :benchmark do
71
+ require_relative "lib/rcrewai"
72
+
73
+ # Simple benchmark example
74
+ require "benchmark"
75
+
76
+ RCrewAI.configure do |config|
77
+ config.llm_provider = :openai
78
+ config.api_key = "test-key"
79
+ end
80
+
81
+ agent = RCrewAI::Agent.new(
82
+ name: "benchmark_agent",
83
+ role: "Test Agent",
84
+ goal: "Run benchmarks"
85
+ )
86
+
87
+ task = RCrewAI::Task.new(
88
+ name: "benchmark_task",
89
+ description: "Test task",
90
+ agent: agent
91
+ )
92
+
93
+ crew = RCrewAI::Crew.new("benchmark_crew")
94
+ crew.add_agent(agent)
95
+ crew.add_task(task)
96
+
97
+ puts "\nBenchmarking crew creation and setup..."
98
+ result = Benchmark.measure do
99
+ 100.times do
100
+ test_crew = RCrewAI::Crew.new("test_#{rand(1000)}")
101
+ test_agent = RCrewAI::Agent.new(
102
+ name: "test_agent",
103
+ role: "Test Agent",
104
+ goal: "Test performance"
105
+ )
106
+ test_crew.add_agent(test_agent)
107
+ end
108
+ end
109
+
110
+ puts "Created 100 crews with agents in: #{result.real.round(4)}s"
111
+ end
112
+
113
+ # Development setup
114
+ desc "Set up development environment"
115
+ task :setup do
116
+ puts "Setting up development environment..."
117
+
118
+ # Install dependencies
119
+ sh "bundle install"
120
+
121
+ # Create necessary directories
122
+ FileUtils.mkdir_p("spec/vcr_cassettes") unless Dir.exist?("spec/vcr_cassettes")
123
+ FileUtils.mkdir_p("coverage") unless Dir.exist?("coverage")
124
+ FileUtils.mkdir_p("doc") unless Dir.exist?("doc")
125
+
126
+ puts "\n✅ Development environment set up successfully!"
127
+ puts "\nRun 'rake spec' to run tests"
128
+ puts "Run 'rake console' to start an interactive session"
129
+ puts "Run 'rake ci' to run all checks"
130
+ end
data/bin/rcrewai ADDED
@@ -0,0 +1,7 @@
1
+ #!/usr/bin/env ruby
2
+ # frozen_string_literal: true
3
+
4
+ require "bundler/setup"
5
+ require "rcrewai"
6
+
7
+ RCrewAI::CLI.start(ARGV)
data/docs/_config.yml ADDED
@@ -0,0 +1,59 @@
1
+ title: RCrewAI Documentation
2
+ description: Build AI agent crews in Ruby - Documentation and Tutorials
3
+ baseurl: "/rcrewAI"
4
+ url: "https://gkosmo.github.io"
5
+ theme: jekyll-theme-minimal
6
+
7
+ # Build settings
8
+ markdown: kramdown
9
+ highlighter: rouge
10
+
11
+ # Navigation
12
+ navigation:
13
+ - title: Home
14
+ url: /
15
+ - title: Getting Started
16
+ url: /tutorials/getting-started
17
+ - title: Tutorials
18
+ url: /tutorials/
19
+ - title: API Reference
20
+ url: /api/
21
+ - title: Examples
22
+ url: /examples/
23
+ - title: GitHub
24
+ url: https://github.com/gkosmo/rcrewAI
25
+
26
+ # Plugins
27
+ plugins:
28
+ - jekyll-seo-tag
29
+ - jekyll-sitemap
30
+
31
+ # Collections
32
+ collections:
33
+ tutorials:
34
+ output: true
35
+ permalink: /tutorials/:name
36
+ api:
37
+ output: true
38
+ permalink: /api/:name
39
+ examples:
40
+ output: true
41
+ permalink: /examples/:name
42
+
43
+ # Defaults
44
+ defaults:
45
+ - scope:
46
+ path: ""
47
+ type: "tutorials"
48
+ values:
49
+ layout: "tutorial"
50
+ - scope:
51
+ path: ""
52
+ type: "api"
53
+ values:
54
+ layout: "api"
55
+ - scope:
56
+ path: ""
57
+ type: "examples"
58
+ values:
59
+ layout: "example"
@@ -0,0 +1,16 @@
1
+ ---
2
+ layout: default
3
+ ---
4
+
5
+ <article class="api-documentation">
6
+ <header class="api-header">
7
+ <h1>{{ page.title }}</h1>
8
+ {% if page.description %}
9
+ <p class="lead">{{ page.description }}</p>
10
+ {% endif %}
11
+ </header>
12
+
13
+ <div class="api-content">
14
+ {{ content }}
15
+ </div>
16
+ </article>