rcrewai 0.10.0 → 0.11.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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +24 -0
- data/README.md +133 -23
- data/ROADMAP.md +1 -1
- data/docs/api/agent.md +5 -2
- data/docs/api/configuration.md +36 -41
- data/docs/api/crew.md +34 -48
- data/docs/api/index.md +7 -0
- data/docs/api/task.md +10 -91
- data/docs/api/tools.md +19 -0
- data/docs/examples/api-integration.md +4 -4
- data/docs/examples/async-execution.md +4 -4
- data/docs/examples/code-review-crew.md +1 -1
- data/docs/examples/content-marketing-pipeline.md +3 -3
- data/docs/examples/custom-tools.md +8 -8
- data/docs/examples/customer-support.md +5 -5
- data/docs/examples/data-analysis-team.md +4 -4
- data/docs/examples/database-operations.md +4 -4
- data/docs/examples/ecommerce-operations.md +4 -4
- data/docs/examples/financial-analysis.md +3 -3
- data/docs/examples/hierarchical-crew.md +3 -2
- data/docs/examples/production-ready-crew.md +16 -10
- data/docs/examples/research-development.md +5 -5
- data/docs/examples/simple-research-crew.md +2 -2
- data/docs/examples/social-media.md +4 -4
- data/docs/examples/task-automation.md +2 -2
- data/docs/examples/tool-composition.md +42 -27
- data/docs/examples/web-scraping.md +6 -6
- data/docs/index.md +61 -44
- data/docs/tutorials/advanced-agents.md +194 -917
- data/docs/tutorials/agent-options.md +1 -1
- data/docs/tutorials/checkpointing.md +65 -0
- data/docs/tutorials/concurrency.md +57 -0
- data/docs/tutorials/custom-tools.md +198 -1143
- data/docs/tutorials/deployment.md +156 -155
- data/docs/tutorials/getting-started.md +69 -81
- data/docs/tutorials/index.md +19 -0
- data/docs/tutorials/interceptors-and-events.md +84 -0
- data/docs/tutorials/live-streaming.md +52 -0
- data/docs/tutorials/multiple-crews.md +70 -51
- data/docs/tutorials/providers.md +115 -0
- data/docs/upgrading-to-0.11.md +55 -0
- data/lib/rcrewai/agent.rb +0 -2
- data/lib/rcrewai/configuration.rb +64 -29
- data/lib/rcrewai/context_window.rb +12 -2
- data/lib/rcrewai/llm_clients/anthropic.rb +60 -9
- data/lib/rcrewai/llm_clients/base.rb +7 -0
- data/lib/rcrewai/llm_clients/bedrock.rb +29 -2
- data/lib/rcrewai/llm_clients/google.rb +36 -4
- data/lib/rcrewai/llm_clients/ollama.rb +17 -3
- data/lib/rcrewai/llm_clients/openai.rb +14 -1
- data/lib/rcrewai/llm_clients/openai_responses.rb +21 -2
- data/lib/rcrewai/pricing.rb +13 -3
- data/lib/rcrewai/tool_runner.rb +5 -1
- data/lib/rcrewai/version.rb +1 -1
- metadata +7 -1
|
@@ -17,7 +17,7 @@ Give each agent its own provider/model instead of only the global default:
|
|
|
17
17
|
worker = RCrewAI::Agent.new(name: 'worker', role: '...', goal: '...',
|
|
18
18
|
llm: { provider: :openai, model: 'gpt-4o-mini' })
|
|
19
19
|
manager = RCrewAI::Agent.new(name: 'manager', role: '...', goal: '...',
|
|
20
|
-
llm: { provider: :anthropic, model: 'claude-
|
|
20
|
+
llm: { provider: :anthropic, model: 'claude-opus-5-5' })
|
|
21
21
|
```
|
|
22
22
|
|
|
23
23
|
Accepts a provider symbol, an options hash, or a pre-built client. Overrides
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
---
|
|
2
|
+
layout: tutorial
|
|
3
|
+
title: Checkpointing
|
|
4
|
+
description: Save crew progress after each task and resume a failed run without repeating finished work
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Checkpointing
|
|
8
|
+
|
|
9
|
+
A checkpoint records what each task produced, so a run that dies partway can resume
|
|
10
|
+
without paying for the finished tasks again. It works with the sequential,
|
|
11
|
+
hierarchical and consensual processes.
|
|
12
|
+
|
|
13
|
+
## Save and resume
|
|
14
|
+
|
|
15
|
+
```ruby
|
|
16
|
+
store = RCrewAI::Checkpoint::FileStore.new('.rcrewai/checkpoints')
|
|
17
|
+
|
|
18
|
+
crew.execute(checkpoint: store)
|
|
19
|
+
run_id = crew.run_id # keep this to resume later
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
To resume, build the same crew, with the same task names, and call `resume`:
|
|
23
|
+
|
|
24
|
+
```ruby
|
|
25
|
+
crew.resume(run_id, checkpoint: store)
|
|
26
|
+
crew.restored_task_names # => ["research"], the tasks replayed from the checkpoint
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
Completed tasks replay their stored results. Failed tasks are recorded as failed, so
|
|
30
|
+
they run again, along with any tasks that never started.
|
|
31
|
+
|
|
32
|
+
A checkpoint is written each time a task finishes, so a crash loses at most the tasks
|
|
33
|
+
still in progress.
|
|
34
|
+
|
|
35
|
+
## Lineage
|
|
36
|
+
|
|
37
|
+
A resumed run gets its own `run_id` and links to its parent, which leaves the original
|
|
38
|
+
record intact. `lineage` walks the chain from the root:
|
|
39
|
+
|
|
40
|
+
```ruby
|
|
41
|
+
RCrewAI::Checkpoint.lineage(store, crew.run_id)
|
|
42
|
+
# => ["<original run id>", "<resumed run id>"]
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
If an ancestor has been deleted, the chain is cut short rather than raising an error.
|
|
46
|
+
|
|
47
|
+
## Stores
|
|
48
|
+
|
|
49
|
+
| Store | Use |
|
|
50
|
+
|---|---|
|
|
51
|
+
| `Checkpoint::FileStore.new(dir)` | One JSON file per run |
|
|
52
|
+
| `Checkpoint::MemoryStore.new` | Tests and single-process runs |
|
|
53
|
+
|
|
54
|
+
Anything responding to `save(id, record)`, `load(id)`, `list` and `delete(id)` works
|
|
55
|
+
as a store.
|
|
56
|
+
|
|
57
|
+
## CLI
|
|
58
|
+
|
|
59
|
+
```bash
|
|
60
|
+
$ rcrewai checkpoint list
|
|
61
|
+
$ rcrewai checkpoint info RUN_ID
|
|
62
|
+
$ rcrewai checkpoint delete RUN_ID
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
These read `.rcrewai/checkpoints` unless you pass `--dir`.
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
---
|
|
2
|
+
layout: tutorial
|
|
3
|
+
title: Concurrency
|
|
4
|
+
description: Control parallel tool calls, consensus rounds, embedding requests and async task execution
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Concurrency
|
|
8
|
+
|
|
9
|
+
RCrewAI runs independent, IO-bound work at the same time wherever it can. Each kind of
|
|
10
|
+
fan-out has a limit, so faster runs don't turn into rate-limit errors.
|
|
11
|
+
|
|
12
|
+
| What runs concurrently | Default limit | Change it with |
|
|
13
|
+
|---|---|---|
|
|
14
|
+
| Tool calls in one model turn | 8 | `Agent.new(parallel_tools: false)`; `ToolRunner.new(max_tool_concurrency:)` |
|
|
15
|
+
| Consensus proposals and scoring | 8 | `Crew.new(consensus_max_concurrency:)` |
|
|
16
|
+
| Embeddings on `:google` and `:ollama` | 8 | `Knowledge::Embedder.new(max_concurrency:)` |
|
|
17
|
+
| Tasks, with `crew.execute(async: true)` | CPU count | `crew.execute(async: true, max_concurrency:)` |
|
|
18
|
+
|
|
19
|
+
## Tool calls
|
|
20
|
+
|
|
21
|
+
When a model asks for several tools in one turn, they run together, so the turn takes
|
|
22
|
+
as long as the slowest call rather than the sum of them. Results stay in the order the
|
|
23
|
+
model asked for them.
|
|
24
|
+
|
|
25
|
+
Turn this off for an agent whose tools aren't safe to run in parallel, or that shouldn't
|
|
26
|
+
send a burst of requests to a rate-limited API:
|
|
27
|
+
|
|
28
|
+
```ruby
|
|
29
|
+
agent = RCrewAI::Agent.new(name: 'clerk', role: 'Clerk', goal: 'Update records',
|
|
30
|
+
tools: [ledger_tool], parallel_tools: false)
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
If your tools share state and you leave this on, they have to be thread-safe.
|
|
34
|
+
|
|
35
|
+
## Consensus
|
|
36
|
+
|
|
37
|
+
Scoring grows with the square of the number of participants: every voter scores every
|
|
38
|
+
candidate. Six agents would mean 36 scoring requests, which is why the limit exists.
|
|
39
|
+
|
|
40
|
+
```ruby
|
|
41
|
+
crew = RCrewAI::Crew.new('panel', process: :consensual,
|
|
42
|
+
consensus_agents: 6,
|
|
43
|
+
consensus_max_concurrency: 4)
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
Results keep their input order, so ties still go to the task's assigned agent.
|
|
47
|
+
|
|
48
|
+
## Embeddings
|
|
49
|
+
|
|
50
|
+
`:google` and `:ollama` have no batch endpoint, so each text is its own request:
|
|
51
|
+
|
|
52
|
+
```ruby
|
|
53
|
+
embedder = RCrewAI::Knowledge::Embedder.new(provider: :ollama, max_concurrency: 2)
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
`:openai` and `:azure` send one batched request and aren't affected. If any request
|
|
57
|
+
fails, the error is raised rather than leaving the knowledge base with missing vectors.
|