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

# Research Workflow - A Deterministic Research Pipeline

> A Team decides how to coordinate; a Workflow runs the same ordered steps every time.

A Team decides how to coordinate; a Workflow runs the same ordered steps every time. This pipeline always: (1) gathers sources with Parallel Search and Extract, then (2) synthesizes a cited brief from what it found.

```python research_workflow.py theme={null}
"""
Research Workflow - A Deterministic Research Pipeline
=====================================================

A Team decides how to coordinate; a Workflow runs the same ordered steps
every time. This pipeline always: (1) gathers sources with Parallel Search
and Extract, then (2) synthesizes a cited brief from what it found.

Use a workflow when you want a repeatable, auditable research process.

Prerequisites:
- pip install parallel-web
- export PARALLEL_API_KEY=<your-api-key>
"""

from agno.agent import Agent
from agno.db.sqlite import SqliteDb
from agno.models.openai import OpenAIResponses
from agno.tools.parallel import ParallelTools
from agno.workflow.step import Step
from agno.workflow.workflow import Workflow

# ---------------------------------------------------------------------------
# Setup - step agents
# ---------------------------------------------------------------------------
# Step 1: gather raw material from the web.
source_gatherer = Agent(
    name="Source Gatherer",
    model=OpenAIResponses(id="gpt-5.4"),
    tools=[ParallelTools(enable_search=True, enable_extract=True)],
    instructions=[
        "Search the web for the topic and gather the most relevant sources.",
        "Return key facts as bullet points, each with its source URL.",
    ],
)

# Step 2: turn the raw material into a clean, cited brief.
report_writer = Agent(
    name="Report Writer",
    model=OpenAIResponses(id="gpt-5.4"),
    instructions=[
        "Write a concise research brief from the gathered sources.",
        "Keep every claim tied to a source URL.",
    ],
    markdown=True,
)

# ---------------------------------------------------------------------------
# Create the Workflow
# ---------------------------------------------------------------------------
research_pipeline = Workflow(
    name="Research Pipeline",
    description="Gather sources, then synthesize a cited research brief.",
    db=SqliteDb(db_file="tmp/parallel_workflow.db"),
    steps=[
        Step(name="Gather Sources", agent=source_gatherer),
        Step(name="Write Brief", agent=report_writer),
    ],
)

# ---------------------------------------------------------------------------
# Run the Workflow
# ---------------------------------------------------------------------------
if __name__ == "__main__":
    research_pipeline.print_response(
        input="How are AI agents changing web search in 2026?",
        markdown=True,
    )
```

## Run the Example

<Steps>
  <Snippet file="create-venv-step.mdx" />

  <Step title="Install dependencies">
    ```bash theme={null}
    uv pip install -U agno fastapi openai parallel-web sqlalchemy
    ```
  </Step>

  <Step title="Export your API keys">
    <CodeGroup>
      ```bash Mac/Linux theme={null}
      export OPENAI_API_KEY="your_openai_api_key_here"
      export PARALLEL_API_KEY="your_parallel_api_key_here"
      ```

      ```bash Windows theme={null}
      $Env:OPENAI_API_KEY="your_openai_api_key_here"
      $Env:PARALLEL_API_KEY="your_parallel_api_key_here"
      ```
    </CodeGroup>
  </Step>

  <Step title="Run the example">
    Save the code above as `research_workflow.py`, then run:

    ```bash theme={null}
    python research_workflow.py
    ```
  </Step>
</Steps>

Full source: [cookbook/integrations/parallel/07\_research\_workflow.py](https://github.com/agno-agi/agno/blob/main/cookbook/integrations/parallel/07_research_workflow.py)
