How butlee27/agentic-ai-research- works
AI Research Agent accepts a question in Streamlit, sends it to FastAPI, and runs a LangGraph workflow: research gathers live and internal evidence, writing produces a report, review checks it, and human approval either finishes or sends it for revision. The graph builder owns stage registration and routing; the supervisor selects revision stages. MCP exposes the search tools, while retrieval modules implement the internal knowledge-base capability. README documents the UI/API and knowledge-base workflow; retrieval internals and some agent implementations were not excerpted, so uncertain implementation links are omitted.
Main entry points: builder.py Graph builder · config.py LLM configuration · research_agent.py Research agent · server.py MCP tool server
Components 20
User interface
- Streamlit interface
app/ui/streamlit_app.py - Research API
app/api/main.py
Research workflow
- Graph builder
app/graph/builder.py - Stage supervisor
app/agents/supervisor.py - Research agent
app/agents/research_agent.py - Report writer
app/agents/writer_agent.py - Report reviewer
app/agents/reviewer_agent.py - Human approval
app/agents/human_approval.py - Workflow routing
app/graph/routing.py
Research sources
- MCP client
app/mcp/client.py - MCP tool server
app/mcp/server.py - Knowledge retrieval tool
app/tools/retrieval_tool.py - Document retrieval
app/Retrieval - Web search tool
app/tools/web_search.py
Model and state
- Workflow state
app/graph/state.py - LLM configuration
app/config.py
Other components
- Research user
- Tavily search
- Groq language model
- Chroma knowledge base
Connections 23
- Research user → Streamlit interface: submits question
README.md - Streamlit interface → Research API: sends request
README.md - Research API → Graph builder: invokes workflow
app/api/main.py - Graph builder → Research agent: registers stage
app/graph/builder.py - Graph builder → Stage supervisor: registers stage
app/graph/builder.py - Graph builder → Report writer: registers stage
app/graph/builder.py - Graph builder → Report reviewer: registers stage
app/graph/builder.py - Graph builder → Human approval: registers stage
app/graph/builder.py - Graph builder → Workflow state: uses state
app/graph/builder.py - Graph builder → Stage supervisor: routes stages
app/graph/builder.py - Graph builder → Workflow routing: routes workflow
- Research agent → MCP client: requests searches
app/agents/research_agent.py - MCP client → MCP tool server: calls tools
app/mcp/client.py - MCP tool server → Knowledge retrieval tool: invokes retrieval
app/mcp/server.py - MCP tool server → Web search tool: invokes search
app/mcp/server.py - Knowledge retrieval tool → Document retrieval: retrieves documents
app/tools/retrieval_tool.py - Document retrieval → Chroma knowledge base: searches knowledge
- Web search tool → Tavily search: searches web
app/tools/web_search.py - LLM configuration → Groq language model: configures model
app/config.py - Research agent → LLM configuration: gets model
app/agents/research_agent.py - Stage supervisor → LLM configuration: gets model
app/agents/supervisor.py - Report reviewer → LLM configuration: gets model
app/agents/reviewer_agent.py - Report writer → LLM configuration: gets model
app/agents/writer_agent.py