Generate comprehensive research reports on any topic through AI-powered analysis
Deep Research is an intelligent research assistant that leveres advanced AI models to create in-depth reports on any topic. With an intuitive interface and powerful backend, it automates the research process by searching for information, analyzing content, and generating well-structured reports.
- 🔍 Intelligent Topic Research: Input any research topic and get a comprehensive report
- 🤔 Interactive Clarification: Answer questions to refine the research scope
- 🔄 Real-time Progress Tracking: Monitor the research process with detailed activity logs
- 📚 Multiple AI Model Support: Choose from Gemini, OpenAI, or OpenRouter models
- 📝 Markdown Reports: Download or copy reports in clean Markdown format
- 🔗 Source Citations: All research includes source links for reference
flowchart LR
subgraph Frontend
UI[User Interface]
Store[Zustand Store]
UI <--> Store
end
subgraph Backend
API[API Routes]
RFunc[Research Functions]
MCaller[Model Caller]
ATracker[Activity Tracker]
API --> RFunc
RFunc --> MCaller
RFunc --> ATracker
end
subgraph "External Services"
EXA[Exa Search API]
LLM[AI Models]
subgraph "Model Providers"
OPENAI[OpenAI]
GOOGLE[Google Gemini]
OPENR[OpenRouter]
end
LLM --> OPENAI
LLM --> GOOGLE
LLM --> OPENR
end
Store <--> API
RFunc --> EXA
MCaller --> LLM
flowchart TB
subgraph User
A[User Input] --> B[Research Topic]
B --> C{Answer Questions}
end
subgraph "AI Research Process"
C --> D[Generate Search Queries]
D --> E[Search for Information]
E --> F[Extract Content]
F --> G[Analyze Results]
G --> H{Sufficient?}
H -->|No| D
H -->|Yes| I[Generate Report]
end
subgraph "Output"
I --> J[Research Report]
J --> K[Download/Copy]
end
C --> L[Activity Tracking]
L --> G
- Frontend: Next.js, React, Tailwind CSS, shadcn/ui components
- State Management: Zustand
- Backend: Next.js API Routes
- APIs: Exa Search API, AI model providers (OpenAI, Google, OpenRouter)
- Styling: Tailwind CSS with custom components
- Node.js 18+
- npm or yarn
- API keys for:
- Exa Search API
- At least one AI model provider (OpenAI, Google Gemini, or OpenRouter)
- Clone the repository:
git clone https://github.com/yourusername/deep-research-ai-agent.git
cd deep-research-ai-agent- Install dependencies:
npm install
# or
yarn install- Create a
.env.localfile in the root directory:
EXA_SEARCH_API_KEY=your_exa_api_key
OPENAI_API_KEY=your_openai_api_key
GEMINI_API_KEY=your_GEMINI_API_KEY
OPENROUTER_API_KEY=your_openrouter_api_key
- Start the development server:
npm run dev
# or
yarn dev- Open http://localhost:3000 with your browser to see the application.
The application allows configuration of several parameters:
- Model Provider: Choose between Gemini, OpenAI, and OpenRouter
- Max Iterations: Control the maximum research loops (default: 2)
- Max Search Results: Limit the number of search results per query (default: 1)
- Max Content Characters: Set the maximum content length from each source (default: 20000)
- Enter Research Topic: Input your research topic on the main screen
- Answer Clarification Questions: Provide answers to help focus the research
- Monitor Progress: Watch as the system searches for information and analyzes content
- Review Report: Once complete, review, download, or copy the generated report
- User Input: Collects the research topic from the user
- Question Generation: Creates clarification questions based on the topic
- Research Planning: Generates search queries to find relevant information
- Content Extraction: Processes search results into structured content
- Analysis: Determines if collected information is sufficient
- Report Generation: Creates a comprehensive markdown report
To add support for a new AI model provider:
- Update
src/store/deepResearch.tsto include the new provider type - Add model configuration in
src/app/api/deep-research/constants.ts - Implement the provider client in
src/app/api/deep-research/services.ts - Update the model selection UI in
src/app/page.tsx
This project is licensed under the MIT License - see the LICENSE file for details.