How thenithin342/agentflow works
AgentFlow is a full-stack, stateful knowledge assistant. Users authenticate, submit a thread-scoped question, and receive streamed agent activity and a final answer; optional review pauses the response for approval or editing. The backend routes work among research, analysis, chat, and blog generation, with synthesis, PDF retrieval, durable graph state, and long-term memory capabilities. The React client also supports uploads, thread management, and administration. Several subsystem details are documented in the README but their implementation excerpts were not sampled, so those paths and links are limited to evidence available here.
Main entry points: build_graph.py Workflow graph · App.jsx Chat interface · main.py FastAPI application · ingest.py PDF ingestion
Components 26
User experience
- Chat interface
frontend/src/App.jsx - SSE handling
frontend/src/hooks/useSSE.js - API client
frontend/src/api/client.js
API and access
- FastAPI application
backend/main.py - Authentication
backend/auth.py - Chat endpoint
backend/routers/chat.py - Upload endpoint
backend/routers/upload.py - Thread endpoints
backend/routers/threads.py - Administration
backend/routers/admin.py - Runtime settings
backend/settings.py
Agent workflow
- Intent router
backend/graph/router.py - Workflow graph
backend/graph/build_graph.py - Specialist agents
backend/graph/agents.py - Blog writer
backend/graph/blog_agent.py - Response synthesis
backend/graph/synthesizer.py - Human review
backend/graph/human_review.py - LLM providers
backend/llm.py - Agent tools
backend/graph/tools.py
Knowledge and state
- PDF ingestion
backend/rag/ingest.py - Vector store
backend/vectorstore/qdrant_store.py - Long-term memory
backend/memory/ltm.py - Short-term memory
backend/memory/stm.py - Graph checkpoints
backend/main.py
Evaluation
- Offline evaluation
evals/harness/run_offline.py - LLM judge
evals/harness/llm_judge.py
Other components
- User
Connections 31
- User → Chat interface: uses
- Chat interface → API client: requests
frontend/src/App.jsx - API client → FastAPI application: calls API
frontend/src/api/client.js - FastAPI application → Chat endpoint: registers routes
backend/main.py - FastAPI application → Graph checkpoints: opens checkpoint store
backend/main.py - FastAPI application → Authentication: bootstraps access
backend/main.py - Chat endpoint → Workflow graph: streams graph
- Chat endpoint → Human review: resumes review
backend/routers/chat.py - Workflow graph → Intent router: dispatches
backend/graph/build_graph.py - Workflow graph → Specialist agents: routes specialist work
backend/graph/build_graph.py - Workflow graph → Blog writer: routes blog work
backend/graph/build_graph.py - Workflow graph → Response synthesis: synthesizes output
backend/graph/build_graph.py - Workflow graph → Human review: gates response
backend/graph/build_graph.py - Intent router → LLM providers: classifies with
backend/graph/router.py - Specialist agents → Agent tools: uses tools
- Specialist agents → PDF ingestion: retrieves documents
- Agent tools → PDF ingestion: retrieves documents
backend/graph/tools.py - Upload endpoint → PDF ingestion: ingests PDFs
- PDF ingestion → Vector store: stores chunks
backend/rag/ingest.py - Workflow graph → Long-term memory: memory nodes
backend/graph/build_graph.py - Long-term memory → Vector store: uses store
backend/memory/ltm.py - Workflow graph → Short-term memory: uses conversation memory
- Thread endpoints → PDF ingestion: manages thread data
backend/routers/threads.py - Chat interface → SSE handling: streams chat
frontend/src/App.jsx - SSE handling → API client: sends chat request
frontend/src/hooks/useSSE.js - Chat interface → Upload endpoint: uploads PDFs
- Chat interface → Thread endpoints: manages threads
frontend/src/App.jsx - Chat interface → Administration: opens admin
frontend/src/App.jsx - Offline evaluation → LLM judge: scores answers
evals/harness/run_offline.py - FastAPI application → Runtime settings: loads configuration
backend/main.py - LLM providers → Runtime settings: loads provider config
backend/llm.py