How mirajul100/agentic-rag-copilot works
Agentic RAG Copilot is a FastAPI document-grounded chat application. A browser submits a question and conversation ID; the API loads recent history, then the workflow supervisor chooses direct response, private knowledge retrieval, public search, or both, before returning an evidence-based answer and citations. A separate upload workflow parses and chunks documents before indexing them. SQLite stores conversation turns and audit records; Pinecone holds searchable document vectors. The README documents streaming, follow-ups, and optional web search; unsampled workflow sections limit finer-grained call links.
Main entry points: routes.py API routes · work_flow.py Route supervisor · vector_store.py Vector store · config.py App settings
Components 19
App and API
- FastAPI app
app/main.py - API routes
app/api/routes.py
Question workflow
- Route supervisor
app/rag/work_flow.py - KB retrieval
app/rag/work_flow.py - Web search
app/rag/work_flow.py - Answer generation
app/rag/work_flow.py - Workflow state
app/rag/state.py
Knowledge ingestion
- Document ingestion
app/services/ingestion.py - Vector store
app/rag/vector_store.py
Persistence and settings
- Conversation memory
app/rag/memory.py - Audit records
app/services/audit.py - App settings
app/core/config.py - Logging config
app/core/logging.py
Other components
- Browser chat
static/app.js - User
- Gemini
- Pinecone
- Tavily
- SQLite database
Connections 28
- User → Browser chat: asks
README.md - Browser chat → API routes: submits chat
README.md - FastAPI app → API routes: mounts routes
app/main.py - API routes → Route supervisor: asks
app/api/routes.py - API routes → Conversation memory: loads and saves
app/api/routes.py - API routes → Audit records: writes records
app/api/routes.py - Route supervisor → KB retrieval: routes KB
README.md - Route supervisor → Web search: routes web
README.md - Route supervisor → Answer generation: routes direct
README.md - KB retrieval → Vector store: retrieves chunks
README.md - Web search → Tavily: searches web
README.md - Answer generation → Gemini: generates answer
README.md - Route supervisor → Gemini: selects route
app/rag/work_flow.py - Route supervisor → Workflow state: updates state
app/rag/work_flow.py - API routes → Document ingestion: loads and splits
app/api/routes.py - API routes → Vector store: indexes chunks
app/api/routes.py - Document ingestion → Vector store: provides chunks
README.md - Vector store → Gemini: embeds text
app/rag/vector_store.py - Vector store → Pinecone: stores vectors
app/rag/vector_store.py - Conversation memory → SQLite database: reads and writes
app/rag/memory.py - Audit records → SQLite database: writes records
app/services/audit.py - FastAPI app → Audit records: initializes database
app/main.py - API routes → App settings: reads settings
app/api/routes.py - Vector store → App settings: reads settings
app/rag/vector_store.py - Conversation memory → App settings: reads database path
app/rag/memory.py - Audit records → App settings: reads database path
app/services/audit.py - FastAPI app → App settings: reads app name
app/main.py - API routes → Logging config: uses logger
app/api/routes.py