rcrewai 0.7.0 → 0.8.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 (40) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +51 -1
  3. data/ROADMAP.md +144 -75
  4. data/docs/api/agent.md +8 -0
  5. data/docs/api/crew.md +53 -3
  6. data/docs/api/index.md +14 -13
  7. data/docs/api/task.md +7 -0
  8. data/docs/examples/async-execution.md +8 -5
  9. data/docs/examples/tool-composition.md +3 -3
  10. data/docs/index.md +22 -7
  11. data/docs/tutorials/agent-options.md +128 -0
  12. data/docs/tutorials/consensual-process.md +58 -0
  13. data/docs/tutorials/flows.md +135 -0
  14. data/docs/tutorials/index.md +45 -0
  15. data/docs/tutorials/knowledge.md +80 -0
  16. data/docs/tutorials/memory.md +90 -0
  17. data/lib/rcrewai/checkpoint/cli.rb +98 -0
  18. data/lib/rcrewai/checkpoint.rb +145 -0
  19. data/lib/rcrewai/cli.rb +12 -1
  20. data/lib/rcrewai/configuration.rb +7 -0
  21. data/lib/rcrewai/crew.rb +88 -2
  22. data/lib/rcrewai/events.rb +71 -5
  23. data/lib/rcrewai/legacy_react_runner.rb +14 -9
  24. data/lib/rcrewai/llm_client.rb +20 -15
  25. data/lib/rcrewai/llm_clients/anthropic.rb +13 -4
  26. data/lib/rcrewai/llm_clients/azure.rb +2 -2
  27. data/lib/rcrewai/llm_clients/base.rb +55 -1
  28. data/lib/rcrewai/llm_clients/bedrock.rb +134 -0
  29. data/lib/rcrewai/llm_clients/google.rb +13 -4
  30. data/lib/rcrewai/llm_clients/ollama.rb +18 -4
  31. data/lib/rcrewai/llm_clients/openai.rb +19 -15
  32. data/lib/rcrewai/llm_clients/openai_compatible.rb +34 -0
  33. data/lib/rcrewai/llm_clients/openai_responses.rb +127 -0
  34. data/lib/rcrewai/llm_clients/snowflake_cortex.rb +42 -0
  35. data/lib/rcrewai/process.rb +41 -2
  36. data/lib/rcrewai/task.rb +3 -2
  37. data/lib/rcrewai/tool_runner.rb +16 -10
  38. data/lib/rcrewai/version.rb +1 -1
  39. data/lib/rcrewai.rb +3 -0
  40. metadata +12 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: '0024080cd05b151b653bcedb4b29afea563e149f9d68dce1662d636a919020a9'
4
- data.tar.gz: 53bb6b1376f88d1379cb0f877eeaa35aed0822f08df5f76d482e28d55101efe6
3
+ metadata.gz: fe3fce4660f7a0c695a2c2f14a7a391cd8e40eaac319af8b87efd80eb118511c
4
+ data.tar.gz: 383ad7591cee2299424a1e9c75e7b6795d51d30655fcc7bd81f962845ad83712
5
5
  SHA512:
6
- metadata.gz: b7923adbf161caa5361568268306513c92e5ffbddc3736cd91cd0fbccedd8cdd4230854f8310cf358964c7ccea09b1e43040e944f4c5472b0f5e58983bf37aaf
7
- data.tar.gz: e4c9426c4e948fca50c3708a8a0e57588b4b18c51a5ac8df0bd2dd902aa2440a20d8d1f6a464333bb9c3244d5ff6901070645bb932fd5fb6e77f3d3f82ff9f83
6
+ metadata.gz: 37b9a760ddbaf054b4a0db7d6c60ffa30f5534feb410b71339c2ed5f374d321722fdac22db6d5731cd363d4e11b328d123242bf2effd6cc284768ede5a383e50
7
+ data.tar.gz: 6f46d935941d7d82399e178254058de3b9455f699f5e091744add873ff6c244e07fb0492f9ffb802123ebdd836b46a48f8283bc19f3f15e8c1ffa2f60f42422d
data/CHANGELOG.md CHANGED
@@ -7,6 +7,55 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
 
8
8
  ## [Unreleased]
9
9
 
10
+ ## [0.8.0] - 2026-09-10
11
+
12
+ Closes the feature-parity gap against CrewAI's `1.x` line. Adds **LLM message
13
+ interceptors**, an **event hierarchy** with safe fan-out, **task-level
14
+ checkpointing** with resume and lineage, and **four new providers** (AWS
15
+ Bedrock, Snowflake Cortex, any OpenAI-compatible endpoint, and OpenAI's
16
+ Responses API).
17
+
18
+ Almost entirely additive. One behavior change — `Events.fan_out` now serializes
19
+ delivery, so stream subscribers no longer need their own mutex; sinks that
20
+ already lock remain correct. See **Changed** below.
21
+
22
+ Also repairs `bin/rcrewai`, which had never worked in any published version.
23
+
24
+ ### Added
25
+
26
+ #### Interceptors & observability
27
+ - LLM message interceptors: `before_request` / `after_response` hooks on every provider client (`LLMClients::Base`), registered via block, callable, or the `before_request:` / `after_response:` constructor kwargs. A `before_request` hook receives `(payload, context)` and may return a replacement payload; an `after_response` hook receives `(result, context)` and may return a replacement result. Returning `nil` keeps the original, so a pure-observer hook needs no return value. `context` carries `:provider` and `:model`, and `after_response` adds `:duration_ms`. Hooks run in registration order, threading the value through. A hook that raises is reported to stderr and skipped — instrumentation never breaks a call. Wired on both the plain and streaming paths of all five providers.
28
+ - Event hierarchy: every `Events::*` event now carries an auto-assigned `:id`, and `:parent_id` naming the enclosing span. `Events.with_parent(id) { ... }` opens a span for the current thread (nesting, restored on exit, and on raise); `Events.emit(sink, event)` stamps the enclosing parent before delivery. Both runners (`ToolRunner`, `LegacyReactRunner`) open a per-run span, so a subscriber can reassemble the flat stream into a tree — what tracing exporters need.
29
+
30
+ #### Checkpointing
31
+ - Checkpointing: `crew.execute(checkpoint: store)` records durable per-run state, and `crew.resume(run_id)` replays completed tasks instead of re-executing them. Granularity is task-level — a checkpoint is written after each task settles, so a crash loses at most the task in flight. Failed tasks are recorded as failed rather than omitted, so a resume retries them instead of treating them as never-attempted. Supported on the sequential, hierarchical, and consensual processes.
32
+ - Checkpoint stores follow the existing `Flow::StateStore` shape (`save`/`load`/`list`/`delete`): `Checkpoint::MemoryStore` (volatile) and `Checkpoint::FileStore` (one JSON file per run). `FileStore` rejects run ids containing path separators or traversal segments, since ids arrive both from callers and from stored records.
33
+ - Lineage: a resumed run gets its own run id linked to its parent via `parent_run_id`, leaving the original record intact. `Checkpoint.lineage(store, run_id)` walks the chain back to the root, truncating rather than raising if an ancestor has been pruned.
34
+ - CLI: `rcrewai checkpoint list` / `info RUN_ID` / `delete RUN_ID` inspect saved checkpoints (`--dir`, default `.rcrewai/checkpoints`).
35
+
36
+ #### Providers
37
+ - New providers: `:openai_compatible` (any endpoint speaking the OpenAI Chat Completions format — Together, Groq, Fireworks, vLLM, LiteLLM, OpenRouter, a self-hosted gateway; requires `base_url`), `:bedrock` (AWS Bedrock via the Converse API, giving every Bedrock model one request shape; requires `aws_region`), and `:snowflake` (Snowflake Cortex inference; requires `snowflake_account`). New configuration attributes `aws_region` and `snowflake_account`, also read from `AWS_REGION`/`AWS_DEFAULT_REGION` and `SNOWFLAKE_ACCOUNT`.
38
+ - `:openai_responses` — OpenAI's Responses API alongside the existing Chat Completions client. Messages go under `input` with the system prompt lifted to `instructions`, `max_tokens` becomes `max_output_tokens`, tools are sent flat rather than nested under `function`, and the `output` array is parsed back into the canonical `content` / `tool_calls` shape. An `incomplete` response capped by `max_output_tokens` is reported as `finish_reason: :length`. Non-streaming only — Responses streams a distinct set of semantic events that this client does not model.
39
+ - `LLMClient::PROVIDERS` — provider resolution is now a table rather than a `case`, so registering a client is a one-line change.
40
+
41
+
42
+ ### Changed
43
+ - **Behavior change:** subscribers passed to `crew.execute(stream:)` no longer need their own mutex. Existing sinks that lock are unaffected.
44
+
45
+ ### Fixed
46
+ - `Events.fan_out` now serializes delivery: sinks are invoked under a mutex, so a sink shared by concurrently executing agents is never entered from two threads at once. Previously it called sinks inline on the emitting thread with no serialization, which under `async: true` meant every subscriber had to do its own locking or race — the 0.7.1 notes documented this as a caveat, but for any aggregating subscriber it was a live defect. The lock is reentrant, so a sink that emits back through the same fan-out does not deadlock. Sinks that already lock internally remain correct.
47
+ - `LLMClient.for_provider` silently dropped interceptor hooks: it constructed each client with only the config, so `before_request` / `after_response` passed through the normal resolution path never reached the client. It now forwards them.
48
+ - `bin/rcrewai` never worked. `lib/rcrewai/cli.rb` defined `def run`, which Thor reserves, so the class raised `"run" is a Thor reserved word` on load; the file was consequently never required from `lib/rcrewai.rb`, which hid the breakage from the test suite while `bin/rcrewai` — shipped as a gem executable since the initial commit — crashed for every installed user. The command is now defined as `run_crew` and mapped back to `run`, so the user-facing invocation (`rcrewai run --crew NAME`) is unchanged, and the CLI is required and covered by specs.
49
+
50
+ ## [0.7.1] - 2026-08-13
51
+
52
+ ### Fixed
53
+ - `Crew#execute` built its event sink but never delivered it to agents, so no agent-level events (`IterationStart`/`IterationEnd`, tool calls, token usage) reached a sink passed to `crew.execute(stream:)`. `Task` now carries a `stream_sink` that `Crew` populates at execute time and passes to `Agent#execute_task`; the two `Process` call sites that bypass `Task#execute` read `crew.stream_sink` directly. Subscribers now receive the full event stream on the sync, async, hierarchical, and consensual paths.
54
+ - Tasks retained a reference to the caller's sink after `execute` returned, keeping request-scoped subscribers reachable for the lifetime of the task object. The sink is now cleared in an `ensure`.
55
+
56
+ ### Note
57
+ - `Events.fan_out` invokes sinks inline on the emitting thread with no serialization, so under `async: true` a sink may be called concurrently from multiple worker threads. Subscribers must do their own locking. **Superseded in `0.8.0`:** fan-out now serializes delivery.
58
+
10
59
  ## [0.7.0] - 2026-07-07
11
60
 
12
61
  Turns the `:consensual` crew process from a stub into a real multi-agent
@@ -217,7 +266,8 @@ output, guardrails, planning, and training/testing. See `ROADMAP.md`.
217
266
  - CLI usage documentation
218
267
  - Real-world use cases and examples
219
268
 
220
- [Unreleased]: https://github.com/gkosmo/rcrewAI/compare/v0.7.0...HEAD
269
+ [Unreleased]: https://github.com/gkosmo/rcrewAI/compare/v0.7.1...HEAD
270
+ [0.7.1]: https://github.com/gkosmo/rcrewAI/compare/v0.7.0...v0.7.1
221
271
  [0.7.0]: https://github.com/gkosmo/rcrewAI/compare/v0.6.1...v0.7.0
222
272
  [0.6.1]: https://github.com/gkosmo/rcrewAI/compare/v0.6.0...v0.6.1
223
273
  [0.6.0]: https://github.com/gkosmo/rcrewAI/compare/v0.5.0...v0.6.0
data/ROADMAP.md CHANGED
@@ -5,85 +5,154 @@ This roadmap tracks feature parity between **RCrewAI** (Ruby) and the upstream
5
5
 
6
6
  ## Current status
7
7
 
8
- - **RCrewAI:** `0.3.0` (2026-05-12)
9
- - **Upstream crewai:** `1.15.x` (mid-2026)
8
+ - **RCrewAI:** `0.7.1` released; `0.8.0`, `0.9.0` and `0.9.x` merged to `main`, unreleased
9
+ - **Upstream crewai:** `1.15.21`
10
10
 
11
11
  RCrewAI is a faithful port of CrewAI's **"Crews"** mental model (Agents / Tasks /
12
- Crew, sequential + hierarchical processes, tools, memory, human-in-the-loop). As
13
- of `0.3.0` the LLM plumbing is modern: native function calling across all five
14
- providers, a tool-schema DSL, typed streaming events, MCP client, and per-model
15
- pricing.
12
+ Crew, sequential + hierarchical + consensual processes, tools, memory,
13
+ human-in-the-loop), and it carries CrewAI's second pillar (**Flows**) plus
14
+ **Knowledge (RAG)**, **guardrails**, **structured output**, **planning**, and
15
+ **training/testing**. In one area — cognitive memory (semantic recall, SQLite
16
+ persistence, four memory types) — the gem went past what was originally ported.
17
+
18
+ **Status: one milestone remaining.** An earlier revision of this file declared
19
+ parity "complete" against a matrix that only covered CrewAI through roughly
20
+ `1.0` (October 2025) while quoting `1.15.x` in its header; everything upstream
21
+ added across `1.1`–`1.15` was unmeasured. That delta was re-derived, and three
22
+ of the four scheduled milestones have since shipped. Only native async (1.0.0)
23
+ is outstanding, and it is blocked on an open decision — see below.
16
24
 
17
- Since CrewAI's `1.0`, the framework grew a second pillar (**Flows**) plus
18
- **Knowledge (RAG)**, **Guardrails**, **structured output**, **Planning**, and
19
- **Training/Testing**. RCrewAI now implements all of these — see the matrix below.
25
+ ## Parity matrix
20
26
 
21
- **Status: complete.** All milestone issues (#5–#12) shipped in v0.4.0, and all
22
- backlog items (#15–#20) shipped in v0.5.0. There is no outstanding roadmap work.
27
+ ### Shipped
28
+
29
+ | Concept | crewai | RCrewAI |
30
+ |---|---|---|
31
+ | Agents / Tasks / Crew | ✅ | ✅ |
32
+ | Sequential / hierarchical process | ✅ | ✅ |
33
+ | Consensual process (propose → vote → pick) | ✅ | ✅ (0.7.0) |
34
+ | Native function calling + tool DSL | ✅ | ✅ (0.3.0) |
35
+ | Streaming events | ✅ | ✅ (0.3.0) |
36
+ | MCP client | ✅ | ✅ (0.3.0) |
37
+ | Per-model pricing / cost | ✅ | ✅ (0.3.0) |
38
+ | Per-agent LLM override | ✅ | ✅ (0.4.0) |
39
+ | Structured output (schema) | ✅ | ✅ (0.4.0) |
40
+ | Task guardrails | ✅ | ✅ (0.4.0) |
41
+ | `output_file` / markdown | ✅ | ✅ (0.4.0) |
42
+ | Knowledge / RAG | ✅ | ✅ (0.4.0) |
43
+ | Planning | ✅ | ✅ (0.4.0) |
44
+ | Flows (`start`/`listen`/`router`) | ✅ | ✅ (0.4.0) |
45
+ | Flow state + persistence | ✅ | ✅ (0.4.0) |
46
+ | Training / testing | ✅ | ✅ (0.4.0) |
47
+ | Lifecycle hooks, batch kickoff, rate limiting | ✅ | ✅ (0.5.0) |
48
+ | Reasoning, context window, multimodal | ✅ | ✅ (0.5.0) |
49
+ | Cognitive memory (semantic, persistent, typed) | ✅ | ✅ (0.6.x) |
50
+ | LLM message interceptor hooks | ✅ | ✅ (0.8.0) |
51
+ | Event hierarchy + safe fan-out | ✅ | ✅ (0.8.0) |
52
+ | Checkpointing (save / resume / lineage) | ✅ | ✅ (0.9.0) |
53
+ | Newer providers (Bedrock, Cortex, OpenAI-compatible) | ✅ | ✅ (0.9.x) |
54
+ | OpenAI Responses API | ✅ | ✅ (0.9.x) |
55
+
56
+ ### Gaps
57
+
58
+ | Concept | crewai | RCrewAI | Plan |
59
+ |---|---|---|---|
60
+ | Native async (LLM + tool level) | ✅ (1.4–1.6) | ⚠️ partial | 1.0.0 |
61
+ | OTel export for the event hierarchy | ✅ (1.10+) | ❌ | 1.0.x |
62
+ | Streaming for Bedrock / Responses | ✅ | ❌ | 1.0.x |
63
+ | Bedrock SigV4 signing | ✅ | ❌ (hook workaround) | 1.0.x |
64
+ | A2A (agent-to-agent) | ✅ (1.7–1.9) | ❌ | deferred |
23
65
 
24
- ## Parity matrix
66
+ ### Out of scope
67
+
68
+ Three upstream areas are deliberately **not** targets. They are CrewAI's
69
+ commercial platform surface rather than framework capability, and porting them
70
+ means tracking someone else's product roadmap with no Ruby-side consumer:
71
+
72
+ - **JSON-first project format** (`agents/*.jsonc`, `crew.jsonc`, declarative and
73
+ conversational flows in the CLI TUI) — a config format whose shape is set by
74
+ upstream's tooling.
75
+ - **Skills Repository** — a hosted registry plus authentication.
76
+ - **Policies** — CrewAI enforces these at the infrastructure level via the NVIDIA
77
+ OpenShell runtime. Reimplementing them in-process would provide the appearance
78
+ of enforcement without the property that makes enforcement worth having.
79
+
80
+ If a Ruby-side need for any of these appears, revisit — but not speculatively.
81
+
82
+ ## Milestones
83
+
84
+ ### 0.8.0 — Interceptors & observability ✅ shipped (#39)
85
+
86
+ `before_request` / `after_response` hooks on `LLMClients::Base`, inherited by
87
+ every provider and wired on both the plain and streaming paths. Events gained
88
+ `:id` / `:parent_id` with `Events.with_parent` spans opened per agent run.
89
+
90
+ `Events.fan_out` now serializes delivery under a reentrant mutex, fixing a live
91
+ race: it previously called sinks inline on the emitting thread, so under
92
+ `async: true` an aggregating subscriber was entered from several pool workers at
93
+ once. **Behavior change:** subscribers no longer need their own mutex.
94
+
95
+ ### 0.9.0 — Checkpointing ✅ shipped (#42)
96
+
97
+ Task-level `crew.execute(checkpoint: store)` / `crew.resume(run_id)` across the
98
+ sequential, hierarchical and consensual processes, with `MemoryStore` and
99
+ `FileStore` following the `Flow::StateStore` shape. Resumed runs link to their
100
+ parent via `parent_run_id`; `Checkpoint.lineage` walks the chain to the root.
101
+ CLI: `rcrewai checkpoint list|info|delete`.
102
+
103
+ Also repaired `bin/rcrewai`, which had never worked: `lib/rcrewai/cli.rb`
104
+ defined `def run`, a Thor reserved word, so the class raised on load and the
105
+ file was never required — hiding the breakage from the suite while the shipped
106
+ gem executable crashed for every installed user.
107
+
108
+ ### 0.9.x — Providers & Responses API ✅ shipped (#41)
109
+
110
+ `:openai_compatible`, `:bedrock` (Converse v4), `:snowflake` (Cortex) and
111
+ `:openai_responses`. Provider resolution moved to a `LLMClient::PROVIDERS`
112
+ table, which also fixed `for_provider` silently dropping interceptor hooks.
113
+
114
+ Two deliberate limitations carried forward to 1.0.x: Bedrock does not implement
115
+ SigV4 (a hard `aws-sigv4` dependency for one provider is not worth it; sign via
116
+ a `before_request` hook), and Bedrock/Responses are non-streaming only.
117
+
118
+ ### 1.0.0 — Native async
119
+
120
+ The largest item, and the one with a genuine architecture decision attached.
121
+ Today `AsyncExecutor` fans tasks out across a `Concurrent::ThreadPoolExecutor` in
122
+ dependency-ordered phases; concurrency stops at the task boundary. CrewAI went
123
+ async *through* the LLM and tool calls (1.4–1.6), covering flows, crews, tasks,
124
+ knowledge, and memory.
125
+
126
+ Ruby has no direct port of that. Two candidate models:
127
+
128
+ 1. **Fibers** via the `async` gem — closer to upstream's shape, new runtime
129
+ dependency, and every provider client's HTTP layer has to cooperate.
130
+ 2. **Stay on threads** and make the client layer non-blocking — smaller
131
+ conceptual change, keeps `concurrent-ruby`, less faithful to upstream.
132
+
133
+ **This decision is open and blocks the milestone.** It touches all five LLM
134
+ clients either way. The 8.2k lines of `lib/` are backed by 4.9k lines of spec,
135
+ which is what makes a refactor at this depth tractable.
136
+
137
+ ### Deferred — A2A
138
+
139
+ Agent-to-agent task execution utilities and server configuration (upstream
140
+ 1.7–1.9). Real framework capability, but it presumes a deployment topology that
141
+ no current RCrewAI user has asked for. Revisit once the items above land.
142
+
143
+ ## Sequencing
25
144
 
26
- | Concept | crewai | RCrewAI 0.3.0 | Target |
145
+ | Milestone | Contents | Risk | Status |
27
146
  |---|---|---|---|
28
- | Agents / Tasks / Crew | | ✅ | |
29
- | Sequential / hierarchical process | | ✅ | |
30
- | Native function calling + tool DSL | | ✅ (0.3.0) | — |
31
- | Streaming events | | (0.3.0) | |
32
- | MCP client | ✅ | ✅ (0.3.0) | — |
33
- | Per-model pricing / cost | | (0.3.0) | |
34
- | Per-agent LLM override | | (#5) | ✅ done |
35
- | Structured output (schema) | ✅ | ✅ (#6) | ✅ done |
36
- | Task guardrails | | (#7) | done |
37
- | `output_file` / markdown | | (#8) | done |
38
- | Knowledge / RAG | | (#9) | done |
39
- | Planning | | ✅ (#10) | ✅ done |
40
- | Flows (`start`/`listen`/`router`) | ✅ | ✅ (#11) | ✅ done |
41
- | Flow state + persistence | ✅ | ✅ (#11) | ✅ done |
42
- | Training / Testing | ✅ | ✅ (#12) | ✅ done |
43
- | Reasoning, rate-limiting, batch kickoff, hooks, context window, multimodal | ✅ | ✅ (#15–#20) | ✅ done |
44
-
45
- ## Milestones (highest leverage first)
46
-
47
- ### 0.3.1 — Per-agent LLM override
48
- Let `Agent.new(llm:)` accept a provider/model, instead of only the global
49
- `RCrewAI.configure`. Unblocks mixed-model crews (cheap model for workers, strong
50
- model for the manager).
51
-
52
- ### 0.4.0 — Structured output & guardrails
53
- Builds directly on the 0.3.0 tool-schema/JSON-schema plumbing.
54
- - `Task.new(output_schema:)` → validated, coerced structured result.
55
- - `Task.new(guardrail:)` → proc/object that validates & transforms output, with
56
- bounded retries (`guardrail_max_retries`).
57
- - `output_file:` + `markdown:` output formatting.
58
-
59
- ### 0.5.0 — Knowledge (RAG) & Planning
60
- - Knowledge sources: string, `.txt`, PDF (have `pdf-reader`), CSV, JSON, URL
61
- (have `nokogiri`). Embeddings client + a pluggable vector store (start with an
62
- in-memory / SQLite cosine store; no hard Chroma dependency).
63
- - Attach at agent **and** crew level.
64
- - `Crew.new(planning: true)` → a planner pass that drafts a step plan before
65
- execution.
66
-
67
- ### 0.6.0 — Flows
68
- The flagship. A Ruby DSL mirroring CrewAI Flows:
69
- - `start`, `listen`, `router` decorators/class-methods.
70
- - `and_` / `or_` trigger combinators.
71
- - Structured flow **state** (a plain struct/`Data` or dry-struct) with a UUID.
72
- - `@persist`-equivalent state persistence across restarts.
73
- - `human_feedback` pause/resume point.
74
-
75
- ### 0.7.0 — Training & Testing
76
- - `crew.train(n_iterations:, filename:)` capturing human feedback.
77
- - `crew.test(n_iterations:, model:)` scoring runs.
78
-
79
- ### Backlog — ✅ all complete
80
-
81
- Formerly polish items with no set version; all shipped in the `[Unreleased]`
82
- changes (see CHANGELOG):
83
-
84
- - [#15](https://github.com/gkosmo/rcrewAI/issues/15) — `before_kickoff` / `after_kickoff` lifecycle hooks ✅
85
- - [#16](https://github.com/gkosmo/rcrewAI/issues/16) — `kickoff_for_each` batch execution ✅
86
- - [#17](https://github.com/gkosmo/rcrewAI/issues/17) — `max_rpm` rate limiting ✅
87
- - [#18](https://github.com/gkosmo/rcrewAI/issues/18) — per-agent reasoning (`reasoning:`, `max_reasoning_attempts:`) ✅
88
- - [#19](https://github.com/gkosmo/rcrewAI/issues/19) — `respect_context_window` history trimming ✅
89
- - [#20](https://github.com/gkosmo/rcrewAI/issues/20) — multimodal agents (image/file inputs) ✅
147
+ | 0.8.0 | Interceptors + observability | Low | ✅ merged (#39) |
148
+ | 0.9.0 | Checkpointing | Moderate | ✅ merged (#42) |
149
+ | 0.9.x | Providers, Responses API | Low | ✅ merged (#41) |
150
+ | 1.0.0 | Native async | High decision open | blocked |
151
+
152
+ The three shipped milestones are on `main` and unreleased; they want a version
153
+ bump and a release before or alongside 1.0.0 work.
154
+
155
+ **1.0.0 is blocked on the fibers-vs-threads decision above.** It is the only
156
+ remaining scheduled work, and the largest single change in this roadmap: it
157
+ touches all nine provider clients and the executor. Nothing else should start
158
+ before that call is made.
data/docs/api/agent.md CHANGED
@@ -28,6 +28,14 @@ Creates a new agent instance.
28
28
  - `human_input` (Boolean, optional) - Enable human-in-the-loop interactions (default: false)
29
29
  - `require_approval_for_tools` (Boolean, optional) - Require human approval for tool usage
30
30
  - `require_approval_for_final_answer` (Boolean, optional) - Require human approval for final results
31
+ - `llm` (Symbol \| Hash \| client, optional) - Per-agent LLM override: a provider symbol (`:anthropic`), an options hash (`{ provider:, model:, api_key:, temperature: }`), or a pre-built client. Defaults to the global configuration. See [Advanced Agent Options]({{ site.baseurl }}/tutorials/agent-options)
32
+ - `reasoning` (Boolean, optional) - Run a reasoning/planning pass before answering (default: false); surfaced on the result as `:reasoning`
33
+ - `max_reasoning_attempts` (Integer, optional) - Reasoning retries on empty output (default: 3)
34
+ - `respect_context_window` (Boolean, optional) - Trim history to fit the model's context window (default: false)
35
+ - `max_rpm` (Integer, optional) - Throttle the agent's LLM calls to this many requests per minute (default: unlimited)
36
+ - `knowledge` (Knowledge::Base, optional) - A knowledge base to ground the agent (see [Knowledge (RAG)]({{ site.baseurl }}/tutorials/knowledge))
37
+ - `knowledge_sources` (Array, optional) - Knowledge sources the agent wraps in a base
38
+ - `memory` (Memory \| Hash, optional) - A pre-built `Memory`, or options (`{ embedder:, store:, scope:, short_term_limit:, entity_extractor: }`); defaults to zero-config in-memory (see [Cognitive Memory]({{ site.baseurl }}/tutorials/memory))
31
39
 
32
40
  **Returns:** `RCrewAI::Agent` instance
33
41
 
data/docs/api/crew.md CHANGED
@@ -10,18 +10,26 @@ The Crew class is the main orchestrator in RCrewAI. It manages a collection of a
10
10
 
11
11
  ## Class Methods
12
12
 
13
- ### `.new(name)`
13
+ ### `.new(name, **options)`
14
14
 
15
15
  Creates a new crew instance.
16
16
 
17
17
  **Parameters:**
18
18
  - `name` (String) - The name of the crew
19
+ - `process` (Symbol, optional) - `:sequential` (default), `:hierarchical`, or `:consensual`
20
+ - `consensus_agents` (Integer, optional) - For `:consensual`, how many agents propose and vote per task (default: 3). See [Consensual Process]({{ site.baseurl }}/tutorials/consensual-process)
21
+ - `planning` (Boolean, optional) - Run a planner pass that drafts a per-task plan before execution (default: false)
22
+ - `planning_llm` (Symbol \| Hash \| client, optional) - The planner's LLM (defaults to the global provider)
23
+ - `knowledge` (Knowledge::Base, optional) - A knowledge base shared with all agents
24
+ - `knowledge_sources` (Array, optional) - Sources the crew wraps in a shared base (see [Knowledge (RAG)]({{ site.baseurl }}/tutorials/knowledge))
25
+ - `verbose` (Boolean, optional) - Detailed logging (default: false)
26
+ - `max_iterations` (Integer, optional) - Max iterations per agent (default: 10)
19
27
 
20
28
  **Returns:** `RCrewAI::Crew` instance
21
29
 
22
30
  **Example:**
23
31
  ```ruby
24
- crew = RCrewAI::Crew.new("research_team")
32
+ crew = RCrewAI::Crew.new("research_team", process: :consensual, consensus_agents: 3)
25
33
  ```
26
34
 
27
35
  ### `.create(name)`
@@ -342,4 +350,46 @@ crew.add_agent(manager)
342
350
  # Add other agents...
343
351
 
344
352
  crew.execute
345
- ```
353
+ ```
354
+
355
+ ### Consensual Process
356
+
357
+ Agents propose competing answers and vote to pick the best (see the
358
+ [Consensual Process]({{ site.baseurl }}/tutorials/consensual-process) tutorial).
359
+
360
+ ```ruby
361
+ crew = RCrewAI::Crew.new("panel", process: :consensual, consensus_agents: 3)
362
+ crew.add_agent(junior)
363
+ crew.add_agent(senior)
364
+ crew.add_task(task)
365
+
366
+ crew.execute # each task: propose → vote → pick
367
+ ```
368
+
369
+ ## Lifecycle, Batch, Training
370
+
371
+ ### `#before_kickoff { |inputs| ... }` / `#after_kickoff { |result| ... }`
372
+
373
+ Register callbacks that run before/after execution. A `before_kickoff` hook
374
+ receives the inputs hash (from `execute(inputs:)`) and may transform it; an
375
+ `after_kickoff` hook receives and may transform the result. The resolved inputs
376
+ are exposed on `#last_inputs`.
377
+
378
+ ### `#kickoff_for_each(inputs:)`
379
+
380
+ Runs the crew once per input set, returning one result per input in order. Runs
381
+ are isolated to their own inputs.
382
+
383
+ ```ruby
384
+ results = crew.kickoff_for_each(inputs: [{ topic: "ruby" }, { topic: "python" }])
385
+ ```
386
+
387
+ ### `#train(n_iterations:, filename:, feedback: nil)`
388
+
389
+ Runs the crew repeatedly, collects feedback after each run (via a `feedback:`
390
+ callable, defaulting to a human prompt), and persists it to JSON.
391
+
392
+ ### `#test(n_iterations:, scorer: nil)`
393
+
394
+ Runs the crew repeatedly and reports per-run and average scores (via a `scorer:`
395
+ callable, defaulting to the run's success rate).
data/docs/api/index.md CHANGED
@@ -19,23 +19,24 @@ Individual AI agents with specific roles and capabilities.
19
19
  ### [RCrewAI::Task]({{ site.baseurl }}/api/task)
20
20
  Tasks that agents execute to achieve goals.
21
21
 
22
- ## Tools
22
+ ## Capabilities (0.4 – 0.7)
23
+
24
+ These subsystems are covered in depth by the tutorials (with runnable examples):
23
25
 
24
- ### [RCrewAI::Tools::WebSearch]({{ site.baseurl }}/api/tools/web-search)
25
- Enable agents to search the web for information.
26
+ - **`RCrewAI::Flow`** — event-driven workflows. See [Flows]({{ site.baseurl }}/tutorials/flows)
27
+ - **`RCrewAI::Knowledge::Base`** and sources/embedders RAG. See [Knowledge]({{ site.baseurl }}/tutorials/knowledge)
28
+ - **`RCrewAI::Memory`** (+ `SqliteStore`, memory types) — cognitive memory. See [Memory]({{ site.baseurl }}/tutorials/memory)
29
+ - **Consensual process** — multi-agent voting. See [Consensual Process]({{ site.baseurl }}/tutorials/consensual-process)
30
+ - **Advanced agent/task options** — per-agent LLM, reasoning, rate limiting, context window, multimodal, structured output, guardrails, hooks. See [Advanced Options]({{ site.baseurl }}/tutorials/agent-options)
26
31
 
27
- ### [RCrewAI::Tools::FileSystem]({{ site.baseurl }}/api/tools/file-system)
28
- Allow agents to read and write files.
32
+ ## Tools
29
33
 
30
- ### [RCrewAI::Tools::Database]({{ site.baseurl }}/api/tools/database)
31
- Connect agents to databases for data operations.
34
+ See the [Tools System]({{ site.baseurl }}/api/tools) reference for the full API.
35
+ Built-in tools include `WebSearch`, `FileReader`, `FileWriter`, `SqlDatabase`,
36
+ `EmailSender`, `PdfProcessor`, and `CodeExecutor` — plus native function calling
37
+ and MCP servers.
32
38
 
33
39
  ## Configuration
34
40
 
35
41
  ### [RCrewAI::Configuration]({{ site.baseurl }}/api/configuration)
36
- Configure LLM providers and other settings.
37
-
38
- ## CLI
39
-
40
- ### [RCrewAI::CLI]({{ site.baseurl }}/api/cli)
41
- Command-line interface for managing crews.
42
+ Configure LLM providers, models, and other settings.
data/docs/api/task.md CHANGED
@@ -32,6 +32,13 @@ Creates a new task instance.
32
32
  - `allow_guidance` (Boolean) - Allow human guidance during execution
33
33
  - `human_review_points` (Array) - Points where human review is requested ([:completion, :error])
34
34
  - `async` (Boolean) - Whether task can be executed asynchronously (default: false)
35
+ - `output_schema` (Hash) - A JSON-schema subset the output is validated/coerced against; parsed result on `#structured_output` (raw string on `#raw_result`). Non-conforming output re-runs the agent with the error fed back
36
+ - `guardrail` (callable) - `->(output) { [ok, value_or_error] }` to validate/transform output before it flows downstream
37
+ - `guardrail_max_retries` (Integer) - Guardrail retries with the reason fed back (default: 3)
38
+ - `output_file` (String) - Path to write the result to after completion
39
+ - `create_directory` (Boolean) - Create the output file's parent dirs (default: true)
40
+ - `markdown` (Boolean) - Prepend a heading when the output isn't already markdown (default: false)
41
+ - `attachments` (Array) - Multimodal image inputs, e.g. `[{ type: :image, path: 'x.png' }]` or `{ type: :image, url: '...' }` (OpenAI/Azure). See [Advanced Agent Options]({{ site.baseurl }}/tutorials/agent-options)
35
42
 
36
43
  **Returns:** `RCrewAI::Task` instance
37
44
 
@@ -30,9 +30,10 @@ require 'benchmark'
30
30
  RCrewAI.configure do |config|
31
31
  config.llm_provider = :openai
32
32
  config.temperature = 0.4
33
- config.max_concurrent_tasks = 8 # Allow up to 8 concurrent tasks
34
- config.task_timeout = 300 # 5-minute timeout per task
33
+ config.timeout = 300 # request timeout (seconds)
35
34
  end
35
+ # Concurrency is a per-run option, not global config:
36
+ # crew.execute(async: true, max_concurrency: 8)
36
37
 
37
38
  # ===== CONCURRENT PROCESSING TOOLS =====
38
39
 
@@ -885,9 +886,11 @@ context: [] # Dependency management continues with available results
885
886
  Designed for horizontal and vertical scaling:
886
887
 
887
888
  ```ruby
888
- config.max_concurrent_tasks = 8 # Configurable concurrency
889
- config.task_timeout = 300 # Timeout management
890
- config.resource_pool_size = 16 # Shared resource scaling
889
+ # Concurrency is controlled per run via the async executor:
890
+ crew.execute(async: true, max_concurrency: 8) # up to 8 concurrent tasks
891
+
892
+ # Request timeout is global config:
893
+ RCrewAI.configure { |c| c.timeout = 300 }
891
894
  ```
892
895
 
893
896
  This concurrent processing system provides a complete framework for optimizing performance through intelligent parallel execution while maintaining reliability and quality standards across all processing streams.
@@ -25,12 +25,12 @@ require 'time'
25
25
 
26
26
  # Configure RCrewAI
27
27
  RCrewAI.configure do |config|
28
- config.llm_client = :openai
28
+ config.llm_provider = :openai
29
29
  config.openai_api_key = ENV['OPENAI_API_KEY']
30
30
  config.log_level = :info
31
- config.max_concurrent_tasks = 6
32
- config.task_timeout = 300
31
+ config.timeout = 300 # request timeout (seconds)
33
32
  end
33
+ # Concurrency is set per run: crew.execute(async: true, max_concurrency: 6)
34
34
 
35
35
  # Base tool for common functionality
36
36
  class CompositeToolBase < RCrewAI::Tools::Base
data/docs/index.md CHANGED
@@ -19,16 +19,31 @@ Build powerful AI agent crews in Ruby that work together to accomplish complex t
19
19
  ## Features
20
20
 
21
21
  - **🤖 Intelligent Agents**: AI agents with reasoning loops, memory, and tool usage capabilities
22
- - **🔗 Multi-LLM Support**: OpenAI, Anthropic (Claude), Google (Gemini), Azure OpenAI, and Ollama
23
- - **🛠️ Rich Tool Ecosystem**: Web search, file operations, SQL, email, code execution, PDF processing, and custom tools
24
- - **🧠 Agent Memory**: Short-term and long-term memory for learning from past executions
22
+ - **🔗 Multi-LLM Support**: OpenAI, Anthropic (Claude), Google (Gemini), Azure OpenAI, and Ollama — configurable per agent
23
+ - **🛠️ Rich Tool Ecosystem**: Native function calling, MCP servers, web search, file operations, SQL, email, code execution, PDF processing, and custom tools
24
+ - **🌊 Flows**: Event-driven workflows (`start`/`listen`/`router`) with branching and persistent state
25
+ - **📚 Knowledge (RAG)**: Ground agents in your own documents (string/file/PDF/CSV/URL) with built-in retrieval
26
+ - **🧠 Cognitive Memory**: Semantic recall (embeddings + cosine) with optional SQLite persistence and short-term/long-term/entity/tool memory types
27
+ - **📤 Structured Output & Guardrails**: Schema-validated task output and validate/transform guardrails
28
+ - **🗳️ Flexible Orchestration**: Sequential, hierarchical, and consensual (propose → vote → pick) processes, plus async execution
25
29
  - **🤝 Human-in-the-Loop**: Interactive approval workflows, human guidance, and collaborative decision making
26
- - **⚡ Advanced Task System**: Dependencies, retries, async/concurrent execution, and context sharing
27
- - **🏗️ Hierarchical Teams**: Manager agents that coordinate and delegate tasks to specialist agents
28
- - **🔒 Production Ready**: Security controls, error handling, logging, monitoring, and sandboxing
29
- - **🎯 Flexible Orchestration**: Sequential, hierarchical, and concurrent execution modes
30
+ - **⚡ Advanced Task System**: Dependencies, retries, async/concurrent execution, planning, and context sharing
31
+ - **🎛️ Production Controls**: Rate limiting (`max_rpm`), context-window management, reasoning passes, multimodal input, and streaming events with cost tracking
30
32
  - **💎 Ruby-First Design**: Built specifically for Ruby developers with idiomatic patterns
31
33
 
34
+ ## What's new (0.4 – 0.7)
35
+
36
+ RCrewAI has expanded well beyond the classic crew model. Recent releases added:
37
+
38
+ - **[Flows]({{ site.baseurl }}/tutorials/flows)** — a second orchestration pillar for event-driven, stateful workflows
39
+ - **[Knowledge / RAG]({{ site.baseurl }}/tutorials/knowledge)** — retrieval-augmented grounding from your own documents
40
+ - **[Cognitive Memory]({{ site.baseurl }}/tutorials/memory)** — semantic, persistent, multi-type agent memory
41
+ - **[Consensual process]({{ site.baseurl }}/tutorials/consensual-process)** — multi-agent voting to pick the best answer
42
+ - **[Advanced agent options]({{ site.baseurl }}/tutorials/agent-options)** — per-agent LLM, reasoning, rate limiting, context-window management, multimodal, structured output, guardrails, and lifecycle hooks
43
+
44
+ See the [CHANGELOG](https://github.com/gkosmo/rcrewAI/blob/main/CHANGELOG.md) and the
45
+ per-release upgrade guides (e.g. [upgrading to 0.7](https://github.com/gkosmo/rcrewAI/blob/main/docs/upgrading-to-0.7.md)) for details.
46
+
32
47
  ## Quick Start
33
48
 
34
49
  ### Basic Agent Collaboration