[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill-crewai-design-agent":3,"mdc-iueoza-key":33,"related-org-crewai-design-agent":4830,"related-repo-crewai-design-agent":4873},{"slug":4,"name":4,"fn":5,"description":6,"org":7,"tags":12,"stars":23,"repoUrl":24,"updatedAt":25,"license":26,"forks":27,"topics":28,"repo":29,"sourceUrl":31,"mdContent":32},"design-agent","design and configure CrewAI agents","CrewAI agent design and configuration. Use when creating, configuring, or debugging crewAI agents — choosing role\u002Fgoal\u002Fbackstory, selecting LLMs, assigning tools, tuning max_iter\u002Fmax_rpm\u002Fmax_execution_time, enabling planning\u002Fcode execution\u002Fdelegation, setting up knowledge sources, using guardrails, or configuring agents in YAML vs code.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},"crewai","CrewAI","https:\u002F\u002Fpexgzepcugksgbtrxkhf.supabase.co\u002Fstorage\u002Fv1\u002Fobject\u002Fpublic\u002Forg-logos\u002Fcrewai.png","crewAIInc",[13,17,20],{"name":14,"slug":15,"type":16},"Automation","automation","tag",{"name":18,"slug":19,"type":16},"Agents","agents",{"name":21,"slug":22,"type":16},"Workflow Automation","workflow-automation",29,"https:\u002F\u002Fgithub.com\u002FcrewAIInc\u002Fskills","2026-07-12T08:01:04.232165",null,9,[],{"repoUrl":24,"stars":23,"forks":27,"topics":30,"description":26},[],"https:\u002F\u002Fgithub.com\u002FcrewAIInc\u002Fskills\u002Ftree\u002FHEAD\u002Fskills\u002Fdesign-agent","---\nname: design-agent\ndescription: \"CrewAI agent design and configuration. Use when creating, configuring, or debugging crewAI agents — choosing role\u002Fgoal\u002Fbackstory, selecting LLMs, assigning tools, tuning max_iter\u002Fmax_rpm\u002Fmax_execution_time, enabling planning\u002Fcode execution\u002Fdelegation, setting up knowledge sources, using guardrails, or configuring agents in YAML vs code.\"\n---\n\n# CrewAI Agent Design Guide\n\nHow to design effective agents with the right role, goal, backstory, tools, and configuration.\n\n---\n\n## The 80\u002F20 Rule\n\n**Spend 80% of your effort on task design, 20% on agent design.** A well-designed task elevates even a simple agent. But even the best agent cannot rescue a vague, poorly scoped task. Get the task right first (see the `design-task` skill), then refine the agent.\n\n---\n\n## 0. How Many Agents Do You Actually Need?\n\n**Default to ONE agent.** Add more only when the task genuinely splits into work that requires:\n\n- **Different tools or permissions** — e.g. one agent has Slack write access, another reads docs only.\n- **Different personas the LLM must clearly switch between** — a writer's voice is not a researcher's voice.\n- **Different LLMs** — a cheap model for mechanical steps, a stronger one for synthesis.\n- **Different guardrails or output schemas** — separate agents make the contract per stage explicit.\n\n**DO NOT add an agent just because the workflow has multiple steps.** A single agent can:\n- Call multiple tools in sequence within one kickoff (search → scrape → summarize is one agent's loop).\n- Produce structured multi-section output in one response.\n- Iterate via its own tool-use loop without you orchestrating it as separate agents.\n\n**Cost calculus:** every extra agent = at least one more LLM kickoff plus a context handoff. Splitting linear, single-persona work into multiple agents multiplies token cost and adds fragility for marginal quality wins.\n\n### Anti-pattern: Sequential mechanical steps as separate agents\n\n❌ Three agents for what is one researcher's job:\n```python\nsource_finder = Agent(role=\"Finds URLs via Firecrawl search\", tools=[firecrawl_search])\nscraper       = Agent(role=\"Scrapes URLs via Firecrawl scrape\", tools=[firecrawl_scrape])\nwriter        = Agent(role=\"Writes the report\", ...)\n```\n\n✅ One researcher does the gathering loop; one writer synthesizes — two agents because the personas and LLMs genuinely differ:\n```python\nresearcher = Agent(role=\"Web Researcher\", tools=[firecrawl_search, firecrawl_scrape], llm=\"anthropic\u002Fclaude-haiku-4-5\")\nwriter     = Agent(role=\"Technical Report Writer\",                                    llm=\"anthropic\u002Fclaude-sonnet-4-6\")\n```\nThe researcher's task description tells it to search, then scrape, then return structured findings. One LLM loop, multiple tool calls.\n\n### Anti-pattern: \"Summarize then send\" as two agents\n\n❌ Two agents to read a string, summarize it, and post a Slack DM:\n```python\nsummarizer       = Agent(role=\"Summarizer\")\nslack_messenger  = Agent(role=\"Slack Sender\", apps=[\"slack\"])\n```\n\n✅ One agent with the connector and a task that tells it to summarize on top, then DM:\n```python\nslack_dm_agent = Agent(\n    role=\"Slack Reporter\",\n    goal=\"Post a Slack DM containing a one-paragraph summary plus the full markdown body.\",\n    apps=[\"slack\"],\n)\n# Task: \"Read the report below. Write a 2-3 sentence executive summary at the top.\n#        Post a DM to {recipient_email} with the summary followed by the full body.\"\n```\n\n### Heuristic\n\n> If two \"agents\" share the same persona, the same tool surface, and the same LLM, they are one agent with a longer task description.\n\n### Once you've decided \"one agent is enough\"\n\nUse `Agent.kickoff()` directly inside a Flow method — no `Crew`, no `Task` ceremony. The Flow owns sequencing and state; each step is a single agent kickoff. See **Section 4 — Agent.kickoff() — Direct Agent Execution** below for the full pattern, and the upstream docs at \u003Chttps:\u002F\u002Fdocs.crewai.com\u002Fen\u002Fconcepts\u002Fagents#direct-agent-interaction-with-kickoff>.\n\nQuick shape:\n\n```python\n@listen(previous_step)\ndef my_step(self):\n    agent = Agent(role=\"…\", goal=\"…\", backstory=\"…\", tools=[...])\n    result = agent.kickoff(\n        messages=f\"Use this prior step's output: {self.state.prior_field}\",\n        response_format=MyPydanticModel,  # optional\n    )\n    self.state.my_field = result.pydantic  # or result.raw\n```\n\nReach for `Crew.kickoff()` *only* when a step genuinely benefits from multi-agent collaboration (delegation, hierarchical management, parallel specialists feeding one synthesis). For \"one agent does one job\", `Agent.kickoff()` inside a Flow listener is the right primitive.\n\nOnly after you've decided multi-agent is justified, read on for how to design each one.\n\n---\n\n## 1. The Role-Goal-Backstory Framework\n\nEvery agent needs three things: **who** it is, **what** it wants, and **why** it's qualified.\n\n### Role — Who the Agent Is\n\nThe role defines the agent's area of expertise. **Be specific, not generic.**\n\n| Bad | Good |\n|---|---|\n| `Researcher` | `Senior Data Researcher specializing in {topic}` |\n| `Writer` | `Technical Blog Writer for developer audiences` |\n| `Analyst` | `Financial Risk Analyst with regulatory compliance expertise` |\n\nThe role directly shapes how the LLM reasons. A \"Senior Data Researcher\" will produce different output than a \"Research Assistant\" even with the same task.\n\n### Goal — What the Agent Wants\n\nThe goal is the agent's individual objective. It should be **outcome-focused with quality standards**.\n\n| Bad | Good |\n|---|---|\n| `Do research` | `Uncover cutting-edge developments in {topic} and identify the top 5 trends with supporting evidence` |\n| `Write content` | `Produce publication-ready technical articles that explain complex topics clearly for non-technical readers` |\n| `Analyze data` | `Deliver actionable risk assessments with confidence levels and recommended mitigations` |\n\n### Backstory — Why the Agent Is Qualified\n\nThe backstory establishes expertise, experience, values, and working style. It's the agent's \"personality prompt.\"\n\n```yaml\nbackstory: >\n  You're a seasoned researcher with 15 years of experience in AI\u002FML.\n  You're known for your ability to find obscure but relevant papers\n  and synthesize complex findings into clear, actionable insights.\n  You always cite your sources and flag uncertainty explicitly.\n```\n\n**What to include in a backstory:**\n- Years\u002Fdepth of experience\n- Specific domain knowledge\n- Working style and values (e.g., \"always cites sources\", \"prefers concise output\")\n- Quality standards the agent holds itself to\n\n**What NOT to include:**\n- Implementation details (tools, models, config)\n- Task-specific instructions (those go in the task description)\n- Arbitrary personality traits that don't affect output quality\n\n---\n\n## 2. Agent Configuration Reference\n\n### Essential Parameters\n\n```python\nAgent(\n    role=\"...\",              # Required: agent's expertise area\n    goal=\"...\",              # Required: what the agent aims to achieve\n    backstory=\"...\",         # Required: context and personality\n    llm=\"openai\u002Fgpt-4o\",    # Optional: defaults to OPENAI_MODEL_NAME env var or \"gpt-4\"\n    tools=[...],             # Optional: list of tool instances\n)\n```\n\n### Execution Control\n\n```python\nAgent(\n    ...,\n    max_iter=25,             # Max reasoning iterations per task (default: 25)\n    max_execution_time=300,  # Timeout in seconds (default: None — no limit)\n    max_rpm=10,              # Rate limit: max API calls per minute (default: None)\n    max_retry_limit=2,       # Retries on error (default: 2)\n    verbose=True,            # Show detailed execution logs (default: False)\n)\n```\n\n**Tuning `max_iter`:**\n- Default 25 is generous — most tasks finish in 3-8 iterations\n- Lower to 10-15 to fail faster when tasks are well-defined\n- If agent consistently hits max_iter, the task is too vague (fix the task, not the limit)\n\n### Tool Configuration\n\n```python\nfrom crewai_tools import SerperDevTool, ScrapeWebsiteTool, FileReadTool\n\nAgent(\n    ...,\n    tools=[SerperDevTool(), ScrapeWebsiteTool()],  # Agent-level tools\n)\n```\n\n**Key rules:**\n- An agent with **no tools** will hallucinate data when asked to search, fetch, or read files — always provide tools for tasks that require external data\n- Prefer **fewer, focused tools** over many tools — too many tools confuses the agent\n- Tools can also be assigned at the **task level** for task-specific access (see `design-task` skill)\n- Agent-level tools are available for all tasks the agent performs; task-level tools override for that specific task\n\n### LLM Selection\n\n```python\nAgent(\n    ...,\n    llm=\"openai\u002Fgpt-4o\",              # Main reasoning model\n    function_calling_llm=\"openai\u002Fgpt-4o-mini\",  # Cheaper model for tool calls only\n)\n```\n\nUse `function_calling_llm` to save costs: the main `llm` handles reasoning while a cheaper model handles tool-calling mechanics.\n\n### Collaboration\n\n```python\nAgent(\n    ...,\n    allow_delegation=False,  # Default: False — agent works alone\n)\n```\n\nSet `allow_delegation=True` only when:\n- The agent is part of a crew with other specialized agents\n- The task genuinely benefits from the agent handing off subtasks\n- You're using hierarchical process where the manager delegates\n\n**Warning:** Delegation without clear task boundaries leads to infinite loops or wasted iterations.\n\n### Planning (Plan-and-Execute Mode)\n\nWhen a `PlanningConfig` is set on an agent, `Agent.kickoff()` (and `Agent.execute_task()`) routes through the new `crewai.experimental.AgentExecutor`. Instead of a single ReAct-style loop, the agent:\n\n1. **Generates a plan** — a list of `PlanStep`s, each with a description and optional `tool_to_use`. Stored as `state.todos`.\n2. **Executes each step** via a `StepExecutor` in an isolated multi-turn LLM loop (capped by `max_step_iterations`).\n3. **Observes the result** via a `PlannerObserver` after every step — did the step succeed? Is the remaining plan still valid?\n4. **Routes the next action** based on the agent's `reasoning_effort` setting (see below).\n\nThe presence of a `PlanningConfig` enables the mode. To disable: don't pass one, or set `planning=False`.\n\n```python\nfrom crewai import Agent\nfrom crewai.agent.planning_config import PlanningConfig\n\nagent = Agent(\n    role=\"…\",\n    goal=\"…\",\n    backstory=\"…\",\n    tools=[...],\n    planning_config=PlanningConfig(reasoning_effort=\"medium\"),  # most common\n)\n```\n\n#### `reasoning_effort` — pick one\n\n| Level | After each step the planner... | Pick when |\n|---|---|---|\n| `\"low\"` | observes (validates success), marks the todo complete, continues. **No replan, no refine.** | You want plan visibility (todos, observations) but trust the agent to follow it linearly. Fastest. |\n| `\"medium\"` (default) | observes; **replans on failure only**. Successful steps just continue. | The agent's tools can fail (network, exec, scrape) and you want graceful recovery without paying refinement cost on every success. **The right default for sandbox-coding, research, and other tool-heavy loops.** |\n| `\"high\"` | observes, then routes through `decide_next_action` which can trigger early goal achievement, full replan, or lightweight refinement after every step. | The task changes shape based on intermediate findings, or you need maximum adaptiveness. Most LLM calls per run. |\n\nSource: `crewai\u002Fexperimental\u002Fagent_executor.py:450` (`observe_step_result` router) and `crewai\u002Fagent\u002Fplanning_config.py`.\n\n#### Other `PlanningConfig` knobs\n\n```python\nPlanningConfig(\n    reasoning_effort=\"medium\",\n    max_steps=20,            # cap on planned steps (default 20)\n    max_replans=3,           # max full re-plans before finalizing (default 3)\n    max_attempts=None,       # planning refinement attempts during plan generation\n    max_step_iterations=15,  # max LLM turns per step's StepExecutor (default 15)\n    step_timeout=None,       # wall-clock seconds per step; None = no cap\n    system_prompt=None,      # custom planning system prompt (uses default if None)\n    plan_prompt=None,        # custom initial-plan prompt; placeholders: {description}, {expected_output}, {tools}, {max_steps}\n    refine_prompt=None,      # custom refinement prompt\n    llm=None,                # separate LLM for planning (else uses agent.llm)\n)\n```\n\nUse `llm=\"anthropic\u002Fclaude-haiku-4-5\"` (cheap) for the planner while keeping `agent.llm=\"anthropic\u002Fclaude-opus-4-7\"` (strong) for execution — common cost optimization.\n\n#### When to enable\n\n- **Enable** for autonomous loops where the agent picks its own steps and you want failure recovery (e.g. coding agent that writes → runs → patches; research agent that searches → scrapes → revises).\n- **Skip** for single-tool, single-purpose calls (e.g. \"summarize this string\", \"post this Slack DM\") — observation overhead doesn't pay off.\n\n#### Cost shape\n\nEvery step gets a `PlannerObserver` LLM call (~1 extra call per step). On `\"medium\"` a failed step adds a replan call. On `\"high\"` every step adds a `decide_next_action` call too. For an N-step plan, expect roughly:\n\n- `low`: N execution + N observation = **2N calls**\n- `medium`: 2N + (failures × 1 replan)\n- `high`: ~3N + replans\u002Frefines\n\nMaterial at scale — measure before defaulting `high` for everything.\n\n#### Custom `plan_prompt`\n\nIf you supply `plan_prompt`, include the placeholders the planner template expects: `{description}`, `{expected_output}`, `{tools}`, `{max_steps}`. The planner LLM gets these interpolated. Keep custom prompts focused on *project-specific* rules; let `description`\u002F`tools` (auto-injected) carry the dynamic content.\n\n### Code Execution\n\n```python\nAgent(\n    ...,\n    allow_code_execution=True,        # Enable code execution (default: False)\n    code_execution_mode=\"safe\",       # \"safe\" (Docker) or \"unsafe\" (direct) — default: \"safe\"\n)\n```\n\n- `\"safe\"` requires Docker installed and running — executes in a container\n- `\"unsafe\"` runs code directly on the host — only use in controlled environments\n\n### Context Window Management\n\n```python\nAgent(\n    ...,\n    respect_context_window=True,      # Auto-summarize to stay within limits (default: True)\n)\n```\n\nWhen `True`, the agent automatically summarizes prior context if it approaches the LLM's token limit. When `False`, execution stops with an error on overflow.\n\n### Date Injection\n\n```python\nAgent(\n    ...,\n    inject_date=True,                 # Add current date to task context (default: False)\n    date_format=\"%Y-%m-%d\",           # Date format (default: \"%Y-%m-%d\")\n)\n```\n\nEnable for time-sensitive tasks (research, news analysis, scheduling).\n\n### Agent Guardrails\n\n```python\ndef validate_no_pii(result) -> tuple[bool, Any]:\n    \"\"\"Reject output containing PII.\"\"\"\n    if contains_pii(result.raw):\n        return (False, \"Output contains PII. Remove all personal information and try again.\")\n    return (True, result)\n\nAgent(\n    ...,\n    guardrail=validate_no_pii,\n    guardrail_max_retries=3,          # default: 3\n)\n```\n\nAgent guardrails validate every output the agent produces. The agent retries on failure up to `guardrail_max_retries`.\n\n### Knowledge Sources\n\n```python\nfrom crewai.knowledge.source.text_file_knowledge_source import TextFileKnowledgeSource\n\nAgent(\n    ...,\n    knowledge_sources=[\n        TextFileKnowledgeSource(file_paths=[\"company_handbook.txt\"]),\n    ],\n    embedder={\n        \"provider\": \"openai\",\n        \"config\": {\"model\": \"text-embedding-3-small\"},\n    },\n)\n```\n\nKnowledge sources give agents access to domain-specific data via RAG. Use when agents need to reference large documents, policies, or datasets.\n\n---\n\n## 3. YAML Configuration (Recommended)\n\nDefine agents in `agents.yaml` for clean separation of config and code:\n\n```yaml\nresearcher:\n  role: >\n    {topic} Senior Data Researcher\n  goal: >\n    Uncover cutting-edge developments in {topic}\n    with supporting evidence and source citations\n  backstory: >\n    You're a seasoned researcher with 15 years of experience.\n    Known for finding obscure but relevant sources and\n    synthesizing complex findings into clear insights.\n    You always cite your sources and flag uncertainty.\n  # Optional overrides (uncomment as needed):\n  # llm: openai\u002Fgpt-4o\n  # max_iter: 15\n  # max_rpm: 10\n  # allow_delegation: false\n  # verbose: true\n```\n\nThen wire in `crew.py`:\n\n```python\n@CrewBase\nclass MyCrew:\n    agents_config = \"config\u002Fagents.yaml\"\n    tasks_config = \"config\u002Ftasks.yaml\"\n\n    @agent\n    def researcher(self) -> Agent:\n        return Agent(\n            config=self.agents_config[\"researcher\"],\n            tools=[SerperDevTool()],\n        )\n```\n\n**Critical:** The method name (`def researcher`) must match the YAML key (`researcher:`). Mismatch causes `KeyError`.\n\n---\n\n## 4. Agent.kickoff() — Direct Agent Execution\n\nUse `Agent.kickoff()` when you need one agent with tools and reasoning, without crew overhead. This is the most common pattern in Flows.\n\n### Basic Usage\n\n```python\nfrom crewai import Agent\nfrom crewai_tools import SerperDevTool\n\nresearcher = Agent(\n    role=\"Senior Research Analyst\",\n    goal=\"Find comprehensive, factual information with source citations\",\n    backstory=\"Expert researcher known for thorough, evidence-based analysis.\",\n    tools=[SerperDevTool()],\n    llm=\"openai\u002Fgpt-4o\",\n)\n\n# Pass a string prompt — the agent reasons, uses tools, and returns a result\nresult = researcher.kickoff(\"What are the latest developments in quantum computing?\")\nprint(result.raw)             # str — the agent's full response\nprint(result.usage_metrics)   # token usage stats\n```\n\n### With Structured Output\n\n```python\nfrom pydantic import BaseModel\n\nclass ResearchFindings(BaseModel):\n    key_trends: list[str]\n    sources: list[str]\n    confidence: float\n\nresult = researcher.kickoff(\n    \"Research the latest AI agent frameworks\",\n    response_format=ResearchFindings,\n)\n\n# Access via .pydantic (NOT directly — Agent.kickoff wraps the result)\nprint(result.pydantic.key_trends)    # list[str]\nprint(result.pydantic.confidence)    # float\nprint(result.raw)                    # raw string version\n```\n\n> **Note:** `Agent.kickoff()` returns `LiteAgentOutput` — access structured output via `result.pydantic`. This differs from `LLM.call()` which returns the Pydantic object directly.\n\n### With File Inputs\n\n```python\nresult = researcher.kickoff(\n    \"Analyze this document and summarize the key findings\",\n    input_files={\"document\": FileInput(path=\"report.pdf\")},\n)\n```\n\n### Async Variant\n\n```python\nresult = await researcher.kickoff_async(\n    \"Research quantum computing breakthroughs\",\n    response_format=ResearchFindings,\n)\n```\n\n### Agent.kickoff() in Flows (Recommended Pattern)\n\nThe most powerful pattern is orchestrating multiple `Agent.kickoff()` calls inside a Flow. The Flow handles state and sequencing; each agent handles its specific step:\n\n```python\nfrom crewai import Agent\nfrom crewai.flow.flow import Flow, listen, start\nfrom crewai_tools import SerperDevTool, ScrapeWebsiteTool\nfrom pydantic import BaseModel\n\nclass ResearchState(BaseModel):\n    topic: str = \"\"\n    research: str = \"\"\n    analysis: str = \"\"\n    report: str = \"\"\n\nclass ResearchFlow(Flow[ResearchState]):\n\n    @start()\n    def gather_data(self):\n        researcher = Agent(\n            role=\"Senior Researcher\",\n            goal=\"Find comprehensive data with sources\",\n            backstory=\"Expert at finding and validating information.\",\n            tools=[SerperDevTool(), ScrapeWebsiteTool()],\n        )\n        result = researcher.kickoff(f\"Research: {self.state.topic}\")\n        self.state.research = result.raw\n\n    @listen(gather_data)\n    def analyze(self):\n        analyst = Agent(\n            role=\"Data Analyst\",\n            goal=\"Extract actionable insights from raw research\",\n            backstory=\"Skilled at pattern recognition and synthesis.\",\n        )\n        result = analyst.kickoff(\n            f\"Analyze this research and extract key insights:\\n\\n{self.state.research}\"\n        )\n        self.state.analysis = result.raw\n\n    @listen(analyze)\n    def write_report(self):\n        writer = Agent(\n            role=\"Report Writer\",\n            goal=\"Create clear, well-structured reports\",\n            backstory=\"Technical writer who makes complex topics accessible.\",\n        )\n        result = writer.kickoff(\n            f\"Write a comprehensive report from this analysis:\\n\\n{self.state.analysis}\"\n        )\n        self.state.report = result.raw\n\nflow = ResearchFlow()\nflow.kickoff(inputs={\"topic\": \"AI agents\"})\nprint(flow.state.report)\n```\n\n**When to use Agent.kickoff() vs Crew.kickoff():**\n- Use `Agent.kickoff()` when each step is a distinct agent and the Flow controls sequencing\n- Use `Crew.kickoff()` when multiple agents need to collaborate on related tasks within a single step\n\n### Agent.kickoff() in Conversational Flow Routes\n\nIn experimental conversational Flows, the Flow owns the chat lifecycle and route selection. Agents should be called inside route handlers for bounded tool-backed work: research, docs lookup, account actions, triage, drafting, or escalation prep.\n\n```python\nfrom crewai import Agent, Flow\nfrom crewai.flow import listen\nfrom crewai.experimental.conversational import ConversationState\n\n\nclass SupportFlow(Flow[ConversationState]):\n    conversational = True\n\n    def research_agent(self) -> Agent:\n        return Agent(\n            role=\"Support Research Specialist\",\n            goal=\"Find accurate information with sources for the user's current question.\",\n            backstory=\"You are precise, evidence-driven, and explicit about uncertainty.\",\n            tools=[...],\n        )\n\n    @listen(\"RESEARCH\")\n    def handle_research(self) -> str:\n        \"\"\"Fresh research, current lookups, and source-backed synthesis.\"\"\"\n        result = self.research_agent().kickoff(self.state.current_user_message)\n        self.append_agent_result(\"research_agent\", result, visibility=\"private\")\n        reply = result.raw\n        self.append_assistant_message(reply)\n        return reply\n```\n\nDesign implications:\n- Keep the conversational `Flow` responsible for session id, message history, routing, trace finalization, and approvals.\n- Keep each agent narrow: one route, one tool surface, one job.\n- Use `append_agent_result(..., visibility=\"private\")` for scratch work that should not enter canonical chat history.\n- Use `append_assistant_message(reply)` for the user-visible answer so the next turn has the assistant context.\n- Do not make a \"chat agent\" with every tool. Route first, then invoke a focused agent for the selected route.\n\nSee the getting-started reference for the Flow lifecycle: `skills\u002Fgetting-started\u002Freferences\u002Fconversational-flows.md`.\n\n---\n\n## 5. Specialist vs Generalist Agents\n\n> **Note:** Apply this section *after* you've decided you genuinely need multiple agents (see Section 0). If you only need one agent, \"specialist vs generalist\" is not the question — the question is just how to design that one agent.\n\n**When you do need multiple agents, prefer specialists.** An agent that does one thing well outperforms one that does many things acceptably.\n\n### When to Use a Specialist\n\n- Task requires deep domain knowledge\n- Output quality matters more than speed\n- The task is complex enough to benefit from focused expertise\n\n### When a Generalist Is Acceptable\n\n- Simple tasks with clear instructions\n- Prototyping where you'll specialize later\n- Tasks that truly span multiple domains equally\n\n### Specialist Design Pattern\n\nInstead of one \"Content Writer\" agent, create:\n- `technical_writer` — deep technical accuracy, code examples\n- `copywriter` — persuasive, audience-focused marketing copy\n- `editor` — grammar, consistency, style guide enforcement\n\nEach specialist has a narrow role, specific goal, and backstory that reinforces their expertise.\n\n---\n\n## 6. Agent Interaction Patterns\n\n### Sequential (Default)\n\nAgents work one after another. Each agent receives prior agents' outputs as context.\n\n```\nResearcher → Writer → Editor\n```\n\nBest for: linear pipelines where each step builds on the last.\n\n### Hierarchical\n\nA manager agent delegates and validates. Task assignment is dynamic.\n\n```python\nCrew(\n    agents=[researcher, writer, editor],\n    tasks=[research_task, writing_task, editing_task],\n    process=Process.hierarchical,\n    manager_llm=\"openai\u002Fgpt-4o\",\n)\n```\n\nBest for: complex workflows where task assignment depends on intermediate results.\n\n### Agent-to-Agent Delegation\n\nWhen `allow_delegation=True`, an agent can ask another crew agent for help:\n\n```python\nlead_researcher = Agent(\n    role=\"Lead Researcher\",\n    goal=\"Coordinate research efforts\",\n    backstory=\"...\",\n    allow_delegation=True,  # Can delegate to other agents in the crew\n)\n```\n\nThe agent will automatically discover other crew members and delegate subtasks as needed.\n\n---\n\n## 7. Common Agent Design Mistakes\n\n| Mistake | Impact | Fix |\n|---|---|---|\n| Generic role like \"Assistant\" | Agent produces unfocused, shallow output | Use specific expertise: \"Senior Financial Analyst\" |\n| No tools for data-gathering tasks | Agent hallucinates data instead of searching | Always add tools when the task requires external info |\n| Too many tools (10+) | Agent gets confused choosing between tools | Limit to 3-5 relevant tools per agent |\n| Backstory full of task instructions | Agent mixes personality with task execution | Keep backstory about WHO the agent is; task details go in the task |\n| `allow_delegation=True` by default | Agents waste iterations delegating trivially | Only enable when delegation genuinely helps |\n| max_iter too high for simple tasks | Agent loops unnecessarily on vague tasks | Lower max_iter; fix the task description instead |\n| No guardrail on critical output | Bad output passes through unchecked | Add guardrails for outputs that feed into production systems |\n| Using expensive LLM for tool calls | Unnecessary cost for mechanical operations | Set `function_calling_llm` to a cheaper model |\n\n---\n\n## 8. Agent Design Checklist\n\nBefore deploying an agent, verify:\n\n- [ ] **Role** is specific and domain-focused (not \"Assistant\" or \"Helper\")\n- [ ] **Goal** includes desired outcome AND quality standards\n- [ ] **Backstory** establishes expertise and working style\n- [ ] **Tools** are assigned for any task requiring external data\n- [ ] **No excess tools** — 3-5 per agent maximum\n- [ ] **max_iter** is tuned for expected task complexity (10-15 for simple, 20-25 for complex)\n- [ ] **max_execution_time** is set for production agents to prevent hangs\n- [ ] **Guardrails** are configured for critical outputs\n- [ ] **LLM** is appropriate for task complexity (don't use GPT-4 for classification)\n- [ ] **Delegation** is disabled unless genuinely needed\n\n---\n\n## References\n\nFor deeper dives into specific topics, see:\n\n- [Custom Tools](references\u002Fcustom-tools.md) — building your own tools with `@tool` decorator and `BaseTool` subclass\n- [Memory & Knowledge](references\u002Fmemory-and-knowledge.md) — memory configuration, knowledge sources, embedder setup, scoping\n\nFor related skills:\n\n- **getting-started** — project scaffolding, choosing the right abstraction, Flow architecture\n- **design-task** — task description\u002Fexpected_output best practices, guardrails, structured output, dependencies\n- **ask-docs** — query the live CrewAI documentation MCP server for questions not covered by these skills\n",{"data":34,"body":35},{"name":4,"description":6},{"type":36,"children":37},"root",[38,47,53,57,64,84,87,93,103,148,158,176,186,193,198,238,243,266,271,277,282,305,310,377,383,392,398,444,449,521,549,554,557,563,589,595,605,696,701,707,718,801,807,812,875,883,906,914,932,935,941,947,1009,1015,1084,1099,1117,1123,1176,1184,1235,1241,1285,1305,1311,1347,1360,1378,1388,1394,1430,1528,1547,1633,1645,1765,1793,1806,1910,1930,1936,1959,1965,1998,2039,2051,2063,2128,2134,2178,2203,2209,2245,2266,2272,2316,2321,2327,2418,2430,2436,2535,2540,2543,2549,2562,2740,2752,2846,2879,2882,2888,2899,2905,3028,3034,3165,3208,3214,3251,3257,3294,3300,3312,3747,3755,3780,3786,3791,3984,3989,4039,4051,4054,4060,4079,4089,4095,4113,4119,4137,4143,4148,4184,4189,4192,4198,4204,4209,4219,4224,4230,4235,4289,4294,4300,4311,4365,4370,4373,4379,4561,4564,4570,4575,4732,4735,4741,4746,4787,4792,4824],{"type":39,"tag":40,"props":41,"children":43},"element","h1",{"id":42},"crewai-agent-design-guide",[44],{"type":45,"value":46},"text","CrewAI Agent Design Guide",{"type":39,"tag":48,"props":49,"children":50},"p",{},[51],{"type":45,"value":52},"How to design effective agents with the right role, goal, backstory, tools, and configuration.",{"type":39,"tag":54,"props":55,"children":56},"hr",{},[],{"type":39,"tag":58,"props":59,"children":61},"h2",{"id":60},"the-8020-rule",[62],{"type":45,"value":63},"The 80\u002F20 Rule",{"type":39,"tag":48,"props":65,"children":66},{},[67,73,75,82],{"type":39,"tag":68,"props":69,"children":70},"strong",{},[71],{"type":45,"value":72},"Spend 80% of your effort on task design, 20% on agent design.",{"type":45,"value":74}," A well-designed task elevates even a simple agent. But even the best agent cannot rescue a vague, poorly scoped task. Get the task right first (see the ",{"type":39,"tag":76,"props":77,"children":79},"code",{"className":78},[],[80],{"type":45,"value":81},"design-task",{"type":45,"value":83}," skill), then refine the agent.",{"type":39,"tag":54,"props":85,"children":86},{},[],{"type":39,"tag":58,"props":88,"children":90},{"id":89},"_0-how-many-agents-do-you-actually-need",[91],{"type":45,"value":92},"0. How Many Agents Do You Actually Need?",{"type":39,"tag":48,"props":94,"children":95},{},[96,101],{"type":39,"tag":68,"props":97,"children":98},{},[99],{"type":45,"value":100},"Default to ONE agent.",{"type":45,"value":102}," Add more only when the task genuinely splits into work that requires:",{"type":39,"tag":104,"props":105,"children":106},"ul",{},[107,118,128,138],{"type":39,"tag":108,"props":109,"children":110},"li",{},[111,116],{"type":39,"tag":68,"props":112,"children":113},{},[114],{"type":45,"value":115},"Different tools or permissions",{"type":45,"value":117}," — e.g. one agent has Slack write access, another reads docs only.",{"type":39,"tag":108,"props":119,"children":120},{},[121,126],{"type":39,"tag":68,"props":122,"children":123},{},[124],{"type":45,"value":125},"Different personas the LLM must clearly switch between",{"type":45,"value":127}," — a writer's voice is not a researcher's voice.",{"type":39,"tag":108,"props":129,"children":130},{},[131,136],{"type":39,"tag":68,"props":132,"children":133},{},[134],{"type":45,"value":135},"Different LLMs",{"type":45,"value":137}," — a cheap model for mechanical steps, a stronger one for synthesis.",{"type":39,"tag":108,"props":139,"children":140},{},[141,146],{"type":39,"tag":68,"props":142,"children":143},{},[144],{"type":45,"value":145},"Different guardrails or output schemas",{"type":45,"value":147}," — separate agents make the contract per stage explicit.",{"type":39,"tag":48,"props":149,"children":150},{},[151,156],{"type":39,"tag":68,"props":152,"children":153},{},[154],{"type":45,"value":155},"DO NOT add an agent just because the workflow has multiple steps.",{"type":45,"value":157}," A single agent can:",{"type":39,"tag":104,"props":159,"children":160},{},[161,166,171],{"type":39,"tag":108,"props":162,"children":163},{},[164],{"type":45,"value":165},"Call multiple tools in sequence within one kickoff (search → scrape → summarize is one agent's loop).",{"type":39,"tag":108,"props":167,"children":168},{},[169],{"type":45,"value":170},"Produce structured multi-section output in one response.",{"type":39,"tag":108,"props":172,"children":173},{},[174],{"type":45,"value":175},"Iterate via its own tool-use loop without you orchestrating it as separate agents.",{"type":39,"tag":48,"props":177,"children":178},{},[179,184],{"type":39,"tag":68,"props":180,"children":181},{},[182],{"type":45,"value":183},"Cost calculus:",{"type":45,"value":185}," every extra agent = at least one more LLM kickoff plus a context handoff. Splitting linear, single-persona work into multiple agents multiplies token cost and adds fragility for marginal quality wins.",{"type":39,"tag":187,"props":188,"children":190},"h3",{"id":189},"anti-pattern-sequential-mechanical-steps-as-separate-agents",[191],{"type":45,"value":192},"Anti-pattern: Sequential mechanical steps as separate agents",{"type":39,"tag":48,"props":194,"children":195},{},[196],{"type":45,"value":197},"❌ Three agents for what is one researcher's job:",{"type":39,"tag":199,"props":200,"children":205},"pre",{"className":201,"code":202,"language":203,"meta":204,"style":204},"language-python shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","source_finder = Agent(role=\"Finds URLs via Firecrawl search\", tools=[firecrawl_search])\nscraper       = Agent(role=\"Scrapes URLs via Firecrawl scrape\", tools=[firecrawl_scrape])\nwriter        = Agent(role=\"Writes the report\", ...)\n","python","",[206],{"type":39,"tag":76,"props":207,"children":208},{"__ignoreMap":204},[209,220,229],{"type":39,"tag":210,"props":211,"children":214},"span",{"class":212,"line":213},"line",1,[215],{"type":39,"tag":210,"props":216,"children":217},{},[218],{"type":45,"value":219},"source_finder = Agent(role=\"Finds URLs via Firecrawl search\", tools=[firecrawl_search])\n",{"type":39,"tag":210,"props":221,"children":223},{"class":212,"line":222},2,[224],{"type":39,"tag":210,"props":225,"children":226},{},[227],{"type":45,"value":228},"scraper       = Agent(role=\"Scrapes URLs via Firecrawl scrape\", tools=[firecrawl_scrape])\n",{"type":39,"tag":210,"props":230,"children":232},{"class":212,"line":231},3,[233],{"type":39,"tag":210,"props":234,"children":235},{},[236],{"type":45,"value":237},"writer        = Agent(role=\"Writes the report\", ...)\n",{"type":39,"tag":48,"props":239,"children":240},{},[241],{"type":45,"value":242},"✅ One researcher does the gathering loop; one writer synthesizes — two agents because the personas and LLMs genuinely differ:",{"type":39,"tag":199,"props":244,"children":246},{"className":201,"code":245,"language":203,"meta":204,"style":204},"researcher = Agent(role=\"Web Researcher\", tools=[firecrawl_search, firecrawl_scrape], llm=\"anthropic\u002Fclaude-haiku-4-5\")\nwriter     = Agent(role=\"Technical Report Writer\",                                    llm=\"anthropic\u002Fclaude-sonnet-4-6\")\n",[247],{"type":39,"tag":76,"props":248,"children":249},{"__ignoreMap":204},[250,258],{"type":39,"tag":210,"props":251,"children":252},{"class":212,"line":213},[253],{"type":39,"tag":210,"props":254,"children":255},{},[256],{"type":45,"value":257},"researcher = Agent(role=\"Web Researcher\", tools=[firecrawl_search, firecrawl_scrape], llm=\"anthropic\u002Fclaude-haiku-4-5\")\n",{"type":39,"tag":210,"props":259,"children":260},{"class":212,"line":222},[261],{"type":39,"tag":210,"props":262,"children":263},{},[264],{"type":45,"value":265},"writer     = Agent(role=\"Technical Report Writer\",                                    llm=\"anthropic\u002Fclaude-sonnet-4-6\")\n",{"type":39,"tag":48,"props":267,"children":268},{},[269],{"type":45,"value":270},"The researcher's task description tells it to search, then scrape, then return structured findings. One LLM loop, multiple tool calls.",{"type":39,"tag":187,"props":272,"children":274},{"id":273},"anti-pattern-summarize-then-send-as-two-agents",[275],{"type":45,"value":276},"Anti-pattern: \"Summarize then send\" as two agents",{"type":39,"tag":48,"props":278,"children":279},{},[280],{"type":45,"value":281},"❌ Two agents to read a string, summarize it, and post a Slack DM:",{"type":39,"tag":199,"props":283,"children":285},{"className":201,"code":284,"language":203,"meta":204,"style":204},"summarizer       = Agent(role=\"Summarizer\")\nslack_messenger  = Agent(role=\"Slack Sender\", apps=[\"slack\"])\n",[286],{"type":39,"tag":76,"props":287,"children":288},{"__ignoreMap":204},[289,297],{"type":39,"tag":210,"props":290,"children":291},{"class":212,"line":213},[292],{"type":39,"tag":210,"props":293,"children":294},{},[295],{"type":45,"value":296},"summarizer       = Agent(role=\"Summarizer\")\n",{"type":39,"tag":210,"props":298,"children":299},{"class":212,"line":222},[300],{"type":39,"tag":210,"props":301,"children":302},{},[303],{"type":45,"value":304},"slack_messenger  = Agent(role=\"Slack Sender\", apps=[\"slack\"])\n",{"type":39,"tag":48,"props":306,"children":307},{},[308],{"type":45,"value":309},"✅ One agent with the connector and a task that tells it to summarize on top, then DM:",{"type":39,"tag":199,"props":311,"children":313},{"className":201,"code":312,"language":203,"meta":204,"style":204},"slack_dm_agent = Agent(\n    role=\"Slack Reporter\",\n    goal=\"Post a Slack DM containing a one-paragraph summary plus the full markdown body.\",\n    apps=[\"slack\"],\n)\n# Task: \"Read the report below. Write a 2-3 sentence executive summary at the top.\n#        Post a DM to {recipient_email} with the summary followed by the full body.\"\n",[314],{"type":39,"tag":76,"props":315,"children":316},{"__ignoreMap":204},[317,325,333,341,350,359,368],{"type":39,"tag":210,"props":318,"children":319},{"class":212,"line":213},[320],{"type":39,"tag":210,"props":321,"children":322},{},[323],{"type":45,"value":324},"slack_dm_agent = Agent(\n",{"type":39,"tag":210,"props":326,"children":327},{"class":212,"line":222},[328],{"type":39,"tag":210,"props":329,"children":330},{},[331],{"type":45,"value":332},"    role=\"Slack Reporter\",\n",{"type":39,"tag":210,"props":334,"children":335},{"class":212,"line":231},[336],{"type":39,"tag":210,"props":337,"children":338},{},[339],{"type":45,"value":340},"    goal=\"Post a Slack DM containing a one-paragraph summary plus the full markdown body.\",\n",{"type":39,"tag":210,"props":342,"children":344},{"class":212,"line":343},4,[345],{"type":39,"tag":210,"props":346,"children":347},{},[348],{"type":45,"value":349},"    apps=[\"slack\"],\n",{"type":39,"tag":210,"props":351,"children":353},{"class":212,"line":352},5,[354],{"type":39,"tag":210,"props":355,"children":356},{},[357],{"type":45,"value":358},")\n",{"type":39,"tag":210,"props":360,"children":362},{"class":212,"line":361},6,[363],{"type":39,"tag":210,"props":364,"children":365},{},[366],{"type":45,"value":367},"# Task: \"Read the report below. Write a 2-3 sentence executive summary at the top.\n",{"type":39,"tag":210,"props":369,"children":371},{"class":212,"line":370},7,[372],{"type":39,"tag":210,"props":373,"children":374},{},[375],{"type":45,"value":376},"#        Post a DM to {recipient_email} with the summary followed by the full body.\"\n",{"type":39,"tag":187,"props":378,"children":380},{"id":379},"heuristic",[381],{"type":45,"value":382},"Heuristic",{"type":39,"tag":384,"props":385,"children":386},"blockquote",{},[387],{"type":39,"tag":48,"props":388,"children":389},{},[390],{"type":45,"value":391},"If two \"agents\" share the same persona, the same tool surface, and the same LLM, they are one agent with a longer task description.",{"type":39,"tag":187,"props":393,"children":395},{"id":394},"once-youve-decided-one-agent-is-enough",[396],{"type":45,"value":397},"Once you've decided \"one agent is enough\"",{"type":39,"tag":48,"props":399,"children":400},{},[401,403,409,411,417,419,425,427,432,434,442],{"type":45,"value":402},"Use ",{"type":39,"tag":76,"props":404,"children":406},{"className":405},[],[407],{"type":45,"value":408},"Agent.kickoff()",{"type":45,"value":410}," directly inside a Flow method — no ",{"type":39,"tag":76,"props":412,"children":414},{"className":413},[],[415],{"type":45,"value":416},"Crew",{"type":45,"value":418},", no ",{"type":39,"tag":76,"props":420,"children":422},{"className":421},[],[423],{"type":45,"value":424},"Task",{"type":45,"value":426}," ceremony. The Flow owns sequencing and state; each step is a single agent kickoff. See ",{"type":39,"tag":68,"props":428,"children":429},{},[430],{"type":45,"value":431},"Section 4 — Agent.kickoff() — Direct Agent Execution",{"type":45,"value":433}," below for the full pattern, and the upstream docs at ",{"type":39,"tag":435,"props":436,"children":440},"a",{"href":437,"rel":438},"https:\u002F\u002Fdocs.crewai.com\u002Fen\u002Fconcepts\u002Fagents#direct-agent-interaction-with-kickoff",[439],"nofollow",[441],{"type":45,"value":437},{"type":45,"value":443},".",{"type":39,"tag":48,"props":445,"children":446},{},[447],{"type":45,"value":448},"Quick shape:",{"type":39,"tag":199,"props":450,"children":452},{"className":201,"code":451,"language":203,"meta":204,"style":204},"@listen(previous_step)\ndef my_step(self):\n    agent = Agent(role=\"…\", goal=\"…\", backstory=\"…\", tools=[...])\n    result = agent.kickoff(\n        messages=f\"Use this prior step's output: {self.state.prior_field}\",\n        response_format=MyPydanticModel,  # optional\n    )\n    self.state.my_field = result.pydantic  # or result.raw\n",[453],{"type":39,"tag":76,"props":454,"children":455},{"__ignoreMap":204},[456,464,472,480,488,496,504,512],{"type":39,"tag":210,"props":457,"children":458},{"class":212,"line":213},[459],{"type":39,"tag":210,"props":460,"children":461},{},[462],{"type":45,"value":463},"@listen(previous_step)\n",{"type":39,"tag":210,"props":465,"children":466},{"class":212,"line":222},[467],{"type":39,"tag":210,"props":468,"children":469},{},[470],{"type":45,"value":471},"def my_step(self):\n",{"type":39,"tag":210,"props":473,"children":474},{"class":212,"line":231},[475],{"type":39,"tag":210,"props":476,"children":477},{},[478],{"type":45,"value":479},"    agent = Agent(role=\"…\", goal=\"…\", backstory=\"…\", tools=[...])\n",{"type":39,"tag":210,"props":481,"children":482},{"class":212,"line":343},[483],{"type":39,"tag":210,"props":484,"children":485},{},[486],{"type":45,"value":487},"    result = agent.kickoff(\n",{"type":39,"tag":210,"props":489,"children":490},{"class":212,"line":352},[491],{"type":39,"tag":210,"props":492,"children":493},{},[494],{"type":45,"value":495},"        messages=f\"Use this prior step's output: {self.state.prior_field}\",\n",{"type":39,"tag":210,"props":497,"children":498},{"class":212,"line":361},[499],{"type":39,"tag":210,"props":500,"children":501},{},[502],{"type":45,"value":503},"        response_format=MyPydanticModel,  # optional\n",{"type":39,"tag":210,"props":505,"children":506},{"class":212,"line":370},[507],{"type":39,"tag":210,"props":508,"children":509},{},[510],{"type":45,"value":511},"    )\n",{"type":39,"tag":210,"props":513,"children":515},{"class":212,"line":514},8,[516],{"type":39,"tag":210,"props":517,"children":518},{},[519],{"type":45,"value":520},"    self.state.my_field = result.pydantic  # or result.raw\n",{"type":39,"tag":48,"props":522,"children":523},{},[524,526,532,534,540,542,547],{"type":45,"value":525},"Reach for ",{"type":39,"tag":76,"props":527,"children":529},{"className":528},[],[530],{"type":45,"value":531},"Crew.kickoff()",{"type":45,"value":533}," ",{"type":39,"tag":535,"props":536,"children":537},"em",{},[538],{"type":45,"value":539},"only",{"type":45,"value":541}," when a step genuinely benefits from multi-agent collaboration (delegation, hierarchical management, parallel specialists feeding one synthesis). For \"one agent does one job\", ",{"type":39,"tag":76,"props":543,"children":545},{"className":544},[],[546],{"type":45,"value":408},{"type":45,"value":548}," inside a Flow listener is the right primitive.",{"type":39,"tag":48,"props":550,"children":551},{},[552],{"type":45,"value":553},"Only after you've decided multi-agent is justified, read on for how to design each one.",{"type":39,"tag":54,"props":555,"children":556},{},[],{"type":39,"tag":58,"props":558,"children":560},{"id":559},"_1-the-role-goal-backstory-framework",[561],{"type":45,"value":562},"1. The Role-Goal-Backstory Framework",{"type":39,"tag":48,"props":564,"children":565},{},[566,568,573,575,580,582,587],{"type":45,"value":567},"Every agent needs three things: ",{"type":39,"tag":68,"props":569,"children":570},{},[571],{"type":45,"value":572},"who",{"type":45,"value":574}," it is, ",{"type":39,"tag":68,"props":576,"children":577},{},[578],{"type":45,"value":579},"what",{"type":45,"value":581}," it wants, and ",{"type":39,"tag":68,"props":583,"children":584},{},[585],{"type":45,"value":586},"why",{"type":45,"value":588}," it's qualified.",{"type":39,"tag":187,"props":590,"children":592},{"id":591},"role-who-the-agent-is",[593],{"type":45,"value":594},"Role — Who the Agent Is",{"type":39,"tag":48,"props":596,"children":597},{},[598,600],{"type":45,"value":599},"The role defines the agent's area of expertise. ",{"type":39,"tag":68,"props":601,"children":602},{},[603],{"type":45,"value":604},"Be specific, not generic.",{"type":39,"tag":606,"props":607,"children":608},"table",{},[609,628],{"type":39,"tag":610,"props":611,"children":612},"thead",{},[613],{"type":39,"tag":614,"props":615,"children":616},"tr",{},[617,623],{"type":39,"tag":618,"props":619,"children":620},"th",{},[621],{"type":45,"value":622},"Bad",{"type":39,"tag":618,"props":624,"children":625},{},[626],{"type":45,"value":627},"Good",{"type":39,"tag":629,"props":630,"children":631},"tbody",{},[632,654,675],{"type":39,"tag":614,"props":633,"children":634},{},[635,645],{"type":39,"tag":636,"props":637,"children":638},"td",{},[639],{"type":39,"tag":76,"props":640,"children":642},{"className":641},[],[643],{"type":45,"value":644},"Researcher",{"type":39,"tag":636,"props":646,"children":647},{},[648],{"type":39,"tag":76,"props":649,"children":651},{"className":650},[],[652],{"type":45,"value":653},"Senior Data Researcher specializing in {topic}",{"type":39,"tag":614,"props":655,"children":656},{},[657,666],{"type":39,"tag":636,"props":658,"children":659},{},[660],{"type":39,"tag":76,"props":661,"children":663},{"className":662},[],[664],{"type":45,"value":665},"Writer",{"type":39,"tag":636,"props":667,"children":668},{},[669],{"type":39,"tag":76,"props":670,"children":672},{"className":671},[],[673],{"type":45,"value":674},"Technical Blog Writer for developer audiences",{"type":39,"tag":614,"props":676,"children":677},{},[678,687],{"type":39,"tag":636,"props":679,"children":680},{},[681],{"type":39,"tag":76,"props":682,"children":684},{"className":683},[],[685],{"type":45,"value":686},"Analyst",{"type":39,"tag":636,"props":688,"children":689},{},[690],{"type":39,"tag":76,"props":691,"children":693},{"className":692},[],[694],{"type":45,"value":695},"Financial Risk Analyst with regulatory compliance expertise",{"type":39,"tag":48,"props":697,"children":698},{},[699],{"type":45,"value":700},"The role directly shapes how the LLM reasons. A \"Senior Data Researcher\" will produce different output than a \"Research Assistant\" even with the same task.",{"type":39,"tag":187,"props":702,"children":704},{"id":703},"goal-what-the-agent-wants",[705],{"type":45,"value":706},"Goal — What the Agent Wants",{"type":39,"tag":48,"props":708,"children":709},{},[710,712,717],{"type":45,"value":711},"The goal is the agent's individual objective. It should be ",{"type":39,"tag":68,"props":713,"children":714},{},[715],{"type":45,"value":716},"outcome-focused with quality standards",{"type":45,"value":443},{"type":39,"tag":606,"props":719,"children":720},{},[721,735],{"type":39,"tag":610,"props":722,"children":723},{},[724],{"type":39,"tag":614,"props":725,"children":726},{},[727,731],{"type":39,"tag":618,"props":728,"children":729},{},[730],{"type":45,"value":622},{"type":39,"tag":618,"props":732,"children":733},{},[734],{"type":45,"value":627},{"type":39,"tag":629,"props":736,"children":737},{},[738,759,780],{"type":39,"tag":614,"props":739,"children":740},{},[741,750],{"type":39,"tag":636,"props":742,"children":743},{},[744],{"type":39,"tag":76,"props":745,"children":747},{"className":746},[],[748],{"type":45,"value":749},"Do research",{"type":39,"tag":636,"props":751,"children":752},{},[753],{"type":39,"tag":76,"props":754,"children":756},{"className":755},[],[757],{"type":45,"value":758},"Uncover cutting-edge developments in {topic} and identify the top 5 trends with supporting evidence",{"type":39,"tag":614,"props":760,"children":761},{},[762,771],{"type":39,"tag":636,"props":763,"children":764},{},[765],{"type":39,"tag":76,"props":766,"children":768},{"className":767},[],[769],{"type":45,"value":770},"Write content",{"type":39,"tag":636,"props":772,"children":773},{},[774],{"type":39,"tag":76,"props":775,"children":777},{"className":776},[],[778],{"type":45,"value":779},"Produce publication-ready technical articles that explain complex topics clearly for non-technical readers",{"type":39,"tag":614,"props":781,"children":782},{},[783,792],{"type":39,"tag":636,"props":784,"children":785},{},[786],{"type":39,"tag":76,"props":787,"children":789},{"className":788},[],[790],{"type":45,"value":791},"Analyze data",{"type":39,"tag":636,"props":793,"children":794},{},[795],{"type":39,"tag":76,"props":796,"children":798},{"className":797},[],[799],{"type":45,"value":800},"Deliver actionable risk assessments with confidence levels and recommended mitigations",{"type":39,"tag":187,"props":802,"children":804},{"id":803},"backstory-why-the-agent-is-qualified",[805],{"type":45,"value":806},"Backstory — Why the Agent Is Qualified",{"type":39,"tag":48,"props":808,"children":809},{},[810],{"type":45,"value":811},"The backstory establishes expertise, experience, values, and working style. It's the agent's \"personality prompt.\"",{"type":39,"tag":199,"props":813,"children":817},{"className":814,"code":815,"language":816,"meta":204,"style":204},"language-yaml shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","backstory: >\n  You're a seasoned researcher with 15 years of experience in AI\u002FML.\n  You're known for your ability to find obscure but relevant papers\n  and synthesize complex findings into clear, actionable insights.\n  You always cite your sources and flag uncertainty explicitly.\n","yaml",[818],{"type":39,"tag":76,"props":819,"children":820},{"__ignoreMap":204},[821,842,851,859,867],{"type":39,"tag":210,"props":822,"children":823},{"class":212,"line":213},[824,830,836],{"type":39,"tag":210,"props":825,"children":827},{"style":826},"--shiki-light:#E53935;--shiki-default:#F07178;--shiki-dark:#F07178",[828],{"type":45,"value":829},"backstory",{"type":39,"tag":210,"props":831,"children":833},{"style":832},"--shiki-light:#39ADB5;--shiki-default:#89DDFF;--shiki-dark:#89DDFF",[834],{"type":45,"value":835},":",{"type":39,"tag":210,"props":837,"children":839},{"style":838},"--shiki-light:#39ADB5;--shiki-light-font-style:italic;--shiki-default:#89DDFF;--shiki-default-font-style:italic;--shiki-dark:#89DDFF;--shiki-dark-font-style:italic",[840],{"type":45,"value":841}," >\n",{"type":39,"tag":210,"props":843,"children":844},{"class":212,"line":222},[845],{"type":39,"tag":210,"props":846,"children":848},{"style":847},"--shiki-light:#91B859;--shiki-default:#C3E88D;--shiki-dark:#C3E88D",[849],{"type":45,"value":850},"  You're a seasoned researcher with 15 years of experience in AI\u002FML.\n",{"type":39,"tag":210,"props":852,"children":853},{"class":212,"line":231},[854],{"type":39,"tag":210,"props":855,"children":856},{"style":847},[857],{"type":45,"value":858},"  You're known for your ability to find obscure but relevant papers\n",{"type":39,"tag":210,"props":860,"children":861},{"class":212,"line":343},[862],{"type":39,"tag":210,"props":863,"children":864},{"style":847},[865],{"type":45,"value":866},"  and synthesize complex findings into clear, actionable insights.\n",{"type":39,"tag":210,"props":868,"children":869},{"class":212,"line":352},[870],{"type":39,"tag":210,"props":871,"children":872},{"style":847},[873],{"type":45,"value":874},"  You always cite your sources and flag uncertainty explicitly.\n",{"type":39,"tag":48,"props":876,"children":877},{},[878],{"type":39,"tag":68,"props":879,"children":880},{},[881],{"type":45,"value":882},"What to include in a backstory:",{"type":39,"tag":104,"props":884,"children":885},{},[886,891,896,901],{"type":39,"tag":108,"props":887,"children":888},{},[889],{"type":45,"value":890},"Years\u002Fdepth of experience",{"type":39,"tag":108,"props":892,"children":893},{},[894],{"type":45,"value":895},"Specific domain knowledge",{"type":39,"tag":108,"props":897,"children":898},{},[899],{"type":45,"value":900},"Working style and values (e.g., \"always cites sources\", \"prefers concise output\")",{"type":39,"tag":108,"props":902,"children":903},{},[904],{"type":45,"value":905},"Quality standards the agent holds itself to",{"type":39,"tag":48,"props":907,"children":908},{},[909],{"type":39,"tag":68,"props":910,"children":911},{},[912],{"type":45,"value":913},"What NOT to include:",{"type":39,"tag":104,"props":915,"children":916},{},[917,922,927],{"type":39,"tag":108,"props":918,"children":919},{},[920],{"type":45,"value":921},"Implementation details (tools, models, config)",{"type":39,"tag":108,"props":923,"children":924},{},[925],{"type":45,"value":926},"Task-specific instructions (those go in the task description)",{"type":39,"tag":108,"props":928,"children":929},{},[930],{"type":45,"value":931},"Arbitrary personality traits that don't affect output quality",{"type":39,"tag":54,"props":933,"children":934},{},[],{"type":39,"tag":58,"props":936,"children":938},{"id":937},"_2-agent-configuration-reference",[939],{"type":45,"value":940},"2. Agent Configuration Reference",{"type":39,"tag":187,"props":942,"children":944},{"id":943},"essential-parameters",[945],{"type":45,"value":946},"Essential Parameters",{"type":39,"tag":199,"props":948,"children":950},{"className":201,"code":949,"language":203,"meta":204,"style":204},"Agent(\n    role=\"...\",              # Required: agent's expertise area\n    goal=\"...\",              # Required: what the agent aims to achieve\n    backstory=\"...\",         # Required: context and personality\n    llm=\"openai\u002Fgpt-4o\",    # Optional: defaults to OPENAI_MODEL_NAME env var or \"gpt-4\"\n    tools=[...],             # Optional: list of tool instances\n)\n",[951],{"type":39,"tag":76,"props":952,"children":953},{"__ignoreMap":204},[954,962,970,978,986,994,1002],{"type":39,"tag":210,"props":955,"children":956},{"class":212,"line":213},[957],{"type":39,"tag":210,"props":958,"children":959},{},[960],{"type":45,"value":961},"Agent(\n",{"type":39,"tag":210,"props":963,"children":964},{"class":212,"line":222},[965],{"type":39,"tag":210,"props":966,"children":967},{},[968],{"type":45,"value":969},"    role=\"...\",              # Required: agent's expertise area\n",{"type":39,"tag":210,"props":971,"children":972},{"class":212,"line":231},[973],{"type":39,"tag":210,"props":974,"children":975},{},[976],{"type":45,"value":977},"    goal=\"...\",              # Required: what the agent aims to achieve\n",{"type":39,"tag":210,"props":979,"children":980},{"class":212,"line":343},[981],{"type":39,"tag":210,"props":982,"children":983},{},[984],{"type":45,"value":985},"    backstory=\"...\",         # Required: context and personality\n",{"type":39,"tag":210,"props":987,"children":988},{"class":212,"line":352},[989],{"type":39,"tag":210,"props":990,"children":991},{},[992],{"type":45,"value":993},"    llm=\"openai\u002Fgpt-4o\",    # Optional: defaults to OPENAI_MODEL_NAME env var or \"gpt-4\"\n",{"type":39,"tag":210,"props":995,"children":996},{"class":212,"line":361},[997],{"type":39,"tag":210,"props":998,"children":999},{},[1000],{"type":45,"value":1001},"    tools=[...],             # Optional: list of tool instances\n",{"type":39,"tag":210,"props":1003,"children":1004},{"class":212,"line":370},[1005],{"type":39,"tag":210,"props":1006,"children":1007},{},[1008],{"type":45,"value":358},{"type":39,"tag":187,"props":1010,"children":1012},{"id":1011},"execution-control",[1013],{"type":45,"value":1014},"Execution Control",{"type":39,"tag":199,"props":1016,"children":1018},{"className":201,"code":1017,"language":203,"meta":204,"style":204},"Agent(\n    ...,\n    max_iter=25,             # Max reasoning iterations per task (default: 25)\n    max_execution_time=300,  # Timeout in seconds (default: None — no limit)\n    max_rpm=10,              # Rate limit: max API calls per minute (default: None)\n    max_retry_limit=2,       # Retries on error (default: 2)\n    verbose=True,            # Show detailed execution logs (default: False)\n)\n",[1019],{"type":39,"tag":76,"props":1020,"children":1021},{"__ignoreMap":204},[1022,1029,1037,1045,1053,1061,1069,1077],{"type":39,"tag":210,"props":1023,"children":1024},{"class":212,"line":213},[1025],{"type":39,"tag":210,"props":1026,"children":1027},{},[1028],{"type":45,"value":961},{"type":39,"tag":210,"props":1030,"children":1031},{"class":212,"line":222},[1032],{"type":39,"tag":210,"props":1033,"children":1034},{},[1035],{"type":45,"value":1036},"    ...,\n",{"type":39,"tag":210,"props":1038,"children":1039},{"class":212,"line":231},[1040],{"type":39,"tag":210,"props":1041,"children":1042},{},[1043],{"type":45,"value":1044},"    max_iter=25,             # Max reasoning iterations per task (default: 25)\n",{"type":39,"tag":210,"props":1046,"children":1047},{"class":212,"line":343},[1048],{"type":39,"tag":210,"props":1049,"children":1050},{},[1051],{"type":45,"value":1052},"    max_execution_time=300,  # Timeout in seconds (default: None — no limit)\n",{"type":39,"tag":210,"props":1054,"children":1055},{"class":212,"line":352},[1056],{"type":39,"tag":210,"props":1057,"children":1058},{},[1059],{"type":45,"value":1060},"    max_rpm=10,              # Rate limit: max API calls per minute (default: None)\n",{"type":39,"tag":210,"props":1062,"children":1063},{"class":212,"line":361},[1064],{"type":39,"tag":210,"props":1065,"children":1066},{},[1067],{"type":45,"value":1068},"    max_retry_limit=2,       # Retries on error (default: 2)\n",{"type":39,"tag":210,"props":1070,"children":1071},{"class":212,"line":370},[1072],{"type":39,"tag":210,"props":1073,"children":1074},{},[1075],{"type":45,"value":1076},"    verbose=True,            # Show detailed execution logs (default: False)\n",{"type":39,"tag":210,"props":1078,"children":1079},{"class":212,"line":514},[1080],{"type":39,"tag":210,"props":1081,"children":1082},{},[1083],{"type":45,"value":358},{"type":39,"tag":48,"props":1085,"children":1086},{},[1087],{"type":39,"tag":68,"props":1088,"children":1089},{},[1090,1092,1098],{"type":45,"value":1091},"Tuning ",{"type":39,"tag":76,"props":1093,"children":1095},{"className":1094},[],[1096],{"type":45,"value":1097},"max_iter",{"type":45,"value":835},{"type":39,"tag":104,"props":1100,"children":1101},{},[1102,1107,1112],{"type":39,"tag":108,"props":1103,"children":1104},{},[1105],{"type":45,"value":1106},"Default 25 is generous — most tasks finish in 3-8 iterations",{"type":39,"tag":108,"props":1108,"children":1109},{},[1110],{"type":45,"value":1111},"Lower to 10-15 to fail faster when tasks are well-defined",{"type":39,"tag":108,"props":1113,"children":1114},{},[1115],{"type":45,"value":1116},"If agent consistently hits max_iter, the task is too vague (fix the task, not the limit)",{"type":39,"tag":187,"props":1118,"children":1120},{"id":1119},"tool-configuration",[1121],{"type":45,"value":1122},"Tool Configuration",{"type":39,"tag":199,"props":1124,"children":1126},{"className":201,"code":1125,"language":203,"meta":204,"style":204},"from crewai_tools import SerperDevTool, ScrapeWebsiteTool, FileReadTool\n\nAgent(\n    ...,\n    tools=[SerperDevTool(), ScrapeWebsiteTool()],  # Agent-level tools\n)\n",[1127],{"type":39,"tag":76,"props":1128,"children":1129},{"__ignoreMap":204},[1130,1138,1147,1154,1161,1169],{"type":39,"tag":210,"props":1131,"children":1132},{"class":212,"line":213},[1133],{"type":39,"tag":210,"props":1134,"children":1135},{},[1136],{"type":45,"value":1137},"from crewai_tools import SerperDevTool, ScrapeWebsiteTool, FileReadTool\n",{"type":39,"tag":210,"props":1139,"children":1140},{"class":212,"line":222},[1141],{"type":39,"tag":210,"props":1142,"children":1144},{"emptyLinePlaceholder":1143},true,[1145],{"type":45,"value":1146},"\n",{"type":39,"tag":210,"props":1148,"children":1149},{"class":212,"line":231},[1150],{"type":39,"tag":210,"props":1151,"children":1152},{},[1153],{"type":45,"value":961},{"type":39,"tag":210,"props":1155,"children":1156},{"class":212,"line":343},[1157],{"type":39,"tag":210,"props":1158,"children":1159},{},[1160],{"type":45,"value":1036},{"type":39,"tag":210,"props":1162,"children":1163},{"class":212,"line":352},[1164],{"type":39,"tag":210,"props":1165,"children":1166},{},[1167],{"type":45,"value":1168},"    tools=[SerperDevTool(), ScrapeWebsiteTool()],  # Agent-level tools\n",{"type":39,"tag":210,"props":1170,"children":1171},{"class":212,"line":361},[1172],{"type":39,"tag":210,"props":1173,"children":1174},{},[1175],{"type":45,"value":358},{"type":39,"tag":48,"props":1177,"children":1178},{},[1179],{"type":39,"tag":68,"props":1180,"children":1181},{},[1182],{"type":45,"value":1183},"Key rules:",{"type":39,"tag":104,"props":1185,"children":1186},{},[1187,1199,1211,1230],{"type":39,"tag":108,"props":1188,"children":1189},{},[1190,1192,1197],{"type":45,"value":1191},"An agent with ",{"type":39,"tag":68,"props":1193,"children":1194},{},[1195],{"type":45,"value":1196},"no tools",{"type":45,"value":1198}," will hallucinate data when asked to search, fetch, or read files — always provide tools for tasks that require external data",{"type":39,"tag":108,"props":1200,"children":1201},{},[1202,1204,1209],{"type":45,"value":1203},"Prefer ",{"type":39,"tag":68,"props":1205,"children":1206},{},[1207],{"type":45,"value":1208},"fewer, focused tools",{"type":45,"value":1210}," over many tools — too many tools confuses the agent",{"type":39,"tag":108,"props":1212,"children":1213},{},[1214,1216,1221,1223,1228],{"type":45,"value":1215},"Tools can also be assigned at the ",{"type":39,"tag":68,"props":1217,"children":1218},{},[1219],{"type":45,"value":1220},"task level",{"type":45,"value":1222}," for task-specific access (see ",{"type":39,"tag":76,"props":1224,"children":1226},{"className":1225},[],[1227],{"type":45,"value":81},{"type":45,"value":1229}," skill)",{"type":39,"tag":108,"props":1231,"children":1232},{},[1233],{"type":45,"value":1234},"Agent-level tools are available for all tasks the agent performs; task-level tools override for that specific task",{"type":39,"tag":187,"props":1236,"children":1238},{"id":1237},"llm-selection",[1239],{"type":45,"value":1240},"LLM Selection",{"type":39,"tag":199,"props":1242,"children":1244},{"className":201,"code":1243,"language":203,"meta":204,"style":204},"Agent(\n    ...,\n    llm=\"openai\u002Fgpt-4o\",              # Main reasoning model\n    function_calling_llm=\"openai\u002Fgpt-4o-mini\",  # Cheaper model for tool calls only\n)\n",[1245],{"type":39,"tag":76,"props":1246,"children":1247},{"__ignoreMap":204},[1248,1255,1262,1270,1278],{"type":39,"tag":210,"props":1249,"children":1250},{"class":212,"line":213},[1251],{"type":39,"tag":210,"props":1252,"children":1253},{},[1254],{"type":45,"value":961},{"type":39,"tag":210,"props":1256,"children":1257},{"class":212,"line":222},[1258],{"type":39,"tag":210,"props":1259,"children":1260},{},[1261],{"type":45,"value":1036},{"type":39,"tag":210,"props":1263,"children":1264},{"class":212,"line":231},[1265],{"type":39,"tag":210,"props":1266,"children":1267},{},[1268],{"type":45,"value":1269},"    llm=\"openai\u002Fgpt-4o\",              # Main reasoning model\n",{"type":39,"tag":210,"props":1271,"children":1272},{"class":212,"line":343},[1273],{"type":39,"tag":210,"props":1274,"children":1275},{},[1276],{"type":45,"value":1277},"    function_calling_llm=\"openai\u002Fgpt-4o-mini\",  # Cheaper model for tool calls only\n",{"type":39,"tag":210,"props":1279,"children":1280},{"class":212,"line":352},[1281],{"type":39,"tag":210,"props":1282,"children":1283},{},[1284],{"type":45,"value":358},{"type":39,"tag":48,"props":1286,"children":1287},{},[1288,1289,1295,1297,1303],{"type":45,"value":402},{"type":39,"tag":76,"props":1290,"children":1292},{"className":1291},[],[1293],{"type":45,"value":1294},"function_calling_llm",{"type":45,"value":1296}," to save costs: the main ",{"type":39,"tag":76,"props":1298,"children":1300},{"className":1299},[],[1301],{"type":45,"value":1302},"llm",{"type":45,"value":1304}," handles reasoning while a cheaper model handles tool-calling mechanics.",{"type":39,"tag":187,"props":1306,"children":1308},{"id":1307},"collaboration",[1309],{"type":45,"value":1310},"Collaboration",{"type":39,"tag":199,"props":1312,"children":1314},{"className":201,"code":1313,"language":203,"meta":204,"style":204},"Agent(\n    ...,\n    allow_delegation=False,  # Default: False — agent works alone\n)\n",[1315],{"type":39,"tag":76,"props":1316,"children":1317},{"__ignoreMap":204},[1318,1325,1332,1340],{"type":39,"tag":210,"props":1319,"children":1320},{"class":212,"line":213},[1321],{"type":39,"tag":210,"props":1322,"children":1323},{},[1324],{"type":45,"value":961},{"type":39,"tag":210,"props":1326,"children":1327},{"class":212,"line":222},[1328],{"type":39,"tag":210,"props":1329,"children":1330},{},[1331],{"type":45,"value":1036},{"type":39,"tag":210,"props":1333,"children":1334},{"class":212,"line":231},[1335],{"type":39,"tag":210,"props":1336,"children":1337},{},[1338],{"type":45,"value":1339},"    allow_delegation=False,  # Default: False — agent works alone\n",{"type":39,"tag":210,"props":1341,"children":1342},{"class":212,"line":343},[1343],{"type":39,"tag":210,"props":1344,"children":1345},{},[1346],{"type":45,"value":358},{"type":39,"tag":48,"props":1348,"children":1349},{},[1350,1352,1358],{"type":45,"value":1351},"Set ",{"type":39,"tag":76,"props":1353,"children":1355},{"className":1354},[],[1356],{"type":45,"value":1357},"allow_delegation=True",{"type":45,"value":1359}," only when:",{"type":39,"tag":104,"props":1361,"children":1362},{},[1363,1368,1373],{"type":39,"tag":108,"props":1364,"children":1365},{},[1366],{"type":45,"value":1367},"The agent is part of a crew with other specialized agents",{"type":39,"tag":108,"props":1369,"children":1370},{},[1371],{"type":45,"value":1372},"The task genuinely benefits from the agent handing off subtasks",{"type":39,"tag":108,"props":1374,"children":1375},{},[1376],{"type":45,"value":1377},"You're using hierarchical process where the manager delegates",{"type":39,"tag":48,"props":1379,"children":1380},{},[1381,1386],{"type":39,"tag":68,"props":1382,"children":1383},{},[1384],{"type":45,"value":1385},"Warning:",{"type":45,"value":1387}," Delegation without clear task boundaries leads to infinite loops or wasted iterations.",{"type":39,"tag":187,"props":1389,"children":1391},{"id":1390},"planning-plan-and-execute-mode",[1392],{"type":45,"value":1393},"Planning (Plan-and-Execute Mode)",{"type":39,"tag":48,"props":1395,"children":1396},{},[1397,1399,1405,1407,1412,1414,1420,1422,1428],{"type":45,"value":1398},"When a ",{"type":39,"tag":76,"props":1400,"children":1402},{"className":1401},[],[1403],{"type":45,"value":1404},"PlanningConfig",{"type":45,"value":1406}," is set on an agent, ",{"type":39,"tag":76,"props":1408,"children":1410},{"className":1409},[],[1411],{"type":45,"value":408},{"type":45,"value":1413}," (and ",{"type":39,"tag":76,"props":1415,"children":1417},{"className":1416},[],[1418],{"type":45,"value":1419},"Agent.execute_task()",{"type":45,"value":1421},") routes through the new ",{"type":39,"tag":76,"props":1423,"children":1425},{"className":1424},[],[1426],{"type":45,"value":1427},"crewai.experimental.AgentExecutor",{"type":45,"value":1429},". Instead of a single ReAct-style loop, the agent:",{"type":39,"tag":1431,"props":1432,"children":1433},"ol",{},[1434,1467,1493,1510],{"type":39,"tag":108,"props":1435,"children":1436},{},[1437,1442,1444,1450,1452,1458,1460,1466],{"type":39,"tag":68,"props":1438,"children":1439},{},[1440],{"type":45,"value":1441},"Generates a plan",{"type":45,"value":1443}," — a list of ",{"type":39,"tag":76,"props":1445,"children":1447},{"className":1446},[],[1448],{"type":45,"value":1449},"PlanStep",{"type":45,"value":1451},"s, each with a description and optional ",{"type":39,"tag":76,"props":1453,"children":1455},{"className":1454},[],[1456],{"type":45,"value":1457},"tool_to_use",{"type":45,"value":1459},". Stored as ",{"type":39,"tag":76,"props":1461,"children":1463},{"className":1462},[],[1464],{"type":45,"value":1465},"state.todos",{"type":45,"value":443},{"type":39,"tag":108,"props":1468,"children":1469},{},[1470,1475,1477,1483,1485,1491],{"type":39,"tag":68,"props":1471,"children":1472},{},[1473],{"type":45,"value":1474},"Executes each step",{"type":45,"value":1476}," via a ",{"type":39,"tag":76,"props":1478,"children":1480},{"className":1479},[],[1481],{"type":45,"value":1482},"StepExecutor",{"type":45,"value":1484}," in an isolated multi-turn LLM loop (capped by ",{"type":39,"tag":76,"props":1486,"children":1488},{"className":1487},[],[1489],{"type":45,"value":1490},"max_step_iterations",{"type":45,"value":1492},").",{"type":39,"tag":108,"props":1494,"children":1495},{},[1496,1501,1502,1508],{"type":39,"tag":68,"props":1497,"children":1498},{},[1499],{"type":45,"value":1500},"Observes the result",{"type":45,"value":1476},{"type":39,"tag":76,"props":1503,"children":1505},{"className":1504},[],[1506],{"type":45,"value":1507},"PlannerObserver",{"type":45,"value":1509}," after every step — did the step succeed? Is the remaining plan still valid?",{"type":39,"tag":108,"props":1511,"children":1512},{},[1513,1518,1520,1526],{"type":39,"tag":68,"props":1514,"children":1515},{},[1516],{"type":45,"value":1517},"Routes the next action",{"type":45,"value":1519}," based on the agent's ",{"type":39,"tag":76,"props":1521,"children":1523},{"className":1522},[],[1524],{"type":45,"value":1525},"reasoning_effort",{"type":45,"value":1527}," setting (see below).",{"type":39,"tag":48,"props":1529,"children":1530},{},[1531,1533,1538,1540,1546],{"type":45,"value":1532},"The presence of a ",{"type":39,"tag":76,"props":1534,"children":1536},{"className":1535},[],[1537],{"type":45,"value":1404},{"type":45,"value":1539}," enables the mode. To disable: don't pass one, or set ",{"type":39,"tag":76,"props":1541,"children":1543},{"className":1542},[],[1544],{"type":45,"value":1545},"planning=False",{"type":45,"value":443},{"type":39,"tag":199,"props":1548,"children":1550},{"className":201,"code":1549,"language":203,"meta":204,"style":204},"from crewai import Agent\nfrom crewai.agent.planning_config import PlanningConfig\n\nagent = Agent(\n    role=\"…\",\n    goal=\"…\",\n    backstory=\"…\",\n    tools=[...],\n    planning_config=PlanningConfig(reasoning_effort=\"medium\"),  # most common\n)\n",[1551],{"type":39,"tag":76,"props":1552,"children":1553},{"__ignoreMap":204},[1554,1562,1570,1577,1585,1593,1601,1609,1617,1625],{"type":39,"tag":210,"props":1555,"children":1556},{"class":212,"line":213},[1557],{"type":39,"tag":210,"props":1558,"children":1559},{},[1560],{"type":45,"value":1561},"from crewai import Agent\n",{"type":39,"tag":210,"props":1563,"children":1564},{"class":212,"line":222},[1565],{"type":39,"tag":210,"props":1566,"children":1567},{},[1568],{"type":45,"value":1569},"from crewai.agent.planning_config import PlanningConfig\n",{"type":39,"tag":210,"props":1571,"children":1572},{"class":212,"line":231},[1573],{"type":39,"tag":210,"props":1574,"children":1575},{"emptyLinePlaceholder":1143},[1576],{"type":45,"value":1146},{"type":39,"tag":210,"props":1578,"children":1579},{"class":212,"line":343},[1580],{"type":39,"tag":210,"props":1581,"children":1582},{},[1583],{"type":45,"value":1584},"agent = Agent(\n",{"type":39,"tag":210,"props":1586,"children":1587},{"class":212,"line":352},[1588],{"type":39,"tag":210,"props":1589,"children":1590},{},[1591],{"type":45,"value":1592},"    role=\"…\",\n",{"type":39,"tag":210,"props":1594,"children":1595},{"class":212,"line":361},[1596],{"type":39,"tag":210,"props":1597,"children":1598},{},[1599],{"type":45,"value":1600},"    goal=\"…\",\n",{"type":39,"tag":210,"props":1602,"children":1603},{"class":212,"line":370},[1604],{"type":39,"tag":210,"props":1605,"children":1606},{},[1607],{"type":45,"value":1608},"    backstory=\"…\",\n",{"type":39,"tag":210,"props":1610,"children":1611},{"class":212,"line":514},[1612],{"type":39,"tag":210,"props":1613,"children":1614},{},[1615],{"type":45,"value":1616},"    tools=[...],\n",{"type":39,"tag":210,"props":1618,"children":1619},{"class":212,"line":27},[1620],{"type":39,"tag":210,"props":1621,"children":1622},{},[1623],{"type":45,"value":1624},"    planning_config=PlanningConfig(reasoning_effort=\"medium\"),  # most common\n",{"type":39,"tag":210,"props":1626,"children":1628},{"class":212,"line":1627},10,[1629],{"type":39,"tag":210,"props":1630,"children":1631},{},[1632],{"type":45,"value":358},{"type":39,"tag":1634,"props":1635,"children":1637},"h4",{"id":1636},"reasoning_effort-pick-one",[1638,1643],{"type":39,"tag":76,"props":1639,"children":1641},{"className":1640},[],[1642],{"type":45,"value":1525},{"type":45,"value":1644}," — pick one",{"type":39,"tag":606,"props":1646,"children":1647},{},[1648,1669],{"type":39,"tag":610,"props":1649,"children":1650},{},[1651],{"type":39,"tag":614,"props":1652,"children":1653},{},[1654,1659,1664],{"type":39,"tag":618,"props":1655,"children":1656},{},[1657],{"type":45,"value":1658},"Level",{"type":39,"tag":618,"props":1660,"children":1661},{},[1662],{"type":45,"value":1663},"After each step the planner...",{"type":39,"tag":618,"props":1665,"children":1666},{},[1667],{"type":45,"value":1668},"Pick when",{"type":39,"tag":629,"props":1670,"children":1671},{},[1672,1699,1735],{"type":39,"tag":614,"props":1673,"children":1674},{},[1675,1684,1694],{"type":39,"tag":636,"props":1676,"children":1677},{},[1678],{"type":39,"tag":76,"props":1679,"children":1681},{"className":1680},[],[1682],{"type":45,"value":1683},"\"low\"",{"type":39,"tag":636,"props":1685,"children":1686},{},[1687,1689],{"type":45,"value":1688},"observes (validates success), marks the todo complete, continues. ",{"type":39,"tag":68,"props":1690,"children":1691},{},[1692],{"type":45,"value":1693},"No replan, no refine.",{"type":39,"tag":636,"props":1695,"children":1696},{},[1697],{"type":45,"value":1698},"You want plan visibility (todos, observations) but trust the agent to follow it linearly. Fastest.",{"type":39,"tag":614,"props":1700,"children":1701},{},[1702,1713,1725],{"type":39,"tag":636,"props":1703,"children":1704},{},[1705,1711],{"type":39,"tag":76,"props":1706,"children":1708},{"className":1707},[],[1709],{"type":45,"value":1710},"\"medium\"",{"type":45,"value":1712}," (default)",{"type":39,"tag":636,"props":1714,"children":1715},{},[1716,1718,1723],{"type":45,"value":1717},"observes; ",{"type":39,"tag":68,"props":1719,"children":1720},{},[1721],{"type":45,"value":1722},"replans on failure only",{"type":45,"value":1724},". Successful steps just continue.",{"type":39,"tag":636,"props":1726,"children":1727},{},[1728,1730],{"type":45,"value":1729},"The agent's tools can fail (network, exec, scrape) and you want graceful recovery without paying refinement cost on every success. ",{"type":39,"tag":68,"props":1731,"children":1732},{},[1733],{"type":45,"value":1734},"The right default for sandbox-coding, research, and other tool-heavy loops.",{"type":39,"tag":614,"props":1736,"children":1737},{},[1738,1747,1760],{"type":39,"tag":636,"props":1739,"children":1740},{},[1741],{"type":39,"tag":76,"props":1742,"children":1744},{"className":1743},[],[1745],{"type":45,"value":1746},"\"high\"",{"type":39,"tag":636,"props":1748,"children":1749},{},[1750,1752,1758],{"type":45,"value":1751},"observes, then routes through ",{"type":39,"tag":76,"props":1753,"children":1755},{"className":1754},[],[1756],{"type":45,"value":1757},"decide_next_action",{"type":45,"value":1759}," which can trigger early goal achievement, full replan, or lightweight refinement after every step.",{"type":39,"tag":636,"props":1761,"children":1762},{},[1763],{"type":45,"value":1764},"The task changes shape based on intermediate findings, or you need maximum adaptiveness. Most LLM calls per run.",{"type":39,"tag":48,"props":1766,"children":1767},{},[1768,1770,1776,1778,1784,1786,1792],{"type":45,"value":1769},"Source: ",{"type":39,"tag":76,"props":1771,"children":1773},{"className":1772},[],[1774],{"type":45,"value":1775},"crewai\u002Fexperimental\u002Fagent_executor.py:450",{"type":45,"value":1777}," (",{"type":39,"tag":76,"props":1779,"children":1781},{"className":1780},[],[1782],{"type":45,"value":1783},"observe_step_result",{"type":45,"value":1785}," router) and ",{"type":39,"tag":76,"props":1787,"children":1789},{"className":1788},[],[1790],{"type":45,"value":1791},"crewai\u002Fagent\u002Fplanning_config.py",{"type":45,"value":443},{"type":39,"tag":1634,"props":1794,"children":1796},{"id":1795},"other-planningconfig-knobs",[1797,1799,1804],{"type":45,"value":1798},"Other ",{"type":39,"tag":76,"props":1800,"children":1802},{"className":1801},[],[1803],{"type":45,"value":1404},{"type":45,"value":1805}," knobs",{"type":39,"tag":199,"props":1807,"children":1809},{"className":201,"code":1808,"language":203,"meta":204,"style":204},"PlanningConfig(\n    reasoning_effort=\"medium\",\n    max_steps=20,            # cap on planned steps (default 20)\n    max_replans=3,           # max full re-plans before finalizing (default 3)\n    max_attempts=None,       # planning refinement attempts during plan generation\n    max_step_iterations=15,  # max LLM turns per step's StepExecutor (default 15)\n    step_timeout=None,       # wall-clock seconds per step; None = no cap\n    system_prompt=None,      # custom planning system prompt (uses default if None)\n    plan_prompt=None,        # custom initial-plan prompt; placeholders: {description}, {expected_output}, {tools}, {max_steps}\n    refine_prompt=None,      # custom refinement prompt\n    llm=None,                # separate LLM for planning (else uses agent.llm)\n)\n",[1810],{"type":39,"tag":76,"props":1811,"children":1812},{"__ignoreMap":204},[1813,1821,1829,1837,1845,1853,1861,1869,1877,1885,1893,1902],{"type":39,"tag":210,"props":1814,"children":1815},{"class":212,"line":213},[1816],{"type":39,"tag":210,"props":1817,"children":1818},{},[1819],{"type":45,"value":1820},"PlanningConfig(\n",{"type":39,"tag":210,"props":1822,"children":1823},{"class":212,"line":222},[1824],{"type":39,"tag":210,"props":1825,"children":1826},{},[1827],{"type":45,"value":1828},"    reasoning_effort=\"medium\",\n",{"type":39,"tag":210,"props":1830,"children":1831},{"class":212,"line":231},[1832],{"type":39,"tag":210,"props":1833,"children":1834},{},[1835],{"type":45,"value":1836},"    max_steps=20,            # cap on planned steps (default 20)\n",{"type":39,"tag":210,"props":1838,"children":1839},{"class":212,"line":343},[1840],{"type":39,"tag":210,"props":1841,"children":1842},{},[1843],{"type":45,"value":1844},"    max_replans=3,           # max full re-plans before finalizing (default 3)\n",{"type":39,"tag":210,"props":1846,"children":1847},{"class":212,"line":352},[1848],{"type":39,"tag":210,"props":1849,"children":1850},{},[1851],{"type":45,"value":1852},"    max_attempts=None,       # planning refinement attempts during plan generation\n",{"type":39,"tag":210,"props":1854,"children":1855},{"class":212,"line":361},[1856],{"type":39,"tag":210,"props":1857,"children":1858},{},[1859],{"type":45,"value":1860},"    max_step_iterations=15,  # max LLM turns per step's StepExecutor (default 15)\n",{"type":39,"tag":210,"props":1862,"children":1863},{"class":212,"line":370},[1864],{"type":39,"tag":210,"props":1865,"children":1866},{},[1867],{"type":45,"value":1868},"    step_timeout=None,       # wall-clock seconds per step; None = no cap\n",{"type":39,"tag":210,"props":1870,"children":1871},{"class":212,"line":514},[1872],{"type":39,"tag":210,"props":1873,"children":1874},{},[1875],{"type":45,"value":1876},"    system_prompt=None,      # custom planning system prompt (uses default if None)\n",{"type":39,"tag":210,"props":1878,"children":1879},{"class":212,"line":27},[1880],{"type":39,"tag":210,"props":1881,"children":1882},{},[1883],{"type":45,"value":1884},"    plan_prompt=None,        # custom initial-plan prompt; placeholders: {description}, {expected_output}, {tools}, {max_steps}\n",{"type":39,"tag":210,"props":1886,"children":1887},{"class":212,"line":1627},[1888],{"type":39,"tag":210,"props":1889,"children":1890},{},[1891],{"type":45,"value":1892},"    refine_prompt=None,      # custom refinement prompt\n",{"type":39,"tag":210,"props":1894,"children":1896},{"class":212,"line":1895},11,[1897],{"type":39,"tag":210,"props":1898,"children":1899},{},[1900],{"type":45,"value":1901},"    llm=None,                # separate LLM for planning (else uses agent.llm)\n",{"type":39,"tag":210,"props":1903,"children":1905},{"class":212,"line":1904},12,[1906],{"type":39,"tag":210,"props":1907,"children":1908},{},[1909],{"type":45,"value":358},{"type":39,"tag":48,"props":1911,"children":1912},{},[1913,1914,1920,1922,1928],{"type":45,"value":402},{"type":39,"tag":76,"props":1915,"children":1917},{"className":1916},[],[1918],{"type":45,"value":1919},"llm=\"anthropic\u002Fclaude-haiku-4-5\"",{"type":45,"value":1921}," (cheap) for the planner while keeping ",{"type":39,"tag":76,"props":1923,"children":1925},{"className":1924},[],[1926],{"type":45,"value":1927},"agent.llm=\"anthropic\u002Fclaude-opus-4-7\"",{"type":45,"value":1929}," (strong) for execution — common cost optimization.",{"type":39,"tag":1634,"props":1931,"children":1933},{"id":1932},"when-to-enable",[1934],{"type":45,"value":1935},"When to enable",{"type":39,"tag":104,"props":1937,"children":1938},{},[1939,1949],{"type":39,"tag":108,"props":1940,"children":1941},{},[1942,1947],{"type":39,"tag":68,"props":1943,"children":1944},{},[1945],{"type":45,"value":1946},"Enable",{"type":45,"value":1948}," for autonomous loops where the agent picks its own steps and you want failure recovery (e.g. coding agent that writes → runs → patches; research agent that searches → scrapes → revises).",{"type":39,"tag":108,"props":1950,"children":1951},{},[1952,1957],{"type":39,"tag":68,"props":1953,"children":1954},{},[1955],{"type":45,"value":1956},"Skip",{"type":45,"value":1958}," for single-tool, single-purpose calls (e.g. \"summarize this string\", \"post this Slack DM\") — observation overhead doesn't pay off.",{"type":39,"tag":1634,"props":1960,"children":1962},{"id":1961},"cost-shape",[1963],{"type":45,"value":1964},"Cost shape",{"type":39,"tag":48,"props":1966,"children":1967},{},[1968,1970,1975,1977,1982,1984,1989,1991,1996],{"type":45,"value":1969},"Every step gets a ",{"type":39,"tag":76,"props":1971,"children":1973},{"className":1972},[],[1974],{"type":45,"value":1507},{"type":45,"value":1976}," LLM call (~1 extra call per step). On ",{"type":39,"tag":76,"props":1978,"children":1980},{"className":1979},[],[1981],{"type":45,"value":1710},{"type":45,"value":1983}," a failed step adds a replan call. On ",{"type":39,"tag":76,"props":1985,"children":1987},{"className":1986},[],[1988],{"type":45,"value":1746},{"type":45,"value":1990}," every step adds a ",{"type":39,"tag":76,"props":1992,"children":1994},{"className":1993},[],[1995],{"type":45,"value":1757},{"type":45,"value":1997}," call too. For an N-step plan, expect roughly:",{"type":39,"tag":104,"props":1999,"children":2000},{},[2001,2017,2028],{"type":39,"tag":108,"props":2002,"children":2003},{},[2004,2010,2012],{"type":39,"tag":76,"props":2005,"children":2007},{"className":2006},[],[2008],{"type":45,"value":2009},"low",{"type":45,"value":2011},": N execution + N observation = ",{"type":39,"tag":68,"props":2013,"children":2014},{},[2015],{"type":45,"value":2016},"2N calls",{"type":39,"tag":108,"props":2018,"children":2019},{},[2020,2026],{"type":39,"tag":76,"props":2021,"children":2023},{"className":2022},[],[2024],{"type":45,"value":2025},"medium",{"type":45,"value":2027},": 2N + (failures × 1 replan)",{"type":39,"tag":108,"props":2029,"children":2030},{},[2031,2037],{"type":39,"tag":76,"props":2032,"children":2034},{"className":2033},[],[2035],{"type":45,"value":2036},"high",{"type":45,"value":2038},": ~3N + replans\u002Frefines",{"type":39,"tag":48,"props":2040,"children":2041},{},[2042,2044,2049],{"type":45,"value":2043},"Material at scale — measure before defaulting ",{"type":39,"tag":76,"props":2045,"children":2047},{"className":2046},[],[2048],{"type":45,"value":2036},{"type":45,"value":2050}," for everything.",{"type":39,"tag":1634,"props":2052,"children":2054},{"id":2053},"custom-plan_prompt",[2055,2057],{"type":45,"value":2056},"Custom ",{"type":39,"tag":76,"props":2058,"children":2060},{"className":2059},[],[2061],{"type":45,"value":2062},"plan_prompt",{"type":39,"tag":48,"props":2064,"children":2065},{},[2066,2068,2073,2075,2081,2083,2089,2090,2096,2097,2103,2105,2110,2112,2118,2120,2126],{"type":45,"value":2067},"If you supply ",{"type":39,"tag":76,"props":2069,"children":2071},{"className":2070},[],[2072],{"type":45,"value":2062},{"type":45,"value":2074},", include the placeholders the planner template expects: ",{"type":39,"tag":76,"props":2076,"children":2078},{"className":2077},[],[2079],{"type":45,"value":2080},"{description}",{"type":45,"value":2082},", ",{"type":39,"tag":76,"props":2084,"children":2086},{"className":2085},[],[2087],{"type":45,"value":2088},"{expected_output}",{"type":45,"value":2082},{"type":39,"tag":76,"props":2091,"children":2093},{"className":2092},[],[2094],{"type":45,"value":2095},"{tools}",{"type":45,"value":2082},{"type":39,"tag":76,"props":2098,"children":2100},{"className":2099},[],[2101],{"type":45,"value":2102},"{max_steps}",{"type":45,"value":2104},". The planner LLM gets these interpolated. Keep custom prompts focused on ",{"type":39,"tag":535,"props":2106,"children":2107},{},[2108],{"type":45,"value":2109},"project-specific",{"type":45,"value":2111}," rules; let ",{"type":39,"tag":76,"props":2113,"children":2115},{"className":2114},[],[2116],{"type":45,"value":2117},"description",{"type":45,"value":2119},"\u002F",{"type":39,"tag":76,"props":2121,"children":2123},{"className":2122},[],[2124],{"type":45,"value":2125},"tools",{"type":45,"value":2127}," (auto-injected) carry the dynamic content.",{"type":39,"tag":187,"props":2129,"children":2131},{"id":2130},"code-execution",[2132],{"type":45,"value":2133},"Code Execution",{"type":39,"tag":199,"props":2135,"children":2137},{"className":201,"code":2136,"language":203,"meta":204,"style":204},"Agent(\n    ...,\n    allow_code_execution=True,        # Enable code execution (default: False)\n    code_execution_mode=\"safe\",       # \"safe\" (Docker) or \"unsafe\" (direct) — default: \"safe\"\n)\n",[2138],{"type":39,"tag":76,"props":2139,"children":2140},{"__ignoreMap":204},[2141,2148,2155,2163,2171],{"type":39,"tag":210,"props":2142,"children":2143},{"class":212,"line":213},[2144],{"type":39,"tag":210,"props":2145,"children":2146},{},[2147],{"type":45,"value":961},{"type":39,"tag":210,"props":2149,"children":2150},{"class":212,"line":222},[2151],{"type":39,"tag":210,"props":2152,"children":2153},{},[2154],{"type":45,"value":1036},{"type":39,"tag":210,"props":2156,"children":2157},{"class":212,"line":231},[2158],{"type":39,"tag":210,"props":2159,"children":2160},{},[2161],{"type":45,"value":2162},"    allow_code_execution=True,        # Enable code execution (default: False)\n",{"type":39,"tag":210,"props":2164,"children":2165},{"class":212,"line":343},[2166],{"type":39,"tag":210,"props":2167,"children":2168},{},[2169],{"type":45,"value":2170},"    code_execution_mode=\"safe\",       # \"safe\" (Docker) or \"unsafe\" (direct) — default: \"safe\"\n",{"type":39,"tag":210,"props":2172,"children":2173},{"class":212,"line":352},[2174],{"type":39,"tag":210,"props":2175,"children":2176},{},[2177],{"type":45,"value":358},{"type":39,"tag":104,"props":2179,"children":2180},{},[2181,2192],{"type":39,"tag":108,"props":2182,"children":2183},{},[2184,2190],{"type":39,"tag":76,"props":2185,"children":2187},{"className":2186},[],[2188],{"type":45,"value":2189},"\"safe\"",{"type":45,"value":2191}," requires Docker installed and running — executes in a container",{"type":39,"tag":108,"props":2193,"children":2194},{},[2195,2201],{"type":39,"tag":76,"props":2196,"children":2198},{"className":2197},[],[2199],{"type":45,"value":2200},"\"unsafe\"",{"type":45,"value":2202}," runs code directly on the host — only use in controlled environments",{"type":39,"tag":187,"props":2204,"children":2206},{"id":2205},"context-window-management",[2207],{"type":45,"value":2208},"Context Window Management",{"type":39,"tag":199,"props":2210,"children":2212},{"className":201,"code":2211,"language":203,"meta":204,"style":204},"Agent(\n    ...,\n    respect_context_window=True,      # Auto-summarize to stay within limits (default: True)\n)\n",[2213],{"type":39,"tag":76,"props":2214,"children":2215},{"__ignoreMap":204},[2216,2223,2230,2238],{"type":39,"tag":210,"props":2217,"children":2218},{"class":212,"line":213},[2219],{"type":39,"tag":210,"props":2220,"children":2221},{},[2222],{"type":45,"value":961},{"type":39,"tag":210,"props":2224,"children":2225},{"class":212,"line":222},[2226],{"type":39,"tag":210,"props":2227,"children":2228},{},[2229],{"type":45,"value":1036},{"type":39,"tag":210,"props":2231,"children":2232},{"class":212,"line":231},[2233],{"type":39,"tag":210,"props":2234,"children":2235},{},[2236],{"type":45,"value":2237},"    respect_context_window=True,      # Auto-summarize to stay within limits (default: True)\n",{"type":39,"tag":210,"props":2239,"children":2240},{"class":212,"line":343},[2241],{"type":39,"tag":210,"props":2242,"children":2243},{},[2244],{"type":45,"value":358},{"type":39,"tag":48,"props":2246,"children":2247},{},[2248,2250,2256,2258,2264],{"type":45,"value":2249},"When ",{"type":39,"tag":76,"props":2251,"children":2253},{"className":2252},[],[2254],{"type":45,"value":2255},"True",{"type":45,"value":2257},", the agent automatically summarizes prior context if it approaches the LLM's token limit. When ",{"type":39,"tag":76,"props":2259,"children":2261},{"className":2260},[],[2262],{"type":45,"value":2263},"False",{"type":45,"value":2265},", execution stops with an error on overflow.",{"type":39,"tag":187,"props":2267,"children":2269},{"id":2268},"date-injection",[2270],{"type":45,"value":2271},"Date Injection",{"type":39,"tag":199,"props":2273,"children":2275},{"className":201,"code":2274,"language":203,"meta":204,"style":204},"Agent(\n    ...,\n    inject_date=True,                 # Add current date to task context (default: False)\n    date_format=\"%Y-%m-%d\",           # Date format (default: \"%Y-%m-%d\")\n)\n",[2276],{"type":39,"tag":76,"props":2277,"children":2278},{"__ignoreMap":204},[2279,2286,2293,2301,2309],{"type":39,"tag":210,"props":2280,"children":2281},{"class":212,"line":213},[2282],{"type":39,"tag":210,"props":2283,"children":2284},{},[2285],{"type":45,"value":961},{"type":39,"tag":210,"props":2287,"children":2288},{"class":212,"line":222},[2289],{"type":39,"tag":210,"props":2290,"children":2291},{},[2292],{"type":45,"value":1036},{"type":39,"tag":210,"props":2294,"children":2295},{"class":212,"line":231},[2296],{"type":39,"tag":210,"props":2297,"children":2298},{},[2299],{"type":45,"value":2300},"    inject_date=True,                 # Add current date to task context (default: False)\n",{"type":39,"tag":210,"props":2302,"children":2303},{"class":212,"line":343},[2304],{"type":39,"tag":210,"props":2305,"children":2306},{},[2307],{"type":45,"value":2308},"    date_format=\"%Y-%m-%d\",           # Date format (default: \"%Y-%m-%d\")\n",{"type":39,"tag":210,"props":2310,"children":2311},{"class":212,"line":352},[2312],{"type":39,"tag":210,"props":2313,"children":2314},{},[2315],{"type":45,"value":358},{"type":39,"tag":48,"props":2317,"children":2318},{},[2319],{"type":45,"value":2320},"Enable for time-sensitive tasks (research, news analysis, scheduling).",{"type":39,"tag":187,"props":2322,"children":2324},{"id":2323},"agent-guardrails",[2325],{"type":45,"value":2326},"Agent Guardrails",{"type":39,"tag":199,"props":2328,"children":2330},{"className":201,"code":2329,"language":203,"meta":204,"style":204},"def validate_no_pii(result) -> tuple[bool, Any]:\n    \"\"\"Reject output containing PII.\"\"\"\n    if contains_pii(result.raw):\n        return (False, \"Output contains PII. Remove all personal information and try again.\")\n    return (True, result)\n\nAgent(\n    ...,\n    guardrail=validate_no_pii,\n    guardrail_max_retries=3,          # default: 3\n)\n",[2331],{"type":39,"tag":76,"props":2332,"children":2333},{"__ignoreMap":204},[2334,2342,2350,2358,2366,2374,2381,2388,2395,2403,2411],{"type":39,"tag":210,"props":2335,"children":2336},{"class":212,"line":213},[2337],{"type":39,"tag":210,"props":2338,"children":2339},{},[2340],{"type":45,"value":2341},"def validate_no_pii(result) -> tuple[bool, Any]:\n",{"type":39,"tag":210,"props":2343,"children":2344},{"class":212,"line":222},[2345],{"type":39,"tag":210,"props":2346,"children":2347},{},[2348],{"type":45,"value":2349},"    \"\"\"Reject output containing PII.\"\"\"\n",{"type":39,"tag":210,"props":2351,"children":2352},{"class":212,"line":231},[2353],{"type":39,"tag":210,"props":2354,"children":2355},{},[2356],{"type":45,"value":2357},"    if contains_pii(result.raw):\n",{"type":39,"tag":210,"props":2359,"children":2360},{"class":212,"line":343},[2361],{"type":39,"tag":210,"props":2362,"children":2363},{},[2364],{"type":45,"value":2365},"        return (False, \"Output contains PII. Remove all personal information and try again.\")\n",{"type":39,"tag":210,"props":2367,"children":2368},{"class":212,"line":352},[2369],{"type":39,"tag":210,"props":2370,"children":2371},{},[2372],{"type":45,"value":2373},"    return (True, result)\n",{"type":39,"tag":210,"props":2375,"children":2376},{"class":212,"line":361},[2377],{"type":39,"tag":210,"props":2378,"children":2379},{"emptyLinePlaceholder":1143},[2380],{"type":45,"value":1146},{"type":39,"tag":210,"props":2382,"children":2383},{"class":212,"line":370},[2384],{"type":39,"tag":210,"props":2385,"children":2386},{},[2387],{"type":45,"value":961},{"type":39,"tag":210,"props":2389,"children":2390},{"class":212,"line":514},[2391],{"type":39,"tag":210,"props":2392,"children":2393},{},[2394],{"type":45,"value":1036},{"type":39,"tag":210,"props":2396,"children":2397},{"class":212,"line":27},[2398],{"type":39,"tag":210,"props":2399,"children":2400},{},[2401],{"type":45,"value":2402},"    guardrail=validate_no_pii,\n",{"type":39,"tag":210,"props":2404,"children":2405},{"class":212,"line":1627},[2406],{"type":39,"tag":210,"props":2407,"children":2408},{},[2409],{"type":45,"value":2410},"    guardrail_max_retries=3,          # default: 3\n",{"type":39,"tag":210,"props":2412,"children":2413},{"class":212,"line":1895},[2414],{"type":39,"tag":210,"props":2415,"children":2416},{},[2417],{"type":45,"value":358},{"type":39,"tag":48,"props":2419,"children":2420},{},[2421,2423,2429],{"type":45,"value":2422},"Agent guardrails validate every output the agent produces. The agent retries on failure up to ",{"type":39,"tag":76,"props":2424,"children":2426},{"className":2425},[],[2427],{"type":45,"value":2428},"guardrail_max_retries",{"type":45,"value":443},{"type":39,"tag":187,"props":2431,"children":2433},{"id":2432},"knowledge-sources",[2434],{"type":45,"value":2435},"Knowledge Sources",{"type":39,"tag":199,"props":2437,"children":2439},{"className":201,"code":2438,"language":203,"meta":204,"style":204},"from crewai.knowledge.source.text_file_knowledge_source import TextFileKnowledgeSource\n\nAgent(\n    ...,\n    knowledge_sources=[\n        TextFileKnowledgeSource(file_paths=[\"company_handbook.txt\"]),\n    ],\n    embedder={\n        \"provider\": \"openai\",\n        \"config\": {\"model\": \"text-embedding-3-small\"},\n    },\n)\n",[2440],{"type":39,"tag":76,"props":2441,"children":2442},{"__ignoreMap":204},[2443,2451,2458,2465,2472,2480,2488,2496,2504,2512,2520,2528],{"type":39,"tag":210,"props":2444,"children":2445},{"class":212,"line":213},[2446],{"type":39,"tag":210,"props":2447,"children":2448},{},[2449],{"type":45,"value":2450},"from crewai.knowledge.source.text_file_knowledge_source import TextFileKnowledgeSource\n",{"type":39,"tag":210,"props":2452,"children":2453},{"class":212,"line":222},[2454],{"type":39,"tag":210,"props":2455,"children":2456},{"emptyLinePlaceholder":1143},[2457],{"type":45,"value":1146},{"type":39,"tag":210,"props":2459,"children":2460},{"class":212,"line":231},[2461],{"type":39,"tag":210,"props":2462,"children":2463},{},[2464],{"type":45,"value":961},{"type":39,"tag":210,"props":2466,"children":2467},{"class":212,"line":343},[2468],{"type":39,"tag":210,"props":2469,"children":2470},{},[2471],{"type":45,"value":1036},{"type":39,"tag":210,"props":2473,"children":2474},{"class":212,"line":352},[2475],{"type":39,"tag":210,"props":2476,"children":2477},{},[2478],{"type":45,"value":2479},"    knowledge_sources=[\n",{"type":39,"tag":210,"props":2481,"children":2482},{"class":212,"line":361},[2483],{"type":39,"tag":210,"props":2484,"children":2485},{},[2486],{"type":45,"value":2487},"        TextFileKnowledgeSource(file_paths=[\"company_handbook.txt\"]),\n",{"type":39,"tag":210,"props":2489,"children":2490},{"class":212,"line":370},[2491],{"type":39,"tag":210,"props":2492,"children":2493},{},[2494],{"type":45,"value":2495},"    ],\n",{"type":39,"tag":210,"props":2497,"children":2498},{"class":212,"line":514},[2499],{"type":39,"tag":210,"props":2500,"children":2501},{},[2502],{"type":45,"value":2503},"    embedder={\n",{"type":39,"tag":210,"props":2505,"children":2506},{"class":212,"line":27},[2507],{"type":39,"tag":210,"props":2508,"children":2509},{},[2510],{"type":45,"value":2511},"        \"provider\": \"openai\",\n",{"type":39,"tag":210,"props":2513,"children":2514},{"class":212,"line":1627},[2515],{"type":39,"tag":210,"props":2516,"children":2517},{},[2518],{"type":45,"value":2519},"        \"config\": {\"model\": \"text-embedding-3-small\"},\n",{"type":39,"tag":210,"props":2521,"children":2522},{"class":212,"line":1895},[2523],{"type":39,"tag":210,"props":2524,"children":2525},{},[2526],{"type":45,"value":2527},"    },\n",{"type":39,"tag":210,"props":2529,"children":2530},{"class":212,"line":1904},[2531],{"type":39,"tag":210,"props":2532,"children":2533},{},[2534],{"type":45,"value":358},{"type":39,"tag":48,"props":2536,"children":2537},{},[2538],{"type":45,"value":2539},"Knowledge sources give agents access to domain-specific data via RAG. Use when agents need to reference large documents, policies, or datasets.",{"type":39,"tag":54,"props":2541,"children":2542},{},[],{"type":39,"tag":58,"props":2544,"children":2546},{"id":2545},"_3-yaml-configuration-recommended",[2547],{"type":45,"value":2548},"3. YAML Configuration (Recommended)",{"type":39,"tag":48,"props":2550,"children":2551},{},[2552,2554,2560],{"type":45,"value":2553},"Define agents in ",{"type":39,"tag":76,"props":2555,"children":2557},{"className":2556},[],[2558],{"type":45,"value":2559},"agents.yaml",{"type":45,"value":2561}," for clean separation of config and code:",{"type":39,"tag":199,"props":2563,"children":2565},{"className":814,"code":2564,"language":816,"meta":204,"style":204},"researcher:\n  role: >\n    {topic} Senior Data Researcher\n  goal: >\n    Uncover cutting-edge developments in {topic}\n    with supporting evidence and source citations\n  backstory: >\n    You're a seasoned researcher with 15 years of experience.\n    Known for finding obscure but relevant sources and\n    synthesizing complex findings into clear insights.\n    You always cite your sources and flag uncertainty.\n  # Optional overrides (uncomment as needed):\n  # llm: openai\u002Fgpt-4o\n  # max_iter: 15\n  # max_rpm: 10\n  # allow_delegation: false\n  # verbose: true\n",[2566],{"type":39,"tag":76,"props":2567,"children":2568},{"__ignoreMap":204},[2569,2582,2598,2606,2622,2630,2638,2654,2662,2670,2678,2686,2695,2704,2713,2722,2731],{"type":39,"tag":210,"props":2570,"children":2571},{"class":212,"line":213},[2572,2577],{"type":39,"tag":210,"props":2573,"children":2574},{"style":826},[2575],{"type":45,"value":2576},"researcher",{"type":39,"tag":210,"props":2578,"children":2579},{"style":832},[2580],{"type":45,"value":2581},":\n",{"type":39,"tag":210,"props":2583,"children":2584},{"class":212,"line":222},[2585,2590,2594],{"type":39,"tag":210,"props":2586,"children":2587},{"style":826},[2588],{"type":45,"value":2589},"  role",{"type":39,"tag":210,"props":2591,"children":2592},{"style":832},[2593],{"type":45,"value":835},{"type":39,"tag":210,"props":2595,"children":2596},{"style":838},[2597],{"type":45,"value":841},{"type":39,"tag":210,"props":2599,"children":2600},{"class":212,"line":231},[2601],{"type":39,"tag":210,"props":2602,"children":2603},{"style":847},[2604],{"type":45,"value":2605},"    {topic} Senior Data Researcher\n",{"type":39,"tag":210,"props":2607,"children":2608},{"class":212,"line":343},[2609,2614,2618],{"type":39,"tag":210,"props":2610,"children":2611},{"style":826},[2612],{"type":45,"value":2613},"  goal",{"type":39,"tag":210,"props":2615,"children":2616},{"style":832},[2617],{"type":45,"value":835},{"type":39,"tag":210,"props":2619,"children":2620},{"style":838},[2621],{"type":45,"value":841},{"type":39,"tag":210,"props":2623,"children":2624},{"class":212,"line":352},[2625],{"type":39,"tag":210,"props":2626,"children":2627},{"style":847},[2628],{"type":45,"value":2629},"    Uncover cutting-edge developments in {topic}\n",{"type":39,"tag":210,"props":2631,"children":2632},{"class":212,"line":361},[2633],{"type":39,"tag":210,"props":2634,"children":2635},{"style":847},[2636],{"type":45,"value":2637},"    with supporting evidence and source citations\n",{"type":39,"tag":210,"props":2639,"children":2640},{"class":212,"line":370},[2641,2646,2650],{"type":39,"tag":210,"props":2642,"children":2643},{"style":826},[2644],{"type":45,"value":2645},"  backstory",{"type":39,"tag":210,"props":2647,"children":2648},{"style":832},[2649],{"type":45,"value":835},{"type":39,"tag":210,"props":2651,"children":2652},{"style":838},[2653],{"type":45,"value":841},{"type":39,"tag":210,"props":2655,"children":2656},{"class":212,"line":514},[2657],{"type":39,"tag":210,"props":2658,"children":2659},{"style":847},[2660],{"type":45,"value":2661},"    You're a seasoned researcher with 15 years of experience.\n",{"type":39,"tag":210,"props":2663,"children":2664},{"class":212,"line":27},[2665],{"type":39,"tag":210,"props":2666,"children":2667},{"style":847},[2668],{"type":45,"value":2669},"    Known for finding obscure but relevant sources and\n",{"type":39,"tag":210,"props":2671,"children":2672},{"class":212,"line":1627},[2673],{"type":39,"tag":210,"props":2674,"children":2675},{"style":847},[2676],{"type":45,"value":2677},"    synthesizing complex findings into clear insights.\n",{"type":39,"tag":210,"props":2679,"children":2680},{"class":212,"line":1895},[2681],{"type":39,"tag":210,"props":2682,"children":2683},{"style":847},[2684],{"type":45,"value":2685},"    You always cite your sources and flag uncertainty.\n",{"type":39,"tag":210,"props":2687,"children":2688},{"class":212,"line":1904},[2689],{"type":39,"tag":210,"props":2690,"children":2692},{"style":2691},"--shiki-light:#90A4AE;--shiki-light-font-style:italic;--shiki-default:#546E7A;--shiki-default-font-style:italic;--shiki-dark:#676E95;--shiki-dark-font-style:italic",[2693],{"type":45,"value":2694},"  # Optional overrides (uncomment as needed):\n",{"type":39,"tag":210,"props":2696,"children":2698},{"class":212,"line":2697},13,[2699],{"type":39,"tag":210,"props":2700,"children":2701},{"style":2691},[2702],{"type":45,"value":2703},"  # llm: openai\u002Fgpt-4o\n",{"type":39,"tag":210,"props":2705,"children":2707},{"class":212,"line":2706},14,[2708],{"type":39,"tag":210,"props":2709,"children":2710},{"style":2691},[2711],{"type":45,"value":2712},"  # max_iter: 15\n",{"type":39,"tag":210,"props":2714,"children":2716},{"class":212,"line":2715},15,[2717],{"type":39,"tag":210,"props":2718,"children":2719},{"style":2691},[2720],{"type":45,"value":2721},"  # max_rpm: 10\n",{"type":39,"tag":210,"props":2723,"children":2725},{"class":212,"line":2724},16,[2726],{"type":39,"tag":210,"props":2727,"children":2728},{"style":2691},[2729],{"type":45,"value":2730},"  # allow_delegation: false\n",{"type":39,"tag":210,"props":2732,"children":2734},{"class":212,"line":2733},17,[2735],{"type":39,"tag":210,"props":2736,"children":2737},{"style":2691},[2738],{"type":45,"value":2739},"  # verbose: true\n",{"type":39,"tag":48,"props":2741,"children":2742},{},[2743,2745,2751],{"type":45,"value":2744},"Then wire in ",{"type":39,"tag":76,"props":2746,"children":2748},{"className":2747},[],[2749],{"type":45,"value":2750},"crew.py",{"type":45,"value":835},{"type":39,"tag":199,"props":2753,"children":2755},{"className":201,"code":2754,"language":203,"meta":204,"style":204},"@CrewBase\nclass MyCrew:\n    agents_config = \"config\u002Fagents.yaml\"\n    tasks_config = \"config\u002Ftasks.yaml\"\n\n    @agent\n    def researcher(self) -> Agent:\n        return Agent(\n            config=self.agents_config[\"researcher\"],\n            tools=[SerperDevTool()],\n        )\n",[2756],{"type":39,"tag":76,"props":2757,"children":2758},{"__ignoreMap":204},[2759,2767,2775,2783,2791,2798,2806,2814,2822,2830,2838],{"type":39,"tag":210,"props":2760,"children":2761},{"class":212,"line":213},[2762],{"type":39,"tag":210,"props":2763,"children":2764},{},[2765],{"type":45,"value":2766},"@CrewBase\n",{"type":39,"tag":210,"props":2768,"children":2769},{"class":212,"line":222},[2770],{"type":39,"tag":210,"props":2771,"children":2772},{},[2773],{"type":45,"value":2774},"class MyCrew:\n",{"type":39,"tag":210,"props":2776,"children":2777},{"class":212,"line":231},[2778],{"type":39,"tag":210,"props":2779,"children":2780},{},[2781],{"type":45,"value":2782},"    agents_config = \"config\u002Fagents.yaml\"\n",{"type":39,"tag":210,"props":2784,"children":2785},{"class":212,"line":343},[2786],{"type":39,"tag":210,"props":2787,"children":2788},{},[2789],{"type":45,"value":2790},"    tasks_config = \"config\u002Ftasks.yaml\"\n",{"type":39,"tag":210,"props":2792,"children":2793},{"class":212,"line":352},[2794],{"type":39,"tag":210,"props":2795,"children":2796},{"emptyLinePlaceholder":1143},[2797],{"type":45,"value":1146},{"type":39,"tag":210,"props":2799,"children":2800},{"class":212,"line":361},[2801],{"type":39,"tag":210,"props":2802,"children":2803},{},[2804],{"type":45,"value":2805},"    @agent\n",{"type":39,"tag":210,"props":2807,"children":2808},{"class":212,"line":370},[2809],{"type":39,"tag":210,"props":2810,"children":2811},{},[2812],{"type":45,"value":2813},"    def researcher(self) -> Agent:\n",{"type":39,"tag":210,"props":2815,"children":2816},{"class":212,"line":514},[2817],{"type":39,"tag":210,"props":2818,"children":2819},{},[2820],{"type":45,"value":2821},"        return Agent(\n",{"type":39,"tag":210,"props":2823,"children":2824},{"class":212,"line":27},[2825],{"type":39,"tag":210,"props":2826,"children":2827},{},[2828],{"type":45,"value":2829},"            config=self.agents_config[\"researcher\"],\n",{"type":39,"tag":210,"props":2831,"children":2832},{"class":212,"line":1627},[2833],{"type":39,"tag":210,"props":2834,"children":2835},{},[2836],{"type":45,"value":2837},"            tools=[SerperDevTool()],\n",{"type":39,"tag":210,"props":2839,"children":2840},{"class":212,"line":1895},[2841],{"type":39,"tag":210,"props":2842,"children":2843},{},[2844],{"type":45,"value":2845},"        )\n",{"type":39,"tag":48,"props":2847,"children":2848},{},[2849,2854,2856,2862,2864,2870,2872,2878],{"type":39,"tag":68,"props":2850,"children":2851},{},[2852],{"type":45,"value":2853},"Critical:",{"type":45,"value":2855}," The method name (",{"type":39,"tag":76,"props":2857,"children":2859},{"className":2858},[],[2860],{"type":45,"value":2861},"def researcher",{"type":45,"value":2863},") must match the YAML key (",{"type":39,"tag":76,"props":2865,"children":2867},{"className":2866},[],[2868],{"type":45,"value":2869},"researcher:",{"type":45,"value":2871},"). Mismatch causes ",{"type":39,"tag":76,"props":2873,"children":2875},{"className":2874},[],[2876],{"type":45,"value":2877},"KeyError",{"type":45,"value":443},{"type":39,"tag":54,"props":2880,"children":2881},{},[],{"type":39,"tag":58,"props":2883,"children":2885},{"id":2884},"_4-agentkickoff-direct-agent-execution",[2886],{"type":45,"value":2887},"4. Agent.kickoff() — Direct Agent Execution",{"type":39,"tag":48,"props":2889,"children":2890},{},[2891,2892,2897],{"type":45,"value":402},{"type":39,"tag":76,"props":2893,"children":2895},{"className":2894},[],[2896],{"type":45,"value":408},{"type":45,"value":2898}," when you need one agent with tools and reasoning, without crew overhead. This is the most common pattern in Flows.",{"type":39,"tag":187,"props":2900,"children":2902},{"id":2901},"basic-usage",[2903],{"type":45,"value":2904},"Basic Usage",{"type":39,"tag":199,"props":2906,"children":2908},{"className":201,"code":2907,"language":203,"meta":204,"style":204},"from crewai import Agent\nfrom crewai_tools import SerperDevTool\n\nresearcher = Agent(\n    role=\"Senior Research Analyst\",\n    goal=\"Find comprehensive, factual information with source citations\",\n    backstory=\"Expert researcher known for thorough, evidence-based analysis.\",\n    tools=[SerperDevTool()],\n    llm=\"openai\u002Fgpt-4o\",\n)\n\n# Pass a string prompt — the agent reasons, uses tools, and returns a result\nresult = researcher.kickoff(\"What are the latest developments in quantum computing?\")\nprint(result.raw)             # str — the agent's full response\nprint(result.usage_metrics)   # token usage stats\n",[2909],{"type":39,"tag":76,"props":2910,"children":2911},{"__ignoreMap":204},[2912,2919,2927,2934,2942,2950,2958,2966,2974,2982,2989,2996,3004,3012,3020],{"type":39,"tag":210,"props":2913,"children":2914},{"class":212,"line":213},[2915],{"type":39,"tag":210,"props":2916,"children":2917},{},[2918],{"type":45,"value":1561},{"type":39,"tag":210,"props":2920,"children":2921},{"class":212,"line":222},[2922],{"type":39,"tag":210,"props":2923,"children":2924},{},[2925],{"type":45,"value":2926},"from crewai_tools import SerperDevTool\n",{"type":39,"tag":210,"props":2928,"children":2929},{"class":212,"line":231},[2930],{"type":39,"tag":210,"props":2931,"children":2932},{"emptyLinePlaceholder":1143},[2933],{"type":45,"value":1146},{"type":39,"tag":210,"props":2935,"children":2936},{"class":212,"line":343},[2937],{"type":39,"tag":210,"props":2938,"children":2939},{},[2940],{"type":45,"value":2941},"researcher = Agent(\n",{"type":39,"tag":210,"props":2943,"children":2944},{"class":212,"line":352},[2945],{"type":39,"tag":210,"props":2946,"children":2947},{},[2948],{"type":45,"value":2949},"    role=\"Senior Research Analyst\",\n",{"type":39,"tag":210,"props":2951,"children":2952},{"class":212,"line":361},[2953],{"type":39,"tag":210,"props":2954,"children":2955},{},[2956],{"type":45,"value":2957},"    goal=\"Find comprehensive, factual information with source citations\",\n",{"type":39,"tag":210,"props":2959,"children":2960},{"class":212,"line":370},[2961],{"type":39,"tag":210,"props":2962,"children":2963},{},[2964],{"type":45,"value":2965},"    backstory=\"Expert researcher known for thorough, evidence-based analysis.\",\n",{"type":39,"tag":210,"props":2967,"children":2968},{"class":212,"line":514},[2969],{"type":39,"tag":210,"props":2970,"children":2971},{},[2972],{"type":45,"value":2973},"    tools=[SerperDevTool()],\n",{"type":39,"tag":210,"props":2975,"children":2976},{"class":212,"line":27},[2977],{"type":39,"tag":210,"props":2978,"children":2979},{},[2980],{"type":45,"value":2981},"    llm=\"openai\u002Fgpt-4o\",\n",{"type":39,"tag":210,"props":2983,"children":2984},{"class":212,"line":1627},[2985],{"type":39,"tag":210,"props":2986,"children":2987},{},[2988],{"type":45,"value":358},{"type":39,"tag":210,"props":2990,"children":2991},{"class":212,"line":1895},[2992],{"type":39,"tag":210,"props":2993,"children":2994},{"emptyLinePlaceholder":1143},[2995],{"type":45,"value":1146},{"type":39,"tag":210,"props":2997,"children":2998},{"class":212,"line":1904},[2999],{"type":39,"tag":210,"props":3000,"children":3001},{},[3002],{"type":45,"value":3003},"# Pass a string prompt — the agent reasons, uses tools, and returns a result\n",{"type":39,"tag":210,"props":3005,"children":3006},{"class":212,"line":2697},[3007],{"type":39,"tag":210,"props":3008,"children":3009},{},[3010],{"type":45,"value":3011},"result = researcher.kickoff(\"What are the latest developments in quantum computing?\")\n",{"type":39,"tag":210,"props":3013,"children":3014},{"class":212,"line":2706},[3015],{"type":39,"tag":210,"props":3016,"children":3017},{},[3018],{"type":45,"value":3019},"print(result.raw)             # str — the agent's full response\n",{"type":39,"tag":210,"props":3021,"children":3022},{"class":212,"line":2715},[3023],{"type":39,"tag":210,"props":3024,"children":3025},{},[3026],{"type":45,"value":3027},"print(result.usage_metrics)   # token usage stats\n",{"type":39,"tag":187,"props":3029,"children":3031},{"id":3030},"with-structured-output",[3032],{"type":45,"value":3033},"With Structured Output",{"type":39,"tag":199,"props":3035,"children":3037},{"className":201,"code":3036,"language":203,"meta":204,"style":204},"from pydantic import BaseModel\n\nclass ResearchFindings(BaseModel):\n    key_trends: list[str]\n    sources: list[str]\n    confidence: float\n\nresult = researcher.kickoff(\n    \"Research the latest AI agent frameworks\",\n    response_format=ResearchFindings,\n)\n\n# Access via .pydantic (NOT directly — Agent.kickoff wraps the result)\nprint(result.pydantic.key_trends)    # list[str]\nprint(result.pydantic.confidence)    # float\nprint(result.raw)                    # raw string version\n",[3038],{"type":39,"tag":76,"props":3039,"children":3040},{"__ignoreMap":204},[3041,3049,3056,3064,3072,3080,3088,3095,3103,3111,3119,3126,3133,3141,3149,3157],{"type":39,"tag":210,"props":3042,"children":3043},{"class":212,"line":213},[3044],{"type":39,"tag":210,"props":3045,"children":3046},{},[3047],{"type":45,"value":3048},"from pydantic import BaseModel\n",{"type":39,"tag":210,"props":3050,"children":3051},{"class":212,"line":222},[3052],{"type":39,"tag":210,"props":3053,"children":3054},{"emptyLinePlaceholder":1143},[3055],{"type":45,"value":1146},{"type":39,"tag":210,"props":3057,"children":3058},{"class":212,"line":231},[3059],{"type":39,"tag":210,"props":3060,"children":3061},{},[3062],{"type":45,"value":3063},"class ResearchFindings(BaseModel):\n",{"type":39,"tag":210,"props":3065,"children":3066},{"class":212,"line":343},[3067],{"type":39,"tag":210,"props":3068,"children":3069},{},[3070],{"type":45,"value":3071},"    key_trends: list[str]\n",{"type":39,"tag":210,"props":3073,"children":3074},{"class":212,"line":352},[3075],{"type":39,"tag":210,"props":3076,"children":3077},{},[3078],{"type":45,"value":3079},"    sources: list[str]\n",{"type":39,"tag":210,"props":3081,"children":3082},{"class":212,"line":361},[3083],{"type":39,"tag":210,"props":3084,"children":3085},{},[3086],{"type":45,"value":3087},"    confidence: float\n",{"type":39,"tag":210,"props":3089,"children":3090},{"class":212,"line":370},[3091],{"type":39,"tag":210,"props":3092,"children":3093},{"emptyLinePlaceholder":1143},[3094],{"type":45,"value":1146},{"type":39,"tag":210,"props":3096,"children":3097},{"class":212,"line":514},[3098],{"type":39,"tag":210,"props":3099,"children":3100},{},[3101],{"type":45,"value":3102},"result = researcher.kickoff(\n",{"type":39,"tag":210,"props":3104,"children":3105},{"class":212,"line":27},[3106],{"type":39,"tag":210,"props":3107,"children":3108},{},[3109],{"type":45,"value":3110},"    \"Research the latest AI agent frameworks\",\n",{"type":39,"tag":210,"props":3112,"children":3113},{"class":212,"line":1627},[3114],{"type":39,"tag":210,"props":3115,"children":3116},{},[3117],{"type":45,"value":3118},"    response_format=ResearchFindings,\n",{"type":39,"tag":210,"props":3120,"children":3121},{"class":212,"line":1895},[3122],{"type":39,"tag":210,"props":3123,"children":3124},{},[3125],{"type":45,"value":358},{"type":39,"tag":210,"props":3127,"children":3128},{"class":212,"line":1904},[3129],{"type":39,"tag":210,"props":3130,"children":3131},{"emptyLinePlaceholder":1143},[3132],{"type":45,"value":1146},{"type":39,"tag":210,"props":3134,"children":3135},{"class":212,"line":2697},[3136],{"type":39,"tag":210,"props":3137,"children":3138},{},[3139],{"type":45,"value":3140},"# Access via .pydantic (NOT directly — Agent.kickoff wraps the result)\n",{"type":39,"tag":210,"props":3142,"children":3143},{"class":212,"line":2706},[3144],{"type":39,"tag":210,"props":3145,"children":3146},{},[3147],{"type":45,"value":3148},"print(result.pydantic.key_trends)    # list[str]\n",{"type":39,"tag":210,"props":3150,"children":3151},{"class":212,"line":2715},[3152],{"type":39,"tag":210,"props":3153,"children":3154},{},[3155],{"type":45,"value":3156},"print(result.pydantic.confidence)    # float\n",{"type":39,"tag":210,"props":3158,"children":3159},{"class":212,"line":2724},[3160],{"type":39,"tag":210,"props":3161,"children":3162},{},[3163],{"type":45,"value":3164},"print(result.raw)                    # raw string version\n",{"type":39,"tag":384,"props":3166,"children":3167},{},[3168],{"type":39,"tag":48,"props":3169,"children":3170},{},[3171,3176,3177,3182,3184,3190,3192,3198,3200,3206],{"type":39,"tag":68,"props":3172,"children":3173},{},[3174],{"type":45,"value":3175},"Note:",{"type":45,"value":533},{"type":39,"tag":76,"props":3178,"children":3180},{"className":3179},[],[3181],{"type":45,"value":408},{"type":45,"value":3183}," returns ",{"type":39,"tag":76,"props":3185,"children":3187},{"className":3186},[],[3188],{"type":45,"value":3189},"LiteAgentOutput",{"type":45,"value":3191}," — access structured output via ",{"type":39,"tag":76,"props":3193,"children":3195},{"className":3194},[],[3196],{"type":45,"value":3197},"result.pydantic",{"type":45,"value":3199},". This differs from ",{"type":39,"tag":76,"props":3201,"children":3203},{"className":3202},[],[3204],{"type":45,"value":3205},"LLM.call()",{"type":45,"value":3207}," which returns the Pydantic object directly.",{"type":39,"tag":187,"props":3209,"children":3211},{"id":3210},"with-file-inputs",[3212],{"type":45,"value":3213},"With File Inputs",{"type":39,"tag":199,"props":3215,"children":3217},{"className":201,"code":3216,"language":203,"meta":204,"style":204},"result = researcher.kickoff(\n    \"Analyze this document and summarize the key findings\",\n    input_files={\"document\": FileInput(path=\"report.pdf\")},\n)\n",[3218],{"type":39,"tag":76,"props":3219,"children":3220},{"__ignoreMap":204},[3221,3228,3236,3244],{"type":39,"tag":210,"props":3222,"children":3223},{"class":212,"line":213},[3224],{"type":39,"tag":210,"props":3225,"children":3226},{},[3227],{"type":45,"value":3102},{"type":39,"tag":210,"props":3229,"children":3230},{"class":212,"line":222},[3231],{"type":39,"tag":210,"props":3232,"children":3233},{},[3234],{"type":45,"value":3235},"    \"Analyze this document and summarize the key findings\",\n",{"type":39,"tag":210,"props":3237,"children":3238},{"class":212,"line":231},[3239],{"type":39,"tag":210,"props":3240,"children":3241},{},[3242],{"type":45,"value":3243},"    input_files={\"document\": FileInput(path=\"report.pdf\")},\n",{"type":39,"tag":210,"props":3245,"children":3246},{"class":212,"line":343},[3247],{"type":39,"tag":210,"props":3248,"children":3249},{},[3250],{"type":45,"value":358},{"type":39,"tag":187,"props":3252,"children":3254},{"id":3253},"async-variant",[3255],{"type":45,"value":3256},"Async Variant",{"type":39,"tag":199,"props":3258,"children":3260},{"className":201,"code":3259,"language":203,"meta":204,"style":204},"result = await researcher.kickoff_async(\n    \"Research quantum computing breakthroughs\",\n    response_format=ResearchFindings,\n)\n",[3261],{"type":39,"tag":76,"props":3262,"children":3263},{"__ignoreMap":204},[3264,3272,3280,3287],{"type":39,"tag":210,"props":3265,"children":3266},{"class":212,"line":213},[3267],{"type":39,"tag":210,"props":3268,"children":3269},{},[3270],{"type":45,"value":3271},"result = await researcher.kickoff_async(\n",{"type":39,"tag":210,"props":3273,"children":3274},{"class":212,"line":222},[3275],{"type":39,"tag":210,"props":3276,"children":3277},{},[3278],{"type":45,"value":3279},"    \"Research quantum computing breakthroughs\",\n",{"type":39,"tag":210,"props":3281,"children":3282},{"class":212,"line":231},[3283],{"type":39,"tag":210,"props":3284,"children":3285},{},[3286],{"type":45,"value":3118},{"type":39,"tag":210,"props":3288,"children":3289},{"class":212,"line":343},[3290],{"type":39,"tag":210,"props":3291,"children":3292},{},[3293],{"type":45,"value":358},{"type":39,"tag":187,"props":3295,"children":3297},{"id":3296},"agentkickoff-in-flows-recommended-pattern",[3298],{"type":45,"value":3299},"Agent.kickoff() in Flows (Recommended Pattern)",{"type":39,"tag":48,"props":3301,"children":3302},{},[3303,3305,3310],{"type":45,"value":3304},"The most powerful pattern is orchestrating multiple ",{"type":39,"tag":76,"props":3306,"children":3308},{"className":3307},[],[3309],{"type":45,"value":408},{"type":45,"value":3311}," calls inside a Flow. The Flow handles state and sequencing; each agent handles its specific step:",{"type":39,"tag":199,"props":3313,"children":3315},{"className":201,"code":3314,"language":203,"meta":204,"style":204},"from crewai import Agent\nfrom crewai.flow.flow import Flow, listen, start\nfrom crewai_tools import SerperDevTool, ScrapeWebsiteTool\nfrom pydantic import BaseModel\n\nclass ResearchState(BaseModel):\n    topic: str = \"\"\n    research: str = \"\"\n    analysis: str = \"\"\n    report: str = \"\"\n\nclass ResearchFlow(Flow[ResearchState]):\n\n    @start()\n    def gather_data(self):\n        researcher = Agent(\n            role=\"Senior Researcher\",\n            goal=\"Find comprehensive data with sources\",\n            backstory=\"Expert at finding and validating information.\",\n            tools=[SerperDevTool(), ScrapeWebsiteTool()],\n        )\n        result = researcher.kickoff(f\"Research: {self.state.topic}\")\n        self.state.research = result.raw\n\n    @listen(gather_data)\n    def analyze(self):\n        analyst = Agent(\n            role=\"Data Analyst\",\n            goal=\"Extract actionable insights from raw research\",\n            backstory=\"Skilled at pattern recognition and synthesis.\",\n        )\n        result = analyst.kickoff(\n            f\"Analyze this research and extract key insights:\\n\\n{self.state.research}\"\n        )\n        self.state.analysis = result.raw\n\n    @listen(analyze)\n    def write_report(self):\n        writer = Agent(\n            role=\"Report Writer\",\n            goal=\"Create clear, well-structured reports\",\n            backstory=\"Technical writer who makes complex topics accessible.\",\n        )\n        result = writer.kickoff(\n            f\"Write a comprehensive report from this analysis:\\n\\n{self.state.analysis}\"\n        )\n        self.state.report = result.raw\n\nflow = ResearchFlow()\nflow.kickoff(inputs={\"topic\": \"AI agents\"})\nprint(flow.state.report)\n",[3316],{"type":39,"tag":76,"props":3317,"children":3318},{"__ignoreMap":204},[3319,3326,3334,3342,3349,3356,3364,3372,3380,3388,3396,3403,3411,3418,3426,3434,3442,3450,3459,3468,3477,3485,3494,3503,3511,3520,3529,3538,3547,3555,3564,3572,3581,3590,3598,3607,3615,3624,3633,3642,3651,3660,3669,3677,3686,3695,3703,3712,3720,3729,3738],{"type":39,"tag":210,"props":3320,"children":3321},{"class":212,"line":213},[3322],{"type":39,"tag":210,"props":3323,"children":3324},{},[3325],{"type":45,"value":1561},{"type":39,"tag":210,"props":3327,"children":3328},{"class":212,"line":222},[3329],{"type":39,"tag":210,"props":3330,"children":3331},{},[3332],{"type":45,"value":3333},"from crewai.flow.flow import Flow, listen, start\n",{"type":39,"tag":210,"props":3335,"children":3336},{"class":212,"line":231},[3337],{"type":39,"tag":210,"props":3338,"children":3339},{},[3340],{"type":45,"value":3341},"from crewai_tools import SerperDevTool, ScrapeWebsiteTool\n",{"type":39,"tag":210,"props":3343,"children":3344},{"class":212,"line":343},[3345],{"type":39,"tag":210,"props":3346,"children":3347},{},[3348],{"type":45,"value":3048},{"type":39,"tag":210,"props":3350,"children":3351},{"class":212,"line":352},[3352],{"type":39,"tag":210,"props":3353,"children":3354},{"emptyLinePlaceholder":1143},[3355],{"type":45,"value":1146},{"type":39,"tag":210,"props":3357,"children":3358},{"class":212,"line":361},[3359],{"type":39,"tag":210,"props":3360,"children":3361},{},[3362],{"type":45,"value":3363},"class ResearchState(BaseModel):\n",{"type":39,"tag":210,"props":3365,"children":3366},{"class":212,"line":370},[3367],{"type":39,"tag":210,"props":3368,"children":3369},{},[3370],{"type":45,"value":3371},"    topic: str = \"\"\n",{"type":39,"tag":210,"props":3373,"children":3374},{"class":212,"line":514},[3375],{"type":39,"tag":210,"props":3376,"children":3377},{},[3378],{"type":45,"value":3379},"    research: str = \"\"\n",{"type":39,"tag":210,"props":3381,"children":3382},{"class":212,"line":27},[3383],{"type":39,"tag":210,"props":3384,"children":3385},{},[3386],{"type":45,"value":3387},"    analysis: str = \"\"\n",{"type":39,"tag":210,"props":3389,"children":3390},{"class":212,"line":1627},[3391],{"type":39,"tag":210,"props":3392,"children":3393},{},[3394],{"type":45,"value":3395},"    report: str = \"\"\n",{"type":39,"tag":210,"props":3397,"children":3398},{"class":212,"line":1895},[3399],{"type":39,"tag":210,"props":3400,"children":3401},{"emptyLinePlaceholder":1143},[3402],{"type":45,"value":1146},{"type":39,"tag":210,"props":3404,"children":3405},{"class":212,"line":1904},[3406],{"type":39,"tag":210,"props":3407,"children":3408},{},[3409],{"type":45,"value":3410},"class ResearchFlow(Flow[ResearchState]):\n",{"type":39,"tag":210,"props":3412,"children":3413},{"class":212,"line":2697},[3414],{"type":39,"tag":210,"props":3415,"children":3416},{"emptyLinePlaceholder":1143},[3417],{"type":45,"value":1146},{"type":39,"tag":210,"props":3419,"children":3420},{"class":212,"line":2706},[3421],{"type":39,"tag":210,"props":3422,"children":3423},{},[3424],{"type":45,"value":3425},"    @start()\n",{"type":39,"tag":210,"props":3427,"children":3428},{"class":212,"line":2715},[3429],{"type":39,"tag":210,"props":3430,"children":3431},{},[3432],{"type":45,"value":3433},"    def gather_data(self):\n",{"type":39,"tag":210,"props":3435,"children":3436},{"class":212,"line":2724},[3437],{"type":39,"tag":210,"props":3438,"children":3439},{},[3440],{"type":45,"value":3441},"        researcher = Agent(\n",{"type":39,"tag":210,"props":3443,"children":3444},{"class":212,"line":2733},[3445],{"type":39,"tag":210,"props":3446,"children":3447},{},[3448],{"type":45,"value":3449},"            role=\"Senior Researcher\",\n",{"type":39,"tag":210,"props":3451,"children":3453},{"class":212,"line":3452},18,[3454],{"type":39,"tag":210,"props":3455,"children":3456},{},[3457],{"type":45,"value":3458},"            goal=\"Find comprehensive data with sources\",\n",{"type":39,"tag":210,"props":3460,"children":3462},{"class":212,"line":3461},19,[3463],{"type":39,"tag":210,"props":3464,"children":3465},{},[3466],{"type":45,"value":3467},"            backstory=\"Expert at finding and validating information.\",\n",{"type":39,"tag":210,"props":3469,"children":3471},{"class":212,"line":3470},20,[3472],{"type":39,"tag":210,"props":3473,"children":3474},{},[3475],{"type":45,"value":3476},"            tools=[SerperDevTool(), ScrapeWebsiteTool()],\n",{"type":39,"tag":210,"props":3478,"children":3480},{"class":212,"line":3479},21,[3481],{"type":39,"tag":210,"props":3482,"children":3483},{},[3484],{"type":45,"value":2845},{"type":39,"tag":210,"props":3486,"children":3488},{"class":212,"line":3487},22,[3489],{"type":39,"tag":210,"props":3490,"children":3491},{},[3492],{"type":45,"value":3493},"        result = researcher.kickoff(f\"Research: {self.state.topic}\")\n",{"type":39,"tag":210,"props":3495,"children":3497},{"class":212,"line":3496},23,[3498],{"type":39,"tag":210,"props":3499,"children":3500},{},[3501],{"type":45,"value":3502},"        self.state.research = result.raw\n",{"type":39,"tag":210,"props":3504,"children":3506},{"class":212,"line":3505},24,[3507],{"type":39,"tag":210,"props":3508,"children":3509},{"emptyLinePlaceholder":1143},[3510],{"type":45,"value":1146},{"type":39,"tag":210,"props":3512,"children":3514},{"class":212,"line":3513},25,[3515],{"type":39,"tag":210,"props":3516,"children":3517},{},[3518],{"type":45,"value":3519},"    @listen(gather_data)\n",{"type":39,"tag":210,"props":3521,"children":3523},{"class":212,"line":3522},26,[3524],{"type":39,"tag":210,"props":3525,"children":3526},{},[3527],{"type":45,"value":3528},"    def analyze(self):\n",{"type":39,"tag":210,"props":3530,"children":3532},{"class":212,"line":3531},27,[3533],{"type":39,"tag":210,"props":3534,"children":3535},{},[3536],{"type":45,"value":3537},"        analyst = Agent(\n",{"type":39,"tag":210,"props":3539,"children":3541},{"class":212,"line":3540},28,[3542],{"type":39,"tag":210,"props":3543,"children":3544},{},[3545],{"type":45,"value":3546},"            role=\"Data Analyst\",\n",{"type":39,"tag":210,"props":3548,"children":3549},{"class":212,"line":23},[3550],{"type":39,"tag":210,"props":3551,"children":3552},{},[3553],{"type":45,"value":3554},"            goal=\"Extract actionable insights from raw research\",\n",{"type":39,"tag":210,"props":3556,"children":3558},{"class":212,"line":3557},30,[3559],{"type":39,"tag":210,"props":3560,"children":3561},{},[3562],{"type":45,"value":3563},"            backstory=\"Skilled at pattern recognition and synthesis.\",\n",{"type":39,"tag":210,"props":3565,"children":3567},{"class":212,"line":3566},31,[3568],{"type":39,"tag":210,"props":3569,"children":3570},{},[3571],{"type":45,"value":2845},{"type":39,"tag":210,"props":3573,"children":3575},{"class":212,"line":3574},32,[3576],{"type":39,"tag":210,"props":3577,"children":3578},{},[3579],{"type":45,"value":3580},"        result = analyst.kickoff(\n",{"type":39,"tag":210,"props":3582,"children":3584},{"class":212,"line":3583},33,[3585],{"type":39,"tag":210,"props":3586,"children":3587},{},[3588],{"type":45,"value":3589},"            f\"Analyze this research and extract key insights:\\n\\n{self.state.research}\"\n",{"type":39,"tag":210,"props":3591,"children":3593},{"class":212,"line":3592},34,[3594],{"type":39,"tag":210,"props":3595,"children":3596},{},[3597],{"type":45,"value":2845},{"type":39,"tag":210,"props":3599,"children":3601},{"class":212,"line":3600},35,[3602],{"type":39,"tag":210,"props":3603,"children":3604},{},[3605],{"type":45,"value":3606},"        self.state.analysis = result.raw\n",{"type":39,"tag":210,"props":3608,"children":3610},{"class":212,"line":3609},36,[3611],{"type":39,"tag":210,"props":3612,"children":3613},{"emptyLinePlaceholder":1143},[3614],{"type":45,"value":1146},{"type":39,"tag":210,"props":3616,"children":3618},{"class":212,"line":3617},37,[3619],{"type":39,"tag":210,"props":3620,"children":3621},{},[3622],{"type":45,"value":3623},"    @listen(analyze)\n",{"type":39,"tag":210,"props":3625,"children":3627},{"class":212,"line":3626},38,[3628],{"type":39,"tag":210,"props":3629,"children":3630},{},[3631],{"type":45,"value":3632},"    def write_report(self):\n",{"type":39,"tag":210,"props":3634,"children":3636},{"class":212,"line":3635},39,[3637],{"type":39,"tag":210,"props":3638,"children":3639},{},[3640],{"type":45,"value":3641},"        writer = Agent(\n",{"type":39,"tag":210,"props":3643,"children":3645},{"class":212,"line":3644},40,[3646],{"type":39,"tag":210,"props":3647,"children":3648},{},[3649],{"type":45,"value":3650},"            role=\"Report Writer\",\n",{"type":39,"tag":210,"props":3652,"children":3654},{"class":212,"line":3653},41,[3655],{"type":39,"tag":210,"props":3656,"children":3657},{},[3658],{"type":45,"value":3659},"            goal=\"Create clear, well-structured reports\",\n",{"type":39,"tag":210,"props":3661,"children":3663},{"class":212,"line":3662},42,[3664],{"type":39,"tag":210,"props":3665,"children":3666},{},[3667],{"type":45,"value":3668},"            backstory=\"Technical writer who makes complex topics accessible.\",\n",{"type":39,"tag":210,"props":3670,"children":3672},{"class":212,"line":3671},43,[3673],{"type":39,"tag":210,"props":3674,"children":3675},{},[3676],{"type":45,"value":2845},{"type":39,"tag":210,"props":3678,"children":3680},{"class":212,"line":3679},44,[3681],{"type":39,"tag":210,"props":3682,"children":3683},{},[3684],{"type":45,"value":3685},"        result = writer.kickoff(\n",{"type":39,"tag":210,"props":3687,"children":3689},{"class":212,"line":3688},45,[3690],{"type":39,"tag":210,"props":3691,"children":3692},{},[3693],{"type":45,"value":3694},"            f\"Write a comprehensive report from this analysis:\\n\\n{self.state.analysis}\"\n",{"type":39,"tag":210,"props":3696,"children":3698},{"class":212,"line":3697},46,[3699],{"type":39,"tag":210,"props":3700,"children":3701},{},[3702],{"type":45,"value":2845},{"type":39,"tag":210,"props":3704,"children":3706},{"class":212,"line":3705},47,[3707],{"type":39,"tag":210,"props":3708,"children":3709},{},[3710],{"type":45,"value":3711},"        self.state.report = result.raw\n",{"type":39,"tag":210,"props":3713,"children":3715},{"class":212,"line":3714},48,[3716],{"type":39,"tag":210,"props":3717,"children":3718},{"emptyLinePlaceholder":1143},[3719],{"type":45,"value":1146},{"type":39,"tag":210,"props":3721,"children":3723},{"class":212,"line":3722},49,[3724],{"type":39,"tag":210,"props":3725,"children":3726},{},[3727],{"type":45,"value":3728},"flow = ResearchFlow()\n",{"type":39,"tag":210,"props":3730,"children":3732},{"class":212,"line":3731},50,[3733],{"type":39,"tag":210,"props":3734,"children":3735},{},[3736],{"type":45,"value":3737},"flow.kickoff(inputs={\"topic\": \"AI agents\"})\n",{"type":39,"tag":210,"props":3739,"children":3741},{"class":212,"line":3740},51,[3742],{"type":39,"tag":210,"props":3743,"children":3744},{},[3745],{"type":45,"value":3746},"print(flow.state.report)\n",{"type":39,"tag":48,"props":3748,"children":3749},{},[3750],{"type":39,"tag":68,"props":3751,"children":3752},{},[3753],{"type":45,"value":3754},"When to use Agent.kickoff() vs Crew.kickoff():",{"type":39,"tag":104,"props":3756,"children":3757},{},[3758,3769],{"type":39,"tag":108,"props":3759,"children":3760},{},[3761,3762,3767],{"type":45,"value":402},{"type":39,"tag":76,"props":3763,"children":3765},{"className":3764},[],[3766],{"type":45,"value":408},{"type":45,"value":3768}," when each step is a distinct agent and the Flow controls sequencing",{"type":39,"tag":108,"props":3770,"children":3771},{},[3772,3773,3778],{"type":45,"value":402},{"type":39,"tag":76,"props":3774,"children":3776},{"className":3775},[],[3777],{"type":45,"value":531},{"type":45,"value":3779}," when multiple agents need to collaborate on related tasks within a single step",{"type":39,"tag":187,"props":3781,"children":3783},{"id":3782},"agentkickoff-in-conversational-flow-routes",[3784],{"type":45,"value":3785},"Agent.kickoff() in Conversational Flow Routes",{"type":39,"tag":48,"props":3787,"children":3788},{},[3789],{"type":45,"value":3790},"In experimental conversational Flows, the Flow owns the chat lifecycle and route selection. Agents should be called inside route handlers for bounded tool-backed work: research, docs lookup, account actions, triage, drafting, or escalation prep.",{"type":39,"tag":199,"props":3792,"children":3794},{"className":201,"code":3793,"language":203,"meta":204,"style":204},"from crewai import Agent, Flow\nfrom crewai.flow import listen\nfrom crewai.experimental.conversational import ConversationState\n\n\nclass SupportFlow(Flow[ConversationState]):\n    conversational = True\n\n    def research_agent(self) -> Agent:\n        return Agent(\n            role=\"Support Research Specialist\",\n            goal=\"Find accurate information with sources for the user's current question.\",\n            backstory=\"You are precise, evidence-driven, and explicit about uncertainty.\",\n            tools=[...],\n        )\n\n    @listen(\"RESEARCH\")\n    def handle_research(self) -> str:\n        \"\"\"Fresh research, current lookups, and source-backed synthesis.\"\"\"\n        result = self.research_agent().kickoff(self.state.current_user_message)\n        self.append_agent_result(\"research_agent\", result, visibility=\"private\")\n        reply = result.raw\n        self.append_assistant_message(reply)\n        return reply\n",[3795],{"type":39,"tag":76,"props":3796,"children":3797},{"__ignoreMap":204},[3798,3806,3814,3822,3829,3836,3844,3852,3859,3867,3874,3882,3890,3898,3906,3913,3920,3928,3936,3944,3952,3960,3968,3976],{"type":39,"tag":210,"props":3799,"children":3800},{"class":212,"line":213},[3801],{"type":39,"tag":210,"props":3802,"children":3803},{},[3804],{"type":45,"value":3805},"from crewai import Agent, Flow\n",{"type":39,"tag":210,"props":3807,"children":3808},{"class":212,"line":222},[3809],{"type":39,"tag":210,"props":3810,"children":3811},{},[3812],{"type":45,"value":3813},"from crewai.flow import listen\n",{"type":39,"tag":210,"props":3815,"children":3816},{"class":212,"line":231},[3817],{"type":39,"tag":210,"props":3818,"children":3819},{},[3820],{"type":45,"value":3821},"from crewai.experimental.conversational import ConversationState\n",{"type":39,"tag":210,"props":3823,"children":3824},{"class":212,"line":343},[3825],{"type":39,"tag":210,"props":3826,"children":3827},{"emptyLinePlaceholder":1143},[3828],{"type":45,"value":1146},{"type":39,"tag":210,"props":3830,"children":3831},{"class":212,"line":352},[3832],{"type":39,"tag":210,"props":3833,"children":3834},{"emptyLinePlaceholder":1143},[3835],{"type":45,"value":1146},{"type":39,"tag":210,"props":3837,"children":3838},{"class":212,"line":361},[3839],{"type":39,"tag":210,"props":3840,"children":3841},{},[3842],{"type":45,"value":3843},"class SupportFlow(Flow[ConversationState]):\n",{"type":39,"tag":210,"props":3845,"children":3846},{"class":212,"line":370},[3847],{"type":39,"tag":210,"props":3848,"children":3849},{},[3850],{"type":45,"value":3851},"    conversational = True\n",{"type":39,"tag":210,"props":3853,"children":3854},{"class":212,"line":514},[3855],{"type":39,"tag":210,"props":3856,"children":3857},{"emptyLinePlaceholder":1143},[3858],{"type":45,"value":1146},{"type":39,"tag":210,"props":3860,"children":3861},{"class":212,"line":27},[3862],{"type":39,"tag":210,"props":3863,"children":3864},{},[3865],{"type":45,"value":3866},"    def research_agent(self) -> Agent:\n",{"type":39,"tag":210,"props":3868,"children":3869},{"class":212,"line":1627},[3870],{"type":39,"tag":210,"props":3871,"children":3872},{},[3873],{"type":45,"value":2821},{"type":39,"tag":210,"props":3875,"children":3876},{"class":212,"line":1895},[3877],{"type":39,"tag":210,"props":3878,"children":3879},{},[3880],{"type":45,"value":3881},"            role=\"Support Research Specialist\",\n",{"type":39,"tag":210,"props":3883,"children":3884},{"class":212,"line":1904},[3885],{"type":39,"tag":210,"props":3886,"children":3887},{},[3888],{"type":45,"value":3889},"            goal=\"Find accurate information with sources for the user's current question.\",\n",{"type":39,"tag":210,"props":3891,"children":3892},{"class":212,"line":2697},[3893],{"type":39,"tag":210,"props":3894,"children":3895},{},[3896],{"type":45,"value":3897},"            backstory=\"You are precise, evidence-driven, and explicit about uncertainty.\",\n",{"type":39,"tag":210,"props":3899,"children":3900},{"class":212,"line":2706},[3901],{"type":39,"tag":210,"props":3902,"children":3903},{},[3904],{"type":45,"value":3905},"            tools=[...],\n",{"type":39,"tag":210,"props":3907,"children":3908},{"class":212,"line":2715},[3909],{"type":39,"tag":210,"props":3910,"children":3911},{},[3912],{"type":45,"value":2845},{"type":39,"tag":210,"props":3914,"children":3915},{"class":212,"line":2724},[3916],{"type":39,"tag":210,"props":3917,"children":3918},{"emptyLinePlaceholder":1143},[3919],{"type":45,"value":1146},{"type":39,"tag":210,"props":3921,"children":3922},{"class":212,"line":2733},[3923],{"type":39,"tag":210,"props":3924,"children":3925},{},[3926],{"type":45,"value":3927},"    @listen(\"RESEARCH\")\n",{"type":39,"tag":210,"props":3929,"children":3930},{"class":212,"line":3452},[3931],{"type":39,"tag":210,"props":3932,"children":3933},{},[3934],{"type":45,"value":3935},"    def handle_research(self) -> str:\n",{"type":39,"tag":210,"props":3937,"children":3938},{"class":212,"line":3461},[3939],{"type":39,"tag":210,"props":3940,"children":3941},{},[3942],{"type":45,"value":3943},"        \"\"\"Fresh research, current lookups, and source-backed synthesis.\"\"\"\n",{"type":39,"tag":210,"props":3945,"children":3946},{"class":212,"line":3470},[3947],{"type":39,"tag":210,"props":3948,"children":3949},{},[3950],{"type":45,"value":3951},"        result = self.research_agent().kickoff(self.state.current_user_message)\n",{"type":39,"tag":210,"props":3953,"children":3954},{"class":212,"line":3479},[3955],{"type":39,"tag":210,"props":3956,"children":3957},{},[3958],{"type":45,"value":3959},"        self.append_agent_result(\"research_agent\", result, visibility=\"private\")\n",{"type":39,"tag":210,"props":3961,"children":3962},{"class":212,"line":3487},[3963],{"type":39,"tag":210,"props":3964,"children":3965},{},[3966],{"type":45,"value":3967},"        reply = result.raw\n",{"type":39,"tag":210,"props":3969,"children":3970},{"class":212,"line":3496},[3971],{"type":39,"tag":210,"props":3972,"children":3973},{},[3974],{"type":45,"value":3975},"        self.append_assistant_message(reply)\n",{"type":39,"tag":210,"props":3977,"children":3978},{"class":212,"line":3505},[3979],{"type":39,"tag":210,"props":3980,"children":3981},{},[3982],{"type":45,"value":3983},"        return reply\n",{"type":39,"tag":48,"props":3985,"children":3986},{},[3987],{"type":45,"value":3988},"Design implications:",{"type":39,"tag":104,"props":3990,"children":3991},{},[3992,4005,4010,4022,4034],{"type":39,"tag":108,"props":3993,"children":3994},{},[3995,3997,4003],{"type":45,"value":3996},"Keep the conversational ",{"type":39,"tag":76,"props":3998,"children":4000},{"className":3999},[],[4001],{"type":45,"value":4002},"Flow",{"type":45,"value":4004}," responsible for session id, message history, routing, trace finalization, and approvals.",{"type":39,"tag":108,"props":4006,"children":4007},{},[4008],{"type":45,"value":4009},"Keep each agent narrow: one route, one tool surface, one job.",{"type":39,"tag":108,"props":4011,"children":4012},{},[4013,4014,4020],{"type":45,"value":402},{"type":39,"tag":76,"props":4015,"children":4017},{"className":4016},[],[4018],{"type":45,"value":4019},"append_agent_result(..., visibility=\"private\")",{"type":45,"value":4021}," for scratch work that should not enter canonical chat history.",{"type":39,"tag":108,"props":4023,"children":4024},{},[4025,4026,4032],{"type":45,"value":402},{"type":39,"tag":76,"props":4027,"children":4029},{"className":4028},[],[4030],{"type":45,"value":4031},"append_assistant_message(reply)",{"type":45,"value":4033}," for the user-visible answer so the next turn has the assistant context.",{"type":39,"tag":108,"props":4035,"children":4036},{},[4037],{"type":45,"value":4038},"Do not make a \"chat agent\" with every tool. Route first, then invoke a focused agent for the selected route.",{"type":39,"tag":48,"props":4040,"children":4041},{},[4042,4044,4050],{"type":45,"value":4043},"See the getting-started reference for the Flow lifecycle: ",{"type":39,"tag":76,"props":4045,"children":4047},{"className":4046},[],[4048],{"type":45,"value":4049},"skills\u002Fgetting-started\u002Freferences\u002Fconversational-flows.md",{"type":45,"value":443},{"type":39,"tag":54,"props":4052,"children":4053},{},[],{"type":39,"tag":58,"props":4055,"children":4057},{"id":4056},"_5-specialist-vs-generalist-agents",[4058],{"type":45,"value":4059},"5. Specialist vs Generalist Agents",{"type":39,"tag":384,"props":4061,"children":4062},{},[4063],{"type":39,"tag":48,"props":4064,"children":4065},{},[4066,4070,4072,4077],{"type":39,"tag":68,"props":4067,"children":4068},{},[4069],{"type":45,"value":3175},{"type":45,"value":4071}," Apply this section ",{"type":39,"tag":535,"props":4073,"children":4074},{},[4075],{"type":45,"value":4076},"after",{"type":45,"value":4078}," you've decided you genuinely need multiple agents (see Section 0). If you only need one agent, \"specialist vs generalist\" is not the question — the question is just how to design that one agent.",{"type":39,"tag":48,"props":4080,"children":4081},{},[4082,4087],{"type":39,"tag":68,"props":4083,"children":4084},{},[4085],{"type":45,"value":4086},"When you do need multiple agents, prefer specialists.",{"type":45,"value":4088}," An agent that does one thing well outperforms one that does many things acceptably.",{"type":39,"tag":187,"props":4090,"children":4092},{"id":4091},"when-to-use-a-specialist",[4093],{"type":45,"value":4094},"When to Use a Specialist",{"type":39,"tag":104,"props":4096,"children":4097},{},[4098,4103,4108],{"type":39,"tag":108,"props":4099,"children":4100},{},[4101],{"type":45,"value":4102},"Task requires deep domain knowledge",{"type":39,"tag":108,"props":4104,"children":4105},{},[4106],{"type":45,"value":4107},"Output quality matters more than speed",{"type":39,"tag":108,"props":4109,"children":4110},{},[4111],{"type":45,"value":4112},"The task is complex enough to benefit from focused expertise",{"type":39,"tag":187,"props":4114,"children":4116},{"id":4115},"when-a-generalist-is-acceptable",[4117],{"type":45,"value":4118},"When a Generalist Is Acceptable",{"type":39,"tag":104,"props":4120,"children":4121},{},[4122,4127,4132],{"type":39,"tag":108,"props":4123,"children":4124},{},[4125],{"type":45,"value":4126},"Simple tasks with clear instructions",{"type":39,"tag":108,"props":4128,"children":4129},{},[4130],{"type":45,"value":4131},"Prototyping where you'll specialize later",{"type":39,"tag":108,"props":4133,"children":4134},{},[4135],{"type":45,"value":4136},"Tasks that truly span multiple domains equally",{"type":39,"tag":187,"props":4138,"children":4140},{"id":4139},"specialist-design-pattern",[4141],{"type":45,"value":4142},"Specialist Design Pattern",{"type":39,"tag":48,"props":4144,"children":4145},{},[4146],{"type":45,"value":4147},"Instead of one \"Content Writer\" agent, create:",{"type":39,"tag":104,"props":4149,"children":4150},{},[4151,4162,4173],{"type":39,"tag":108,"props":4152,"children":4153},{},[4154,4160],{"type":39,"tag":76,"props":4155,"children":4157},{"className":4156},[],[4158],{"type":45,"value":4159},"technical_writer",{"type":45,"value":4161}," — deep technical accuracy, code examples",{"type":39,"tag":108,"props":4163,"children":4164},{},[4165,4171],{"type":39,"tag":76,"props":4166,"children":4168},{"className":4167},[],[4169],{"type":45,"value":4170},"copywriter",{"type":45,"value":4172}," — persuasive, audience-focused marketing copy",{"type":39,"tag":108,"props":4174,"children":4175},{},[4176,4182],{"type":39,"tag":76,"props":4177,"children":4179},{"className":4178},[],[4180],{"type":45,"value":4181},"editor",{"type":45,"value":4183}," — grammar, consistency, style guide enforcement",{"type":39,"tag":48,"props":4185,"children":4186},{},[4187],{"type":45,"value":4188},"Each specialist has a narrow role, specific goal, and backstory that reinforces their expertise.",{"type":39,"tag":54,"props":4190,"children":4191},{},[],{"type":39,"tag":58,"props":4193,"children":4195},{"id":4194},"_6-agent-interaction-patterns",[4196],{"type":45,"value":4197},"6. Agent Interaction Patterns",{"type":39,"tag":187,"props":4199,"children":4201},{"id":4200},"sequential-default",[4202],{"type":45,"value":4203},"Sequential (Default)",{"type":39,"tag":48,"props":4205,"children":4206},{},[4207],{"type":45,"value":4208},"Agents work one after another. Each agent receives prior agents' outputs as context.",{"type":39,"tag":199,"props":4210,"children":4214},{"className":4211,"code":4213,"language":45},[4212],"language-text","Researcher → Writer → Editor\n",[4215],{"type":39,"tag":76,"props":4216,"children":4217},{"__ignoreMap":204},[4218],{"type":45,"value":4213},{"type":39,"tag":48,"props":4220,"children":4221},{},[4222],{"type":45,"value":4223},"Best for: linear pipelines where each step builds on the last.",{"type":39,"tag":187,"props":4225,"children":4227},{"id":4226},"hierarchical",[4228],{"type":45,"value":4229},"Hierarchical",{"type":39,"tag":48,"props":4231,"children":4232},{},[4233],{"type":45,"value":4234},"A manager agent delegates and validates. Task assignment is dynamic.",{"type":39,"tag":199,"props":4236,"children":4238},{"className":201,"code":4237,"language":203,"meta":204,"style":204},"Crew(\n    agents=[researcher, writer, editor],\n    tasks=[research_task, writing_task, editing_task],\n    process=Process.hierarchical,\n    manager_llm=\"openai\u002Fgpt-4o\",\n)\n",[4239],{"type":39,"tag":76,"props":4240,"children":4241},{"__ignoreMap":204},[4242,4250,4258,4266,4274,4282],{"type":39,"tag":210,"props":4243,"children":4244},{"class":212,"line":213},[4245],{"type":39,"tag":210,"props":4246,"children":4247},{},[4248],{"type":45,"value":4249},"Crew(\n",{"type":39,"tag":210,"props":4251,"children":4252},{"class":212,"line":222},[4253],{"type":39,"tag":210,"props":4254,"children":4255},{},[4256],{"type":45,"value":4257},"    agents=[researcher, writer, editor],\n",{"type":39,"tag":210,"props":4259,"children":4260},{"class":212,"line":231},[4261],{"type":39,"tag":210,"props":4262,"children":4263},{},[4264],{"type":45,"value":4265},"    tasks=[research_task, writing_task, editing_task],\n",{"type":39,"tag":210,"props":4267,"children":4268},{"class":212,"line":343},[4269],{"type":39,"tag":210,"props":4270,"children":4271},{},[4272],{"type":45,"value":4273},"    process=Process.hierarchical,\n",{"type":39,"tag":210,"props":4275,"children":4276},{"class":212,"line":352},[4277],{"type":39,"tag":210,"props":4278,"children":4279},{},[4280],{"type":45,"value":4281},"    manager_llm=\"openai\u002Fgpt-4o\",\n",{"type":39,"tag":210,"props":4283,"children":4284},{"class":212,"line":361},[4285],{"type":39,"tag":210,"props":4286,"children":4287},{},[4288],{"type":45,"value":358},{"type":39,"tag":48,"props":4290,"children":4291},{},[4292],{"type":45,"value":4293},"Best for: complex workflows where task assignment depends on intermediate results.",{"type":39,"tag":187,"props":4295,"children":4297},{"id":4296},"agent-to-agent-delegation",[4298],{"type":45,"value":4299},"Agent-to-Agent Delegation",{"type":39,"tag":48,"props":4301,"children":4302},{},[4303,4304,4309],{"type":45,"value":2249},{"type":39,"tag":76,"props":4305,"children":4307},{"className":4306},[],[4308],{"type":45,"value":1357},{"type":45,"value":4310},", an agent can ask another crew agent for help:",{"type":39,"tag":199,"props":4312,"children":4314},{"className":201,"code":4313,"language":203,"meta":204,"style":204},"lead_researcher = Agent(\n    role=\"Lead Researcher\",\n    goal=\"Coordinate research efforts\",\n    backstory=\"...\",\n    allow_delegation=True,  # Can delegate to other agents in the crew\n)\n",[4315],{"type":39,"tag":76,"props":4316,"children":4317},{"__ignoreMap":204},[4318,4326,4334,4342,4350,4358],{"type":39,"tag":210,"props":4319,"children":4320},{"class":212,"line":213},[4321],{"type":39,"tag":210,"props":4322,"children":4323},{},[4324],{"type":45,"value":4325},"lead_researcher = Agent(\n",{"type":39,"tag":210,"props":4327,"children":4328},{"class":212,"line":222},[4329],{"type":39,"tag":210,"props":4330,"children":4331},{},[4332],{"type":45,"value":4333},"    role=\"Lead Researcher\",\n",{"type":39,"tag":210,"props":4335,"children":4336},{"class":212,"line":231},[4337],{"type":39,"tag":210,"props":4338,"children":4339},{},[4340],{"type":45,"value":4341},"    goal=\"Coordinate research efforts\",\n",{"type":39,"tag":210,"props":4343,"children":4344},{"class":212,"line":343},[4345],{"type":39,"tag":210,"props":4346,"children":4347},{},[4348],{"type":45,"value":4349},"    backstory=\"...\",\n",{"type":39,"tag":210,"props":4351,"children":4352},{"class":212,"line":352},[4353],{"type":39,"tag":210,"props":4354,"children":4355},{},[4356],{"type":45,"value":4357},"    allow_delegation=True,  # Can delegate to other agents in the crew\n",{"type":39,"tag":210,"props":4359,"children":4360},{"class":212,"line":361},[4361],{"type":39,"tag":210,"props":4362,"children":4363},{},[4364],{"type":45,"value":358},{"type":39,"tag":48,"props":4366,"children":4367},{},[4368],{"type":45,"value":4369},"The agent will automatically discover other crew members and delegate subtasks as needed.",{"type":39,"tag":54,"props":4371,"children":4372},{},[],{"type":39,"tag":58,"props":4374,"children":4376},{"id":4375},"_7-common-agent-design-mistakes",[4377],{"type":45,"value":4378},"7. Common Agent Design Mistakes",{"type":39,"tag":606,"props":4380,"children":4381},{},[4382,4403],{"type":39,"tag":610,"props":4383,"children":4384},{},[4385],{"type":39,"tag":614,"props":4386,"children":4387},{},[4388,4393,4398],{"type":39,"tag":618,"props":4389,"children":4390},{},[4391],{"type":45,"value":4392},"Mistake",{"type":39,"tag":618,"props":4394,"children":4395},{},[4396],{"type":45,"value":4397},"Impact",{"type":39,"tag":618,"props":4399,"children":4400},{},[4401],{"type":45,"value":4402},"Fix",{"type":39,"tag":629,"props":4404,"children":4405},{},[4406,4424,4442,4460,4478,4501,4519,4537],{"type":39,"tag":614,"props":4407,"children":4408},{},[4409,4414,4419],{"type":39,"tag":636,"props":4410,"children":4411},{},[4412],{"type":45,"value":4413},"Generic role like \"Assistant\"",{"type":39,"tag":636,"props":4415,"children":4416},{},[4417],{"type":45,"value":4418},"Agent produces unfocused, shallow output",{"type":39,"tag":636,"props":4420,"children":4421},{},[4422],{"type":45,"value":4423},"Use specific expertise: \"Senior Financial Analyst\"",{"type":39,"tag":614,"props":4425,"children":4426},{},[4427,4432,4437],{"type":39,"tag":636,"props":4428,"children":4429},{},[4430],{"type":45,"value":4431},"No tools for data-gathering tasks",{"type":39,"tag":636,"props":4433,"children":4434},{},[4435],{"type":45,"value":4436},"Agent hallucinates data instead of searching",{"type":39,"tag":636,"props":4438,"children":4439},{},[4440],{"type":45,"value":4441},"Always add tools when the task requires external info",{"type":39,"tag":614,"props":4443,"children":4444},{},[4445,4450,4455],{"type":39,"tag":636,"props":4446,"children":4447},{},[4448],{"type":45,"value":4449},"Too many tools (10+)",{"type":39,"tag":636,"props":4451,"children":4452},{},[4453],{"type":45,"value":4454},"Agent gets confused choosing between tools",{"type":39,"tag":636,"props":4456,"children":4457},{},[4458],{"type":45,"value":4459},"Limit to 3-5 relevant tools per agent",{"type":39,"tag":614,"props":4461,"children":4462},{},[4463,4468,4473],{"type":39,"tag":636,"props":4464,"children":4465},{},[4466],{"type":45,"value":4467},"Backstory full of task instructions",{"type":39,"tag":636,"props":4469,"children":4470},{},[4471],{"type":45,"value":4472},"Agent mixes personality with task execution",{"type":39,"tag":636,"props":4474,"children":4475},{},[4476],{"type":45,"value":4477},"Keep backstory about WHO the agent is; task details go in the task",{"type":39,"tag":614,"props":4479,"children":4480},{},[4481,4491,4496],{"type":39,"tag":636,"props":4482,"children":4483},{},[4484,4489],{"type":39,"tag":76,"props":4485,"children":4487},{"className":4486},[],[4488],{"type":45,"value":1357},{"type":45,"value":4490}," by default",{"type":39,"tag":636,"props":4492,"children":4493},{},[4494],{"type":45,"value":4495},"Agents waste iterations delegating trivially",{"type":39,"tag":636,"props":4497,"children":4498},{},[4499],{"type":45,"value":4500},"Only enable when delegation genuinely helps",{"type":39,"tag":614,"props":4502,"children":4503},{},[4504,4509,4514],{"type":39,"tag":636,"props":4505,"children":4506},{},[4507],{"type":45,"value":4508},"max_iter too high for simple tasks",{"type":39,"tag":636,"props":4510,"children":4511},{},[4512],{"type":45,"value":4513},"Agent loops unnecessarily on vague tasks",{"type":39,"tag":636,"props":4515,"children":4516},{},[4517],{"type":45,"value":4518},"Lower max_iter; fix the task description instead",{"type":39,"tag":614,"props":4520,"children":4521},{},[4522,4527,4532],{"type":39,"tag":636,"props":4523,"children":4524},{},[4525],{"type":45,"value":4526},"No guardrail on critical output",{"type":39,"tag":636,"props":4528,"children":4529},{},[4530],{"type":45,"value":4531},"Bad output passes through unchecked",{"type":39,"tag":636,"props":4533,"children":4534},{},[4535],{"type":45,"value":4536},"Add guardrails for outputs that feed into production systems",{"type":39,"tag":614,"props":4538,"children":4539},{},[4540,4545,4550],{"type":39,"tag":636,"props":4541,"children":4542},{},[4543],{"type":45,"value":4544},"Using expensive LLM for tool calls",{"type":39,"tag":636,"props":4546,"children":4547},{},[4548],{"type":45,"value":4549},"Unnecessary cost for mechanical operations",{"type":39,"tag":636,"props":4551,"children":4552},{},[4553,4554,4559],{"type":45,"value":1351},{"type":39,"tag":76,"props":4555,"children":4557},{"className":4556},[],[4558],{"type":45,"value":1294},{"type":45,"value":4560}," to a cheaper model",{"type":39,"tag":54,"props":4562,"children":4563},{},[],{"type":39,"tag":58,"props":4565,"children":4567},{"id":4566},"_8-agent-design-checklist",[4568],{"type":45,"value":4569},"8. Agent Design Checklist",{"type":39,"tag":48,"props":4571,"children":4572},{},[4573],{"type":45,"value":4574},"Before deploying an agent, verify:",{"type":39,"tag":104,"props":4576,"children":4579},{"className":4577},[4578],"contains-task-list",[4580,4598,4613,4628,4643,4658,4672,4687,4702,4717],{"type":39,"tag":108,"props":4581,"children":4584},{"className":4582},[4583],"task-list-item",[4585,4590,4591,4596],{"type":39,"tag":4586,"props":4587,"children":4589},"input",{"disabled":1143,"type":4588},"checkbox",[],{"type":45,"value":533},{"type":39,"tag":68,"props":4592,"children":4593},{},[4594],{"type":45,"value":4595},"Role",{"type":45,"value":4597}," is specific and domain-focused (not \"Assistant\" or \"Helper\")",{"type":39,"tag":108,"props":4599,"children":4601},{"className":4600},[4583],[4602,4605,4606,4611],{"type":39,"tag":4586,"props":4603,"children":4604},{"disabled":1143,"type":4588},[],{"type":45,"value":533},{"type":39,"tag":68,"props":4607,"children":4608},{},[4609],{"type":45,"value":4610},"Goal",{"type":45,"value":4612}," includes desired outcome AND quality standards",{"type":39,"tag":108,"props":4614,"children":4616},{"className":4615},[4583],[4617,4620,4621,4626],{"type":39,"tag":4586,"props":4618,"children":4619},{"disabled":1143,"type":4588},[],{"type":45,"value":533},{"type":39,"tag":68,"props":4622,"children":4623},{},[4624],{"type":45,"value":4625},"Backstory",{"type":45,"value":4627}," establishes expertise and working style",{"type":39,"tag":108,"props":4629,"children":4631},{"className":4630},[4583],[4632,4635,4636,4641],{"type":39,"tag":4586,"props":4633,"children":4634},{"disabled":1143,"type":4588},[],{"type":45,"value":533},{"type":39,"tag":68,"props":4637,"children":4638},{},[4639],{"type":45,"value":4640},"Tools",{"type":45,"value":4642}," are assigned for any task requiring external data",{"type":39,"tag":108,"props":4644,"children":4646},{"className":4645},[4583],[4647,4650,4651,4656],{"type":39,"tag":4586,"props":4648,"children":4649},{"disabled":1143,"type":4588},[],{"type":45,"value":533},{"type":39,"tag":68,"props":4652,"children":4653},{},[4654],{"type":45,"value":4655},"No excess tools",{"type":45,"value":4657}," — 3-5 per agent maximum",{"type":39,"tag":108,"props":4659,"children":4661},{"className":4660},[4583],[4662,4665,4666,4670],{"type":39,"tag":4586,"props":4663,"children":4664},{"disabled":1143,"type":4588},[],{"type":45,"value":533},{"type":39,"tag":68,"props":4667,"children":4668},{},[4669],{"type":45,"value":1097},{"type":45,"value":4671}," is tuned for expected task complexity (10-15 for simple, 20-25 for complex)",{"type":39,"tag":108,"props":4673,"children":4675},{"className":4674},[4583],[4676,4679,4680,4685],{"type":39,"tag":4586,"props":4677,"children":4678},{"disabled":1143,"type":4588},[],{"type":45,"value":533},{"type":39,"tag":68,"props":4681,"children":4682},{},[4683],{"type":45,"value":4684},"max_execution_time",{"type":45,"value":4686}," is set for production agents to prevent hangs",{"type":39,"tag":108,"props":4688,"children":4690},{"className":4689},[4583],[4691,4694,4695,4700],{"type":39,"tag":4586,"props":4692,"children":4693},{"disabled":1143,"type":4588},[],{"type":45,"value":533},{"type":39,"tag":68,"props":4696,"children":4697},{},[4698],{"type":45,"value":4699},"Guardrails",{"type":45,"value":4701}," are configured for critical outputs",{"type":39,"tag":108,"props":4703,"children":4705},{"className":4704},[4583],[4706,4709,4710,4715],{"type":39,"tag":4586,"props":4707,"children":4708},{"disabled":1143,"type":4588},[],{"type":45,"value":533},{"type":39,"tag":68,"props":4711,"children":4712},{},[4713],{"type":45,"value":4714},"LLM",{"type":45,"value":4716}," is appropriate for task complexity (don't use GPT-4 for classification)",{"type":39,"tag":108,"props":4718,"children":4720},{"className":4719},[4583],[4721,4724,4725,4730],{"type":39,"tag":4586,"props":4722,"children":4723},{"disabled":1143,"type":4588},[],{"type":45,"value":533},{"type":39,"tag":68,"props":4726,"children":4727},{},[4728],{"type":45,"value":4729},"Delegation",{"type":45,"value":4731}," is disabled unless genuinely needed",{"type":39,"tag":54,"props":4733,"children":4734},{},[],{"type":39,"tag":58,"props":4736,"children":4738},{"id":4737},"references",[4739],{"type":45,"value":4740},"References",{"type":39,"tag":48,"props":4742,"children":4743},{},[4744],{"type":45,"value":4745},"For deeper dives into specific topics, see:",{"type":39,"tag":104,"props":4747,"children":4748},{},[4749,4776],{"type":39,"tag":108,"props":4750,"children":4751},{},[4752,4758,4760,4766,4768,4774],{"type":39,"tag":435,"props":4753,"children":4755},{"href":4754},"references\u002Fcustom-tools.md",[4756],{"type":45,"value":4757},"Custom Tools",{"type":45,"value":4759}," — building your own tools with ",{"type":39,"tag":76,"props":4761,"children":4763},{"className":4762},[],[4764],{"type":45,"value":4765},"@tool",{"type":45,"value":4767}," decorator and ",{"type":39,"tag":76,"props":4769,"children":4771},{"className":4770},[],[4772],{"type":45,"value":4773},"BaseTool",{"type":45,"value":4775}," subclass",{"type":39,"tag":108,"props":4777,"children":4778},{},[4779,4785],{"type":39,"tag":435,"props":4780,"children":4782},{"href":4781},"references\u002Fmemory-and-knowledge.md",[4783],{"type":45,"value":4784},"Memory & Knowledge",{"type":45,"value":4786}," — memory configuration, knowledge sources, embedder setup, scoping",{"type":39,"tag":48,"props":4788,"children":4789},{},[4790],{"type":45,"value":4791},"For related skills:",{"type":39,"tag":104,"props":4793,"children":4794},{},[4795,4805,4814],{"type":39,"tag":108,"props":4796,"children":4797},{},[4798,4803],{"type":39,"tag":68,"props":4799,"children":4800},{},[4801],{"type":45,"value":4802},"getting-started",{"type":45,"value":4804}," — project scaffolding, choosing the right abstraction, Flow architecture",{"type":39,"tag":108,"props":4806,"children":4807},{},[4808,4812],{"type":39,"tag":68,"props":4809,"children":4810},{},[4811],{"type":45,"value":81},{"type":45,"value":4813}," — task description\u002Fexpected_output best practices, guardrails, structured output, dependencies",{"type":39,"tag":108,"props":4815,"children":4816},{},[4817,4822],{"type":39,"tag":68,"props":4818,"children":4819},{},[4820],{"type":45,"value":4821},"ask-docs",{"type":45,"value":4823}," — query the live CrewAI documentation MCP server for questions not covered by these skills",{"type":39,"tag":4825,"props":4826,"children":4827},"style",{},[4828],{"type":45,"value":4829},"html .light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html.light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html.dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}",{"items":4831,"total":343},[4832,4847,4853,4862],{"slug":4821,"name":4821,"fn":4833,"description":4834,"org":4835,"tags":4836,"stars":23,"repoUrl":24,"updatedAt":4846},"retrieve CrewAI documentation","Query the official CrewAI documentation for answers. Use when the user has a CrewAI question that isn't fully covered by the getting-started, design-agent, design-task skills — e.g., specific API details, configuration options, advanced features, troubleshooting errors, enterprise features, tool references, or anything where the latest docs are the best source of truth.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},[4837,4840,4843],{"name":4838,"slug":4839,"type":16},"Documentation","documentation",{"name":4841,"slug":4842,"type":16},"Reference","reference",{"name":4844,"slug":4845,"type":16},"Research","research","2026-07-12T08:01:01.496655",{"slug":4,"name":4,"fn":5,"description":6,"org":4848,"tags":4849,"stars":23,"repoUrl":24,"updatedAt":25},{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},[4850,4851,4852],{"name":18,"slug":19,"type":16},{"name":14,"slug":15,"type":16},{"name":21,"slug":22,"type":16},{"slug":81,"name":81,"fn":4854,"description":4855,"org":4856,"tags":4857,"stars":23,"repoUrl":24,"updatedAt":4861},"design and configure CrewAI tasks","CrewAI task design and configuration. Use when creating, configuring, or debugging crewAI tasks — writing descriptions and expected_output, setting up task dependencies with context, configuring output formats (output_pydantic, output_json, output_file), using guardrails for validation, enabling human_input, async execution, markdown formatting, or debugging task execution issues.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},[4858,4859,4860],{"name":18,"slug":19,"type":16},{"name":14,"slug":15,"type":16},{"name":21,"slug":22,"type":16},"2026-07-12T08:01:02.968248",{"slug":4802,"name":4802,"fn":4863,"description":4864,"org":4865,"tags":4866,"stars":23,"repoUrl":24,"updatedAt":4872},"scaffold and architect CrewAI projects","CrewAI architecture decisions and project scaffolding. Use when starting a new crewAI project, choosing between LLM.call() vs Agent.kickoff() vs Crew.kickoff() vs Flow, scaffolding with 'crewai create flow', setting up YAML config (agents.yaml, tasks.yaml), wiring @CrewBase crew.py, writing Flow main.py with @start\u002F@listen, building experimental conversational Flows with handle_turn()\u002Fchat(), or using {variable} interpolation.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},[4867,4868,4871],{"name":18,"slug":19,"type":16},{"name":4869,"slug":4870,"type":16},"Architecture","architecture",{"name":14,"slug":15,"type":16},"2026-07-12T08:01:05.536802",{"items":4874,"total":343},[4875,4881,4887,4893],{"slug":4821,"name":4821,"fn":4833,"description":4834,"org":4876,"tags":4877,"stars":23,"repoUrl":24,"updatedAt":4846},{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},[4878,4879,4880],{"name":4838,"slug":4839,"type":16},{"name":4841,"slug":4842,"type":16},{"name":4844,"slug":4845,"type":16},{"slug":4,"name":4,"fn":5,"description":6,"org":4882,"tags":4883,"stars":23,"repoUrl":24,"updatedAt":25},{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},[4884,4885,4886],{"name":18,"slug":19,"type":16},{"name":14,"slug":15,"type":16},{"name":21,"slug":22,"type":16},{"slug":81,"name":81,"fn":4854,"description":4855,"org":4888,"tags":4889,"stars":23,"repoUrl":24,"updatedAt":4861},{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},[4890,4891,4892],{"name":18,"slug":19,"type":16},{"name":14,"slug":15,"type":16},{"name":21,"slug":22,"type":16},{"slug":4802,"name":4802,"fn":4863,"description":4864,"org":4894,"tags":4895,"stars":23,"repoUrl":24,"updatedAt":4872},{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},[4896,4897,4898],{"name":18,"slug":19,"type":16},{"name":4869,"slug":4870,"type":16},{"name":14,"slug":15,"type":16}]