How dhiraj455/airesearch_agent works
AI Research Agent accepts a research question through a chat interface, runs a staged web-research workflow, and returns a cited Markdown report; chats also support report-grounded follow-ups and PDF downloads. The backend coordinates LangGraph stages, Gemini calls, search and document retrieval, while Redis caches run and chat state. The frontend provides chat, report, and research-progress views. Workflow edges are grounded in the shown graph and node code; frontend-to-backend communication is documented in the README. Other capabilities are represented where documented, without inferring unsampled implementation details.
Main entry points: graph.py Research graph · ChatView.tsx Chat view · app.py HTTP API · utils.py Gemini model access
Components 22
Chat interface
- App page
frontend/app/page.tsx - Chat view
frontend/components/ChatView.tsx - Chat input
frontend/components/ChatInput.tsx - Message display
frontend/components/MessageBubble.tsx - Research progress
frontend/components/ResearchOverlay.tsx - Chat sidebar
frontend/components/Sidebar.tsx - API client
frontend/lib/api.ts
API and chat
- HTTP API
src/app.py - Follow-up answers
src/chat_service.py
Research workflow
- Research graph
src/agent/graph.py - Research planning
src/agent/nodes.py - Web search
src/tools/search.py - Web fetching
src/tools/fetch.py - PDF extraction
src/tools/pdf.py - Evidence and coverage
src/agent/nodes.py - Report and verification
src/agent/nodes.py - Research prompts
src/agent/prompt.py - Gemini model access
src/agent/utils.py
State and evidence
- Run and chat models
src/schemes.py - Redis cache
- Runtime settings
src/config.py
Other components
- Research user
Connections 28
- Research user → App page: uses
README.md - App page → Chat view: renders
- Chat view → Chat input: renders
frontend/components/ChatView.tsx - Chat view → Message display: renders
frontend/components/ChatView.tsx - Chat view → API client: requests
- Chat view → Research progress: shows progress
- App page → Chat sidebar: shows chats
- API client → HTTP API: calls API
README.md - HTTP API → Research graph: invokes research
src/app.py - HTTP API → Run and chat models: creates state
src/app.py - HTTP API → Redis cache: reads and writes
src/app.py - HTTP API → Follow-up answers: answers follow-up
src/app.py - Follow-up answers → Redis cache: loads run
src/chat_service.py - Research graph → Research planning: dispatches stages
src/agent/graph.py - Research graph → Web search: dispatches search
src/agent/graph.py - Research graph → Web fetching: dispatches fetch
src/agent/graph.py - Research graph → PDF extraction: dispatches PDF fetch
src/agent/graph.py - Research graph → Evidence and coverage: dispatches extraction
src/agent/graph.py - Research graph → Report and verification: dispatches writing
src/agent/graph.py - Research planning → Research prompts: uses prompts
src/agent/nodes.py - Research planning → Gemini model access: requests plan
src/agent/nodes.py - Evidence and coverage → Gemini model access: extracts evidence
src/agent/nodes.py - Report and verification → Gemini model access: writes and verifies
src/agent/nodes.py - Report and verification → Research prompts: uses prompts
src/agent/nodes.py - Follow-up answers → Gemini model access: generates answer
src/chat_service.py - Gemini model access → Runtime settings: reads settings
src/agent/utils.py - Web search → Runtime settings: reads limits
- Web fetching → Runtime settings: reads timeout
src/tools/fetch.py