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

# Deep Research Agent

> Comprehensive research with citations and reasoning

Run multi-step research with citations, reasoning traces, and confidence scores.

```mermaid theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
graph LR
    Query([Query]) --> Agent[Deep Research]
    Agent --> Answer([Answer])

    classDef agent fill:#8B0000,stroke:#7C90A0,color:#fff
    classDef tool fill:#189AB4,stroke:#7C90A0,color:#fff

    class Agent agent
    class Query,Answer tool
    classDef agent fill:#8B0000,color:#fff
    classDef tool fill:#189AB4,color:#fff

```

## Quick Start

<Steps>
  <Step title="Simple Usage">
    ```bash theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
    npm install praisonai
    ```

    ```typescript theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
    import { DeepResearchAgent } from 'praisonai';

    const agent = new DeepResearchAgent();
    const result = await agent.research('What are the latest advances in AI?');
    console.log(result.answer);
    ```
  </Step>

  <Step title="With Configuration">
    ```typescript theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
    const agent = new DeepResearchAgent({
      llm: 'openai/gpt-4o',
      maxIterations: 10,
      verbose: true,
    });
    ```
  </Step>
</Steps>

***

## Basic Usage

```typescript theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
import { DeepResearchAgent } from 'praisonai';

const agent = new DeepResearchAgent();

const result = await agent.research('What are the latest advances in AI?');

console.log('Answer:', result.answer);
console.log('Citations:', result.citations.length);
console.log('Confidence:', result.confidence);
```

## With Configuration

```typescript theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
import { DeepResearchAgent } from 'praisonai';

const agent = new DeepResearchAgent({
  name: 'Researcher',
  llm: 'openai/gpt-4o',
  maxIterations: 10,
  verbose: true
});
```

## With Search Tool

```typescript theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
import { DeepResearchAgent } from 'praisonai';

const searchTool = async (query: string) => {
  // Your search implementation
  return [
    { title: 'Result 1', url: 'https://example.com/1', snippet: 'Content...' },
    { title: 'Result 2', url: 'https://example.com/2', snippet: 'More content...' }
  ];
};

const agent = new DeepResearchAgent({
  searchTool
});

const result = await agent.research('Latest AI research');
console.log('Citations found:', result.citations.length);
```

## Research Response

```typescript theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
interface ResearchResponse {
  answer: string;           // Synthesized answer
  citations: Citation[];    // Sources used
  reasoning: ReasoningStep[]; // Research process
  confidence: number;       // 0-1 confidence score
}

interface Citation {
  title: string;
  url: string;
  snippet?: string;
}

interface ReasoningStep {
  step: number;
  thought: string;
  action?: string;
  result?: string;
}
```

## View Reasoning Steps

```typescript theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
import { DeepResearchAgent } from 'praisonai';

const agent = new DeepResearchAgent({ verbose: true });

const result = await agent.research('Explain quantum computing');

result.reasoning.forEach(step => {
  console.log(`Step ${step.step}: ${step.thought}`);
  if (step.action) console.log(`  Action: ${step.action}`);
  if (step.result) console.log(`  Result: ${step.result}`);
});
```

## Set Search Tool Dynamically

```typescript theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
import { DeepResearchAgent } from 'praisonai';

const agent = new DeepResearchAgent();

agent.setSearchTool(async (query) => {
  // Custom search logic
  return [];
});
```

## Factory Function

```typescript theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
import { createDeepResearchAgent } from 'praisonai';

const agent = createDeepResearchAgent({
  name: 'MyResearcher',
  maxIterations: 5
});
```

## Related

<CardGroup cols={2}>
  <Card title="Deep Research CLI" icon="terminal" href="/docs/js/deep-research-cli">
    CLI research command
  </Card>

  <Card title="Citations" icon="book" href="/docs/js/citations">
    Source tracking
  </Card>

  <Card title="Agent" icon="robot" href="/docs/js/agent">
    Single agent API
  </Card>
</CardGroup>
