Skip to main content

DeepResearchAgent

DeepResearchAgent conducts comprehensive research on topics with citations and reasoning.

Quick Start

import { createDeepResearchAgent } from 'praisonai';

const agent = createDeepResearchAgent({
  llm: 'openai/gpt-4o-mini'
});

const result = await agent.research('What are the latest AI trends?');
console.log(result.answer);
console.log(result.citations);

Configuration

interface DeepResearchConfig {
  name?: string;
  llm?: string;
  maxIterations?: number;  // Research depth
  searchTool?: (query: string) => Promise<Citation[]>;
  verbose?: boolean;
}

Response Format

interface ResearchResponse {
  answer: string;
  citations: Citation[];
  reasoning: ReasoningStep[];
  confidence: number;
}

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

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

Example

import { createDeepResearchAgent } from 'praisonai';

const agent = createDeepResearchAgent({
  llm: 'openai/gpt-4o-mini',
  maxIterations: 5,
  verbose: true
});

const result = await agent.research('TypeScript best practices 2024');

console.log('Answer:', result.answer);
console.log('Confidence:', result.confidence);
console.log('Reasoning steps:', result.reasoning.length);

CLI Usage

praisonai-ts research "What are the latest AI trends?"
praisonai-ts research "TypeScript best practices" --depth 5 --json