> ## Documentation Index
> Fetch the complete documentation index at: https://praison.ai/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Simple Sequential Team (YAML)

> The copy-paste starting point for a multi-agent team that runs tasks in order

Two agents run in order: a researcher gathers facts, then a writer summarizes them.

```mermaid theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
graph LR
    subgraph "Sequential Team"
        R[🤖 Researcher\nresearch_task] --> W[🤖 Writer\nsummary_task]
        W --> OUT[✅ Summary]
    end

    classDef agent fill:#8B0000,stroke:#7C90A0,color:#fff
    classDef output fill:#10B981,stroke:#7C90A0,color:#fff

    class R,W agent
    class OUT output
```

## Quick Start

**1. Drop the YAML in place**

Save this as `agents.yaml` in an empty folder. Tasks run in the order they are declared — the researcher's task first, then the writer's.

```yaml theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
# yaml-language-server: $schema=https://docs.praison.ai/schemas/agents.schema.json
# Minimal sequential team: researcher -> writer
# Run: praisonai agents.yaml

framework: "praisonai"
topic: "renewable energy"

roles:
  researcher:
    role: "Senior Researcher"
    goal: "Find accurate information about {topic}"
    backstory: "Expert at concise, factual research."
    tasks:
      research_task:
        description: "Research {topic} and list 5 key facts."
        expected_output: "A bullet list of 5 facts."

  writer:
    role: "Report Writer"
    goal: "Turn research into readable summaries about {topic}"
    backstory: "Clear technical writer."
    tasks:
      summary_task:
        description: "Write a 3-sentence executive summary from the research."
        expected_output: "3 sentences, plain text."

# Ordering is by task declaration order above (researcher's task runs first,
# then the writer's), which is how the roles-file loader sequences tasks.
# The optional `dependencies:` block below documents intent; the roles-file
# loader does not consume it, so keep tasks in the order you want them run.
dependencies:
  - task: summary_task
    depends_on: research_task
```

**2. Run it**

Set your API key and run the file with the `praisonai` CLI:

```bash theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
export OPENAI_API_KEY=sk-...
praisonai agents.yaml
```

Change the subject by editing the `topic:` line — it is interpolated into every `{topic}` placeholder.

***

## How It Works

```mermaid theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
sequenceDiagram
    participant User
    participant CLI as praisonai CLI
    participant Researcher
    participant Writer

    User->>CLI: praisonai agents.yaml
    CLI->>Researcher: research_task (runs first)
    Researcher-->>CLI: 5 facts
    CLI->>Writer: summary_task (runs next)
    Writer-->>CLI: 3-sentence summary
    CLI-->>User: final output
```

| Fact | Detail |
| - | - |
| Where tasks live | `roles.<role>.tasks.<task_name>` — each role owns its tasks |
| Ordering | By **declaration order**, not the optional top-level `dependencies:` block. The roles-file loader (`AgentsGenerator.generate_crew_and_kickoff` in `praisonai/agents_generator.py`) does **not** consume `dependencies:`. |
| `{topic}` interpolation | The top-level `topic:` value is substituted into every `{topic}` in role, goal, and task fields. |

> [!WARNING]
>
> The single-brace `{topic}` interpolation here belongs to the **roles-file YAML loader**. The Python `AgentTeam(variables={...})` path uses **double-brace** `{{key}}` placeholders instead — don't mix the two.

***

## Python equivalent

The same team using friendly top-level imports:

```python theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
from praisonaiagents import Agent, Task, PraisonAIAgents

researcher = Agent(role="Senior Researcher", goal="Find accurate information")
writer = Agent(role="Report Writer", goal="Turn research into summaries")

t1 = Task(description="Research renewable energy and list 5 key facts", agent=researcher)
t2 = Task(description="Write a 3-sentence summary from the research", agent=writer, context=[t1])

PraisonAIAgents(agents=[researcher, writer], tasks=[t1, t2]).start()
```

***

## When to use this vs a workflow YAML

| You need… | Use | Example |
| - | - | - |
| 2–5 agents, sequential / hierarchical | this recipe (`roles:` + nested `tasks:`) | this page |
| Routing by classifier output | workflow YAML | [Workflow Routing](https://praison.ai/docs/features/workflow-routing.md) |
| Parallel branches | workflow YAML | [Workflow Parallelization](https://praison.ai/docs/features/workflow-parallel.md) |
| Loops / planning / memory | workflow YAML | [YAML Workflows](https://praison.ai/docs/features/yaml-workflows.md) |

***

## Related

> [card] [YAML Workflows](https://praison.ai/docs/features/yaml-workflows.md)
>
> Loops, planning, memory, and routing in YAML

> [card] [Prompt Chaining](https://praison.ai/docs/features/promptchaining.md)
>
> Chain task outputs into the next step

> [card] [Multi-Agent Execution](https://praison.ai/docs/features/multi-agent-execution.md)
>
> Configure iteration and retry limits

> [card] [Multi-Agent Hooks](https://praison.ai/docs/features/multi-agent-hooks.md)
>
> Add lifecycle callbacks between tasks


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.