How codinghub27/advanced-deep-research-agent works
Deep Research Agent is a FastAPI research service: an authenticated user submits a question, the agent researches it across routed sources, synthesizes a cited answer, and can retain the turn in a session. The README describes a phased upgrade workflow rather than product behavior; the architecture here is inferred from the tree and sampled source. The graph and RAG excerpts document their own routing explicitly; unsampled pipeline and endpoint internals limit certainty about some call relationships.
Main entry points: graph.py Agent graph · main.py FastAPI endpoints · rag_nodes.py Source RAG nodes · executor.py Search execution
Components 25
API and sessions
- FastAPI endpoints
research_app/main.py - Authentication
research_app/auth/auth.py - Research service
research_app/research_service.py - Conversation context
research_app/conversation/context.py
Research pipeline
- Agent graph
research_app/agent/graph.py - Query classification
research_app/agent/state.py - Research planning
research_app/agent/pipeline/nodes.py - Task source routing
research_app/sources/routing/task_router.py - Search execution
research_app/sources/routing/executor.py - Evidence collection
research_app/agent/pipeline/evidence.py - Gap search
research_app/agent/pipeline/gaps.py - Answer critique
research_app/agent/pipeline/critic.py - Answer synthesis
research_app/agent/pipeline/synthesis.py - Response formatting
research_app/agent/pipeline/response.py
Source discovery
- Official docs source
research_app/sources/official_docs/adapter.py - Web search
research_app/sources/tavily.py - Source adapters
research_app/sources/routing/adapters.py
Stored-source RAG
- Source RAG nodes
research_app/agent/pipeline/rag_nodes.py - Hybrid retriever
research_app/rag/retriever.py - Source indexer
research_app/rag/ingest.py - Chunk store
research_app/rag/store.py
Persistence
- Application database
research_app/db/database.py - Conversation records
research_app/db/conversations.py
Other components
- Research user
- Language model
Connections 30
- Research user → FastAPI endpoints: submits request
- FastAPI endpoints → Authentication: checks identity
- FastAPI endpoints → Research service: prepares research
- FastAPI endpoints → Agent graph: runs research
- Research service → Conversation records: loads and saves turns
- Research service → Conversation context: builds context
- Conversation records → Application database: reads and writes
- Agent graph → Query classification: classifies query
- Agent graph → Research planning: plans tasks
- Agent graph → Source RAG nodes: routes optional RAG
- Source RAG nodes → Hybrid retriever: retrieves chunks
- Hybrid retriever → Chunk store: searches chunks
- Source RAG nodes → Agent graph: falls back to pipeline
- Agent graph → Task source routing: routes tasks
- Agent graph → Search execution: executes searches
- Search execution → Official docs source: dispatches docs search
- Search execution → Web search: dispatches web search
- Search execution → Source adapters: dispatches source search
- Agent graph → Evidence collection: collects evidence
- Agent graph → Gap search: searches evidence gaps
- Agent graph → Answer critique: checks answer
- Agent graph → Answer synthesis: synthesizes findings
- Agent graph → Response formatting: formats response
- Research planning → Language model: requests planning
- Answer synthesis → Language model: requests synthesis
- Answer critique → Language model: requests critique
- Response formatting → Source RAG nodes: indexes sources
- Source RAG nodes → Source indexer: indexes documents
- Source indexer → Chunk store: writes chunks
- FastAPI endpoints → Research user: returns answer or stream