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

# Research Agent

> Learn how to create AI agents for conducting comprehensive research and analysis.

```mermaid theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
flowchart LR
    In[Topic] --> Agent[Research Agent]
    Agent --> Out[Research Report]
    
    style In fill:#8B0000,color:#fff
    style Agent fill:#2E8B57,color:#fff
    style Out fill:#8B0000,color:#fff
```

Research agent with web search for comprehensive topic analysis and report generation.

***

## Simple

**Agents: 1** — Single agent handles search, analysis, and synthesis.

### Workflow

1. Receive research topic
2. Search web for relevant sources
3. Analyze and synthesize findings
4. Generate structured report

### Setup

```bash theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
pip install praisonaiagents praisonai duckduckgo-search
export OPENAI_API_KEY="your-key"
```

### Run — Python

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

agent = Agent(
    name="Researcher",
    instructions="You are a research agent. Search, analyze, and synthesize information.",
    tools=[duckduckgo]
)

result = agent.start("Research the current state of quantum computing in 2024")
print(result)
```

### Run — CLI

```bash theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
praisonai "Research quantum computing advances" --research --web-search
```

### Run — agents.yaml

```yaml theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
framework: praisonai
topic: Research Project
roles:
  researcher:
    role: Research Specialist
    goal: Conduct comprehensive research and analysis
    backstory: You are an expert researcher
    tools:
      - duckduckgo
    tasks:
      research_task:
        description: Research the current state of quantum computing in 2024
        expected_output: A comprehensive research report
```

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

### Serve API

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

agent = Agent(
    name="Researcher",
    instructions="You are a research agent.",
    tools=[duckduckgo]
)

agent.launch(port=8080)
```

```bash theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
curl -X POST http://localhost:8080/chat \
  -H "Content-Type: application/json" \
  -d '{"message": "Research electric vehicle market trends"}'
```

***

## Advanced Workflow (All Features)

**Agents: 1** — Single agent with memory, persistence, structured output, and session resumability.

### Workflow

1. Initialize session for resumable research context
2. Configure SQLite persistence for research history
3. Execute multi-source search with structured output
4. Store findings in memory for follow-up queries
5. Resume session to continue research

### Setup

```bash theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
pip install praisonaiagents praisonai duckduckgo-search pydantic
export OPENAI_API_KEY="your-key"
```

### Run — Python

```python theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
from praisonaiagents import Agent, Task, AgentTeam, Session
from praisonaiagents import duckduckgo
from pydantic import BaseModel

# Structured output schema
class ResearchReport(BaseModel):
    topic: str
    summary: str
    key_findings: list[str]
    sources: list[str]
    recommendations: list[str]

# Create session for resumability
session = Session(session_id="research-001", user_id="user-1")

# Agent with memory and tools
agent = Agent(
    name="Researcher",
    instructions="Research topics thoroughly and return structured reports.",
    tools=[duckduckgo],
    memory=True
)

# Task with structured output
task = Task(
    description="Research the current state of quantum computing in 2024",
    expected_output="Structured research report",
    agent=agent,
    output_pydantic=ResearchReport
)

# Run with SQLite persistence
agents = AgentTeam(
    agents=[agent],
    tasks=[task],
    memory=True
)

result = agents.start()
print(result)

# Resume later
session2 = Session(session_id="research-001", user_id="user-1")
history = session2.search_memory("quantum computing")
```

### Run — CLI

```bash theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
praisonai "Research quantum computing" --research --web-search --memory --verbose
```

### Run — agents.yaml

```yaml theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
framework: praisonai
topic: Research Project
memory: true
memory_config:
  provider: sqlite
  db_path: research.db
roles:
  researcher:
    role: Research Specialist
    goal: Conduct comprehensive research
    backstory: You are an expert researcher
    tools:
      - duckduckgo
    memory: true
    tasks:
      research_task:
        description: Research the current state of quantum computing in 2024
        expected_output: Structured research report
        output_json:
          topic: string
          summary: string
          key_findings: array
          sources: array
          recommendations: array
```

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

### Serve API

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

agent = Agent(
    name="Researcher",
    instructions="Research topics and return structured reports.",
    tools=[duckduckgo],
    memory=True
)

agent.launch(port=8080)
```

```bash theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
curl -X POST http://localhost:8080/chat \
  -H "Content-Type: application/json" \
  -d '{"message": "Research AI trends", "session_id": "research-001"}'
```

***

## Monitor / Verify

```bash theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
praisonai "test research" --research --web-search --verbose
```

## Cleanup

```bash theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
rm -f research.db
```

## Features Demonstrated

| Feature           | Implementation                  |
| ----------------- | ------------------------------- |
| Workflow          | Multi-step research synthesis   |
| DB Persistence    | SQLite via `memory_config`      |
| Observability     | `--verbose` flag                |
| Tools             | DuckDuckGo search               |
| Resumability      | `Session` with `session_id`     |
| Structured Output | Pydantic `ResearchReport` model |

## Next Steps

* [Deep Research](/agents/deep-research) for OpenAI/Gemini deep research APIs
* [Data Analyst](/agents/data-analyst) for data-driven research
* [Memory](/features/advanced-memory) for persistent context
