The engine requires rcrewai ~> 0.10.0. Every capability is configured through columns on the persisted models and forwarded to the core objects at build time — all off/absent by default.
Columns on an Agent that shape how it thinks and calls the LLM.
| Column | Effect |
|---|---|
max_rpm | Rate-limit the agent's LLM calls (requests/minute). |
reasoning / max_reasoning_attempts | Run a reasoning pass before answering. |
respect_context_window | Trim history to fit the model's context window. |
parallel_tools | Run a turn's tool calls concurrently (nil uses the gem default of on). |
llm_config (JSON) | Per-agent LLM override. |
memory_enabled + memory_scope + memory_short_term_limit | Enable cognitive memory. |
agent = crew.agents.create!(
name: "researcher", role: "Researcher", goal: "Find facts",
reasoning: true,
max_rpm: 30,
# Current Claude models also need RCrewAI's temperature set to nil.
llm_config: { provider: "anthropic", model: "claude-opus-5-5" },
memory_enabled: true, memory_scope: "research", memory_short_term_limit: 20
)
Columns on a Task that validate, transform, and route its output.
| Column | Effect |
|---|---|
output_schema (JSON) | Validate/coerce the result against a JSON schema. |
guardrail_class + guardrail_method_name + guardrail_max_retries | Validate/transform output with retries. |
output_file + create_directory + markdown | Write the result to disk. |
attachments (JSON) | Multimodal image inputs. |
A guardrail is resolved from a host class: guardrail_class names a class whose guardrail_method_name accepts the output and returns [ok, value_or_error].
Columns on a Crew that control process, planning, and lifecycle hooks.
| Column | Effect |
|---|---|
process_type | "sequential", "hierarchical", or "consensual". |
consensus_agents | Number of proposers for the consensual process (default 3). |
planning / planning_llm | Run a planner pass before execution. |
before_kickoff_class/_method, after_kickoff_class/_method | Lifecycle hooks resolved from host classes. |
result = crew.execute_batch_sync([{ topic: "a" }, { topic: "b" }])
crew.batch_executions(result[:batch_id]) # the runs, in order
crew.execute_batch_async(inputs_list) # enqueue N jobs, returns the batch_id
Attach sources to an agent (role-specific) or a crew (shared with all its agents):
agent.knowledge_sources.create!(source_type: "url", value: "https://example.com/doc") crew.knowledge_sources.create!(source_type: "string", value: "Reference text…") # source_type: "string" | "file" | "pdf" | "csv" | "url"
Active sources are embedded lazily at execution using the configured embedder.
Set memory_enabled: true on an agent to turn on semantic memory. Configure the embedder and store once in the initializer:
RcrewAI::Rails.configure do |config| config.default_memory_embedder = RCrewAI::Knowledge::Embedder.new config.default_memory_store = RCrewAI::Memory::SqliteStore.new(path: "db/rcrewai_memory.sqlite3") end
Define Flow subclasses in your app; the engine persists their state and tracks runs.
run = RcrewAI::Rails::FlowRun.execute(MyFlow, inputs: { topic: "ruby" })
run.status # "completed" / "failed"
run.result # the final flow state
RcrewAI::Rails::FlowState.find_by(state_id: run.state_id) # the persisted state
Every execution is traced as a tree of spans (crew, agent, task, LLM call, and tool call) with timings, token counts, and cost. See the trace at /rcrewai/executions/:id/observation and spend at /rcrewai/observations/costs.
RcrewAI::Rails.configure do |config| config.observation_enabled = true config.observation_capture_prompts = :truncated # :none | :truncated | :full config.observation_retention_days = 30 end
Prune old spans with rake rcrewai:observation:prune. Token and cost data need an agent that runs through rcrewai's native tool runner; with a fallback such as Ollama without native tools, the cost dashboard is empty.
Record each task's result so an interrupted run can resume without re-running and re-paying for completed tasks. Off by default; enable it globally or per crew. It needs the rcrewai_checkpoints table.
RcrewAI::Rails.configure { |config| config.checkpoint_enabled = true } # globally
crew.update!(checkpoint_enabled: true) # or per crew
rcrewai runs a turn's tool calls concurrently by default. Opt out on an agent whose tools aren't safe to run in parallel, or that must not fan out against a rate-limited API. Left nil, the gem's default applies.
agent.update!(parallel_tools: false)
Hooks that run around every LLM request the engine's agents make. Return a replacement to modify the payload or result, or nil to leave it untouched. A hook that raises is reported and skipped.
RcrewAI::Rails.configure do |config|
config.llm_before_request = lambda do |payload, context|
Rails.logger.info("[llm] -> #{context[:provider]}/#{context[:model]}")
payload
end
end
Set as an agent's llm_config provider or as config.default_llm_provider: openai, anthropic, google, azure, ollama, and:
| Provider | Notes |
|---|---|
openai_compatible | Any OpenAI-format endpoint. Requires RCrewAI's base_url. |
bedrock | AWS Bedrock via the Converse API. Requires aws_region. |
snowflake | Snowflake Cortex inference. Requires snowflake_account. |
openai_responses | OpenAI's Responses API. Non-streaming only. |
Current Claude models reject the temperature rcrewai sends by default, so set RCrewAI's temperature to nil to use them.
Keep-alive streaming connections apply automatically to Anthropic agents that stream. CancelToken, per-call chat(model:), and cached_tokens are not exposed by the engine: Execution#cancel! only updates the record's status and does not stop a running stream. Call an rcrewai client directly from your own code to use them.