design-task

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

CrewAI Task Design Guide

CrewAI任务设计指南

How to write effective tasks that produce reliable, high-quality output from your agents.

如何编写能让Agent生成可靠、高质量输出的有效任务。

The 80/20 Rule

80/20原则

Spend 80% of your effort on task design, 20% on agent design. The task is the most important lever you have. A well-designed task with a mediocre agent will outperform a poorly designed task with an excellent agent.

**将80%的精力投入到任务设计中,20%投入到Agent设计中。**任务是你手中最重要的抓手。一个设计精良的任务搭配普通的Agent,表现会优于设计糟糕的任务搭配优秀的Agent。

1. Anatomy of an Effective Task

1. 有效任务的核心构成

Every task needs two things: a description (what to do and how) and an expected_output (what the result looks like).
每个任务都需要两个要素:描述(description)(做什么以及怎么做)和预期输出(expected_output)(结果的呈现形式)。

Description — The Instructions

描述——执行指令

A good description includes:
  1. What to do — the core action
  2. How to do it — specific steps or approach
  3. Context — why this matters, what it feeds into
  4. Constraints — scope limits, things to avoid
  5. Inputs — what data or context is available
yaml
research_task:
  description: >
    Conduct thorough research about {topic} for the year {current_year}.

    Your research should:
    1. Identify the top 5 key trends and breakthroughs
    2. For each trend, find at least 2 credible sources
    3. Note any controversies or competing viewpoints
    4. Assess potential industry impact (high/medium/low)

    Focus on developments from the last 6 months.
    Do NOT include speculation or unverified claims.
    The output will feed into a report for {target_audience}.
  expected_output: >
    A structured research brief with 5 sections, one per trend.
    Each section includes: trend name, 2-3 paragraph summary,
    source citations, impact assessment (high/medium/low),
    and a confidence level for your findings.
  agent: researcher
一份优质的描述应包含:
  1. 内容——核心动作
  2. 方式——具体步骤或方法
  3. 上下文——任务的重要性、产出的用途
  4. 约束条件——范围限制、需要规避的内容
  5. 输入——可用的数据或上下文信息
yaml
research_task:
  description: >
    Conduct thorough research about {topic} for the year {current_year}.

    Your research should:
    1. Identify the top 5 key trends and breakthroughs
    2. For each trend, find at least 2 credible sources
    3. Note any controversies or competing viewpoints
    4. Assess potential industry impact (high/medium/low)

    Focus on developments from the last 6 months.
    Do NOT include speculation or unverified claims.
    The output will feed into a report for {target_audience}.
  expected_output: >
    A structured research brief with 5 sections, one per trend.
    Each section includes: trend name, 2-3 paragraph summary,
    source citations, impact assessment (high/medium/low),
    and a confidence level for your findings.
  agent: researcher

Expected Output — The Success Criteria

预期输出——成功标准

The
expected_output
tells the agent what "done" looks like. Be specific about:
  • Format — bullet points, paragraphs, JSON, table
  • Structure — sections, headings, order
  • Length — approximate word count or number of items
  • Quality markers — citations required, confidence levels, specific fields
Bad Expected OutputGood Expected Output
A research report
A structured brief with 5 sections, each containing: trend name, 2-3 paragraph summary, source citations, and impact rating
An analysis of the data
A markdown table with columns: metric name, current value, 30-day trend, and recommended action. Include at least 10 metrics.
A blog post
A 1000-1500 word technical blog post with: title, introduction, 3-4 main sections with code examples, and a conclusion with next steps

expected_output
告诉Agent什么是“完成状态”。需要明确指定:
  • 格式——项目符号、段落、JSON、表格
  • 结构——章节、标题、顺序
  • 篇幅——大致字数或条目数量
  • 质量指标——是否需要引用、置信度、特定字段
糟糕的预期输出优质的预期输出
A research report
A structured brief with 5 sections, each containing: trend name, 2-3 paragraph summary, source citations, and impact rating
An analysis of the data
A markdown table with columns: metric name, current value, 30-day trend, and recommended action. Include at least 10 metrics.
A blog post
A 1000-1500 word technical blog post with: title, introduction, 3-4 main sections with code examples, and a conclusion with next steps

2. The Single Purpose Principle

2. 单一目标原则

One task = one objective. Never combine multiple operations into a single task.
一个任务=一个明确目标。切勿在单个任务中合并多项操作。

Bad: "God Task"

反面示例:“全能任务”

yaml
undefined
yaml
undefined

DON'T do this — too many objectives in one task

请勿这样做——单个任务包含过多目标

research_and_write_task: description: > Research {topic}, analyze the findings, write a blog post, and proofread it for grammar errors. expected_output: > A polished blog post about {topic}.
undefined
research_and_write_task: description: > Research {topic}, analyze the findings, write a blog post, and proofread it for grammar errors. expected_output: > A polished blog post about {topic}.
undefined

Good: Focused Tasks

正面示例:聚焦型任务

yaml
research_task:
  description: >
    Research {topic} and identify the top 5 key developments.
  expected_output: >
    A research brief with 5 sections covering key trends.
  agent: researcher

writing_task:
  description: >
    Using the research findings, write a technical blog post about {topic}.
  expected_output: >
    A 1000-1500 word blog post with introduction, main sections,
    and conclusion. Include code examples where relevant.
  agent: writer

editing_task:
  description: >
    Review and edit the blog post for grammar, clarity, and consistency.
  expected_output: >
    The final edited blog post with all corrections applied.
    Include a brief editor's note listing what was changed.
  agent: editor
Each task has one clear objective. The sequential flow passes context automatically.

yaml
research_task:
  description: >
    Research {topic} and identify the top 5 key developments.
  expected_output: >
    A research brief with 5 sections covering key trends.
  agent: researcher

writing_task:
  description: >
    Using the research findings, write a technical blog post about {topic}.
  expected_output: >
    A 1000-1500 word blog post with introduction, main sections,
    and conclusion. Include code examples where relevant.
  agent: writer

editing_task:
  description: >
    Review and edit the blog post for grammar, clarity, and consistency.
  expected_output: >
    The final edited blog post with all corrections applied.
    Include a brief editor's note listing what was changed.
  agent: editor
每个任务都有一个清晰的目标。任务的顺序流转会自动传递上下文信息。

3. Task Configuration Reference

3. 任务配置参考

Essential Parameters

核心参数

python
Task(
    description="...",          # Required: what to do
    expected_output="...",      # Required: what the result looks like
    agent=researcher,           # Optional for hierarchical process; required for sequential
)
python
Task(
    description="...",          # 必填:任务内容
    expected_output="...",      # 必填:结果呈现形式
    agent=researcher,           # 分层流程可选;顺序流程必填
)

Task Dependencies with
context

基于
context
的任务依赖

python
analysis_task = Task(
    description="Analyze the research findings...",
    expected_output="...",
    agent=analyst,
    context=[research_task],    # Receives research_task's output as context
)
In sequential process: Each task auto-receives all prior task outputs. Use
context
only when you need non-linear dependencies.
In hierarchical process:
context
is how you create explicit data flow between tasks.
python
analysis_task = Task(
    description="Analyze the research findings...",
    expected_output="...",
    agent=analyst,
    context=[research_task],    # 接收research_task的输出作为上下文
)
**在顺序流程中:**每个任务会自动接收所有前置任务的输出。仅当需要非线性依赖时才使用
context
在分层流程中:
context
是创建任务间明确数据流的方式。

Structured Output

结构化输出

Use
output_pydantic
or
output_json
when downstream code needs to parse the result:
python
from pydantic import BaseModel

class ResearchReport(BaseModel):
    trends: list[str]
    confidence: float
    sources: list[str]

research_task = Task(
    description="...",
    expected_output="A structured report with trends, confidence score, and sources.",
    agent=researcher,
    output_pydantic=ResearchReport,   # Agent's output is parsed into this model
)
Important:
expected_output
is always a string description — never a class name. The Pydantic model goes in
output_pydantic
, and the
expected_output
text tells the agent what fields to include.
Access structured output:
python
result = crew.kickoff(inputs={...})
last_task_output = result.pydantic          # Pydantic model from the last task
all_outputs = result.tasks_output           # List of all TaskOutput objects
first_task = all_outputs[0].pydantic        # Pydantic from a specific task
当下游代码需要解析任务结果时,使用
output_pydantic
output_json
python
from pydantic import BaseModel

class ResearchReport(BaseModel):
    trends: list[str]
    confidence: float
    sources: list[str]

research_task = Task(
    description="...",
    expected_output="A structured report with trends, confidence score, and sources.",
    agent=researcher,
    output_pydantic=ResearchReport,   # Agent的输出会被解析为该模型
)
重要提示:
expected_output
始终是字符串描述——绝不能是类名。Pydantic模型应配置在
output_pydantic
中,
expected_output
文本需告知Agent需要包含哪些字段。
访问结构化输出:
python
result = crew.kickoff(inputs={...})
last_task_output = result.pydantic          # 最后一个任务的Pydantic模型
all_outputs = result.tasks_output           # 所有TaskOutput对象的列表
first_task = all_outputs[0].pydantic        # 特定任务的Pydantic模型

File Output

文件输出

python
Task(
    ...,
    output_file="output/report.md",    # Save output to file
    create_directory=True,             # Create directory if missing (default: True)
)
File output and structured output can be combined — the file gets the raw text, and
output_pydantic
gets the parsed model.
python
Task(
    ...,
    output_file="output/report.md",    # 将输出保存到文件
    create_directory=True,             # 若目录不存在则创建(默认:True)
)
文件输出与结构化输出可结合使用——文件保存原始文本,
output_pydantic
保存解析后的模型。

Async Execution

异步执行

python
Task(
    ...,
    async_execution=True,     # Run without blocking the next task
)
Use for tasks that can run in parallel. The crew continues to the next task while this one executes. Use
context
on downstream tasks to wait for async results.
python
Task(
    ...,
    async_execution=True,     # 非阻塞执行,不等待当前任务完成即可启动下一个任务
)
适用于可并行执行的任务。Crew会在当前任务执行时继续运行下一个任务。若下游任务需要等待异步任务结果,可使用
context

Human Review

人工审核

python
Task(
    ...,
    human_input=True,         # Pause for human review before finalizing
)
When enabled, the agent presents its result and waits for human feedback before marking the task complete. Use for critical outputs that need human approval.
python
Task(
    ...,
    human_input=True,         # 在任务完成前暂停,等待人工审核
)
启用后,Agent会提交结果并等待人工反馈,之后才会标记任务完成。适用于需要人工确认的关键输出。

Markdown Formatting

Markdown格式化

python
Task(
    ...,
    markdown=True,            # Add markdown formatting instructions
)
Automatically instructs the agent to format output with proper markdown headers, lists, emphasis, and code blocks.
python
Task(
    ...,
    markdown=True,            # 添加Markdown格式化指令
)
自动指示Agent使用标准的Markdown标题、列表、强调和代码块来格式化输出。

Callbacks

回调函数

python
def log_completion(output):
    print(f"Task completed: {output.description[:50]}...")
    save_to_database(output.raw)

Task(
    ...,
    callback=log_completion,  # Called after task completion
)

python
def log_completion(output):
    print(f"Task completed: {output.description[:50]}...")
    save_to_database(output.raw)

Task(
    ...,
    callback=log_completion,  # 任务完成后调用
)

4. Task Guardrails — Quality Control

4. 任务防护机制——质量控制

Guardrails validate task output before it passes to the next step. If validation fails, the agent retries.
防护机制会在任务输出传递到下一个步骤前进行验证。若验证失败,Agent会重试任务。

Function-Based Guardrails

基于函数的防护机制

python
def validate_word_count(output) -> tuple[bool, Any]:
    """Ensure output is between 500-2000 words."""
    word_count = len(output.raw.split())
    if word_count < 500:
        return (False, f"Output too short ({word_count} words). Expand to at least 500 words.")
    if word_count > 2000:
        return (False, f"Output too long ({word_count} words). Condense to under 2000 words.")
    return (True, output)

Task(
    ...,
    guardrail=validate_word_count,
    guardrail_max_retries=3,       # Max retry attempts (default: 3)
)
Return format:
(bool, Any)
— first element is pass/fail, second is the result (on success) or error message (on failure).
python
def validate_word_count(output) -> tuple[bool, Any]:
    """确保输出字数在500-2000之间。"""
    word_count = len(output.raw.split())
    if word_count < 500:
        return (False, f"Output too short ({word_count} words). Expand to at least 500 words.")
    if word_count > 2000:
        return (False, f"Output too long ({word_count} words). Condense to under 2000 words.")
    return (True, output)

Task(
    ...,
    guardrail=validate_word_count,
    guardrail_max_retries=3,       # 最大重试次数(默认:3)
)
返回格式:
(bool, Any)
——第一个元素表示验证是否通过,第二个元素是验证通过后的结果(或验证失败时的错误信息)。

LLM-Based Guardrails

基于大语言模型(LLM)的防护机制

python
Task(
    ...,
    guardrail="Verify the output contains at least 3 source citations and no speculative claims.",
)
String guardrails use the agent's LLM to evaluate the output. Good for subjective quality checks.
python
Task(
    ...,
    guardrail="Verify the output contains at least 3 source citations and no speculative claims.",
)
字符串形式的防护机制会使用Agent的LLM来评估输出,适用于主观质量检查。

Chaining Multiple Guardrails

多防护机制链式调用

python
Task(
    ...,
    guardrails=[
        validate_word_count,           # Function: check length
        validate_no_pii,               # Function: check for PII
        "Ensure the tone is professional and appropriate for a business audience.",  # LLM check
    ],
    guardrail_max_retries=3,
)
Guardrails execute sequentially. Each receives the output of the previous guardrail. Mix function-based (deterministic) and LLM-based (subjective) checks.

python
Task(
    ...,
    guardrails=[
        validate_word_count,           # 函数:检查字数
        validate_no_pii,               # 函数:检查是否包含个人可识别信息
        "Ensure the tone is professional and appropriate for a business audience.",  # LLM检查
    ],
    guardrail_max_retries=3,
)
防护机制会按顺序执行,每个防护机制接收上一个防护机制处理后的输出。可结合基于函数的(确定性)和基于LLM的(主观性)检查。

5. YAML Configuration (Recommended)

5. YAML配置(推荐方式)

tasks.yaml

tasks.yaml

yaml
research_task:
  description: >
    Conduct thorough research about {topic} for {current_year}.
    Identify key trends, breakthrough technologies,
    and potential industry impacts.
    Focus on the last 6 months of developments.
  expected_output: >
    A structured research brief with 5 sections.
    Each section: trend name, 2-3 paragraph summary,
    source citations, and impact assessment.
  agent: researcher

analysis_task:
  description: >
    Analyze the research findings and create actionable recommendations
    for {target_audience}.
  expected_output: >
    A prioritized list of 5 recommendations with:
    rationale, estimated effort, and expected impact.
  agent: analyst
  context:
    - research_task

report_task:
  description: >
    Compile a final report combining research and analysis for {target_audience}.
  expected_output: >
    A polished markdown report with executive summary,
    detailed findings, recommendations, and appendices.
  agent: writer
  output_file: output/report.md
yaml
research_task:
  description: >
    Conduct thorough research about {topic} for {current_year}.
    Identify key trends, breakthrough technologies,
    and potential industry impacts.
    Focus on the last 6 months of developments.
  expected_output: >
    A structured research brief with 5 sections.
    Each section: trend name, 2-3 paragraph summary,
    source citations, and impact assessment.
  agent: researcher

analysis_task:
  description: >
    Analyze the research findings and create actionable recommendations
    for {target_audience}.
  expected_output: >
    A prioritized list of 5 recommendations with:
    rationale, estimated effort, and expected impact.
  agent: analyst
  context:
    - research_task

report_task:
  description: >
    Compile a final report combining research and analysis for {target_audience}.
  expected_output: >
    A polished markdown report with executive summary,
    detailed findings, recommendations, and appendices.
  agent: writer
  output_file: output/report.md

Wiring in crew.py

在crew.py中关联配置

python
@CrewBase
class ResearchCrew:
    agents_config = "config/agents.yaml"
    tasks_config = "config/tasks.yaml"

    @task
    def research_task(self) -> Task:
        return Task(config=self.tasks_config["research_task"])

    @task
    def analysis_task(self) -> Task:
        return Task(
            config=self.tasks_config["analysis_task"],
            context=[self.research_task()],
        )

    @task
    def report_task(self) -> Task:
        return Task(
            config=self.tasks_config["report_task"],
            output_file="output/report.md",
        )
Critical: The method name (
def research_task
) must match the YAML key (
research_task:
).

python
@CrewBase
class ResearchCrew:
    agents_config = "config/agents.yaml"
    tasks_config = "config/tasks.yaml"

    @task
    def research_task(self) -> Task:
        return Task(config=self.tasks_config["research_task"])

    @task
    def analysis_task(self) -> Task:
        return Task(
            config=self.tasks_config["analysis_task"],
            context=[self.research_task()],
        )

    @task
    def report_task(self) -> Task:
        return Task(
            config=self.tasks_config["report_task"],
            output_file="output/report.md",
        )
**关键提示:**方法名称(
def research_task
)必须与YAML中的键名(
research_task:
)完全匹配。

6. Task Dependencies and Context Flow

6. 任务依赖与上下文流转

Sequential Process (Default)

顺序流程(默认)

In
Process.sequential
, tasks run in order. Each task automatically receives all prior task outputs as context.
research_task → analysis_task → report_task
     ↓               ↓              ↓
  output 1    output 1 + 2    output 1 + 2 + 3
You don't need
context=
in sequential — it's implicit. Use it only to create non-linear dependencies:
python
undefined
Process.sequential
模式下,任务按顺序执行。每个任务会自动接收所有前置任务的输出作为上下文。
research_task → analysis_task → report_task
     ↓               ↓              ↓
  输出1    输出1+2    输出1+2+3
在顺序流程中无需使用
context=
——这是隐式的。仅当需要创建非线性依赖时才使用:
python
undefined

Task C depends on A but NOT B

任务C依赖任务A,但不依赖任务B

task_c = Task( ..., context=[task_a], # Only receives task_a output, not task_b )
undefined
task_c = Task( ..., context=[task_a], # 仅接收任务A的输出,不接收任务B的 )
undefined

Explicit Dependencies

显式依赖

python
undefined
python
undefined

Diamond dependency pattern

菱形依赖模式

task_a = Task(...) # Entry point task_b = Task(..., context=[task_a]) # Depends on A task_c = Task(..., context=[task_a]) # Also depends on A task_d = Task(..., context=[task_b, task_c]) # Depends on both B and C
undefined
task_a = Task(...) # 入口任务 task_b = Task(..., context=[task_a]) # 依赖任务A task_c = Task(..., context=[task_a]) # 同样依赖任务A task_d = Task(..., context=[task_b, task_c]) # 依赖任务B和任务C
undefined

Conditional Tasks

条件任务

python
from crewai.task import ConditionalTask

def needs_more_data(output) -> bool:
    return len(output.pydantic.items) < 10

extra_research = ConditionalTask(
    description="Fetch additional data sources...",
    expected_output="...",
    agent=researcher,
    condition=needs_more_data,  # Only runs if previous output has < 10 items
)

python
from crewai.task import ConditionalTask

def needs_more_data(output) -> bool:
    return len(output.pydantic.items) < 10

extra_research = ConditionalTask(
    description="Fetch additional data sources...",
    expected_output="...",
    agent=researcher,
    condition=needs_more_data,  # 仅当前置任务输出的条目数<10时才运行
)

7. Task Tools

7. 任务工具

Tasks can have their own tools that override the agent's default tools for that specific task:
python
from crewai_tools import SerperDevTool, ScrapeWebsiteTool

Task(
    description="Search for and scrape the top 5 articles about {topic}...",
    expected_output="...",
    agent=researcher,
    tools=[SerperDevTool(), ScrapeWebsiteTool()],  # Task-specific tools
)
When to use task-level tools:
  • The task needs tools the agent doesn't normally have
  • You want to restrict an agent to specific tools for this task
  • Different tasks by the same agent need different tool sets

任务可拥有独立的工具,覆盖Agent的默认工具,仅适用于该任务:
python
from crewai_tools import SerperDevTool, ScrapeWebsiteTool

Task(
    description="Search for and scrape the top 5 articles about {topic}...",
    expected_output="...",
    agent=researcher,
    tools=[SerperDevTool(), ScrapeWebsiteTool()],  # 任务专属工具
)
何时使用任务级工具:
  • 任务需要Agent默认未配置的工具
  • 希望限制Agent在该任务中仅使用特定工具
  • 同一Agent执行的不同任务需要不同的工具集

8. Variable Interpolation

8. 变量插值

Use
{variable}
placeholders in YAML for reusable tasks:
yaml
research_task:
  description: >
    Research {topic} trends for {current_year},
    targeting {target_audience}.
  expected_output: >
    A report on {topic} suitable for {target_audience}.
Variables are replaced when you call
crew.kickoff(inputs={...})
:
python
crew.kickoff(inputs={
    "topic": "AI Agents",
    "current_year": "2025",
    "target_audience": "developers",
})
Common mistakes:
  • Missing variable in
    inputs
    → literal
    {variable}
    appears in the prompt
  • Using
    {{ }}
    Jinja2 syntax → crewAI uses single braces
    { }
  • Unused variables in
    inputs
    → silently ignored (no error)

在YAML中使用
{variable}
占位符实现任务复用:
yaml
research_task:
  description: >
    Research {topic} trends for {current_year},
    targeting {target_audience}.
  expected_output: >
    A report on {topic} suitable for {target_audience}.
调用
crew.kickoff(inputs={...})
时会替换变量:
python
crew.kickoff(inputs={
    "topic": "AI Agents",
    "current_year": "2025",
    "target_audience": "developers",
})
常见错误:
  • inputs
    中缺少对应变量→输出中会保留
    {variable}
    字面量
  • 使用
    {{ }}
    Jinja2语法→CrewAI仅支持单大括号
    { }
  • inputs
    中存在未使用的变量→会被静默忽略(无错误提示)

9. Common Task Design Mistakes

9. 任务设计常见错误

MistakeImpactFix
Vague description ("Research the topic")Agent produces shallow, unfocused outputAdd specific steps, constraints, and context
Vague expected_output ("A report")Agent guesses at format and structureSpecify format, sections, length, quality markers
Multiple objectives in one taskAgent does all of them poorlySplit into focused single-purpose tasks
No context between dependent tasksAgent lacks information from prior stepsUse
context=[prior_task]
for explicit dependencies
expected_output
references a Pydantic class
Agent sees a class name string, not field namesKeep
expected_output
as a human-readable string; use
output_pydantic
for the model
Missing tools for data tasksAgent fabricates data instead of fetching itAdd tools to the task or agent
No guardrails on critical outputBad output flows downstream uncheckedAdd function or LLM guardrails
Overly strict expected_outputAgent loops trying to match impossible criteriaBe specific but achievable; lower
guardrail_max_retries
to fail faster
Description duplicates backstoryWasted tokens and confused agentDescription = what to do; backstory = who you are

错误影响修复方案
描述模糊(如“研究该主题”)Agent产出的内容浅显、缺乏聚焦添加具体步骤、约束条件和上下文
预期输出模糊(如“一份报告”)Agent需要猜测格式和结构明确指定格式、章节、篇幅和质量指标
单个任务包含多个目标Agent所有目标都完成得很差拆分为多个聚焦单一目标的任务
依赖任务间无上下文传递Agent缺少前置步骤的关键信息使用
context=[prior_task]
设置显式依赖
expected_output
引用Pydantic类
Agent看到的是类名字符串,而非字段名
expected_output
保持为人类可读的字符串;使用
output_pydantic
配置模型
数据类任务缺少工具Agent会编造数据而非获取真实数据为任务或Agent添加对应工具
关键输出未设置防护机制错误输出会直接流入下游任务添加函数或LLM防护机制
预期输出过于严苛Agent会陷入循环尝试匹配不可能的标准明确但设置可实现的要求;降低
guardrail_max_retries
以快速终止重试
描述重复背景信息浪费Tokens且混淆Agent描述=任务内容;背景=Agent的角色设定

10. Task Design Checklist

10. 任务设计检查清单

Before running a task, verify:
  • Description includes what, how, context, and constraints
  • Expected output specifies format, structure, and quality markers
  • Single purpose — one clear objective per task
  • Agent assigned (or task is in a hierarchical crew)
  • Dependencies set via
    context
    where needed
  • Tools provided for any task requiring external data
  • Structured output configured if downstream code parses the result
  • Guardrails set for critical outputs
  • Variables in YAML match the
    inputs
    dict keys
  • Expected output is achievable — test with a simple run before adding complexity

在运行任务前,验证以下内容:
  • 描述包含任务内容、执行方式、上下文和约束条件
  • 预期输出指定了格式、结构和质量指标
  • 单一目标——每个任务仅有一个清晰的目标
  • 已分配Agent(或任务属于分层Crew)
  • 依赖关系已通过
    context
    正确设置(若需要)
  • 已提供工具给需要外部数据的任务
  • 已配置结构化输出(若下游代码需要解析结果)
  • 关键输出已设置防护机制
  • YAML中的变量
    inputs
    字典的键名匹配
  • 预期输出可实现——在添加复杂度前先通过简单运行测试

References

参考资料

For deeper dives into specific topics, see:
  • Structured Output
    output_pydantic
    ,
    output_json
    , and
    response_format
    patterns across LLM, Agent, Task, and Crew levels
For related skills:
  • getting-started — project scaffolding, choosing the right abstraction, Flow architecture
  • design-agent — agent Role-Goal-Backstory framework, parameter tuning, tool assignment, memory & knowledge configuration
如需深入了解特定主题,请查看:
  • 结构化输出——在LLM、Agent、Task和Crew层面的
    output_pydantic
    output_json
    response_format
    模式
相关技能:
  • getting-started——项目脚手架搭建、选择合适的抽象层、Flow架构
  • design-agent——Agent的Role-Goal-Backstory框架、参数调优、工具分配、记忆与知识配置