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

**1. 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);
```

**2. With Configuration**

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

***

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

> [card] [Deep Research CLI](https://praison.ai/docs/js/deep-research-cli.md)
>
> CLI research command

> [card] [Citations](https://praison.ai/docs/js/citations.md)
>
> Source tracking

> [card] [Agent](https://praison.ai/docs/js/agent.md)
>
> Single agent API


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