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.

Diagram

Sequential Team

πŸ€– Researcher\nresearch_task

πŸ€– Writer\nsummary_task

βœ… Summary

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
    # 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
    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

Diagram
WriterResearcherpraisonai CLIUserWriterResearcherpraisonai CLIUserpraisonai agents.yamlresearch_task (runs first)5 factssummary_task (runs next)3-sentence summaryfinal output
FactDetail
Where tasks liveroles.<role>.tasks.<task_name> β€” each role owns its tasks
OrderingBy 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} interpolationThe top-level topic: value is substituted into every {topic} in role, goal, and task fields.

Python equivalent

The same team using friendly top-level imports:

python
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…UseExample
2–5 agents, sequential / hierarchicalthis recipe (roles: + nested tasks:)this page
Routing by classifier outputworkflow YAMLWorkflow Routing
Parallel branchesworkflow YAMLWorkflow Parallelization
Loops / planning / memoryworkflow YAMLYAML Workflows

Related