How nareshmac2024/enterprise-it-support-agentic-rag-copilot works
This is an employee-facing enterprise IT support copilot: users ask questions, receive grounded answers with citations and a decision trace, and authorized staff can upload knowledge documents. The main runtime routes questions, checks private Pinecone evidence first, falls back to Tavily when needed, grades and may retry evidence, then generates an answer or reports insufficient evidence. Uploads are loaded and chunked before indexing; chat decisions are audited in SQLite. Workflow stages are shown separately although implemented in one module. The graph reflects excerpts and README statements; unsampled UI markup and integrations are not inferred beyond documented links.
Main entry points: routes.py Chat and ingest API · workflow.py Question routing · app.js Copilot web UI · audit.py Query audit
Components 20
User experience
- Copilot web UI
static/js/app.js - Web page
templates/index.html
API and services
- FastAPI app
app/main.py - Chat and ingest API
app/api/routes.py - Document loading and chunking
app/services/ingestion.py - Query audit
app/services/audit.py - Application settings
app/core/config.py
Agentic RAG
- Workflow state and decisions
app/rag/state.py - Question routing
app/rag/workflow.py - Private KB retrieval
app/rag/workflow.py - Private evidence grading
app/rag/workflow.py - Web fallback search
app/rag/workflow.py - Web evidence grading
app/rag/workflow.py - Query rewrite and retry
app/rag/workflow.py - Answer generation
app/rag/workflow.py
Storage and providers
- Pinecone vector store
app/rag/vectorstore.py - OpenAI language model
- Tavily search
- SQLite audit database
data/audit.db
Other components
- Employee / staff
Connections 30
- Employee / staff → Copilot web UI: asks / uploads
README.md - Copilot web UI → Web page: uses page
- Copilot web UI → Chat and ingest API: posts chat / ingest
static/js/app.js - FastAPI app → Chat and ingest API: mounts router
app/main.py - FastAPI app → Query audit: initializes audit
app/main.py - Chat and ingest API → Application settings: reads settings
app/api/routes.py - Chat and ingest API → Question routing: calls ask
app/api/routes.py - Chat and ingest API → Query audit: writes chat trace
app/api/routes.py - Chat and ingest API → Document loading and chunking: loads and chunks
app/api/routes.py - Chat and ingest API → Pinecone vector store: indexes chunks
app/api/routes.py - Question routing → Workflow state and decisions: uses typed state
app/rag/workflow.py - Question routing → Private KB retrieval: routes IT queries
app/rag/workflow.py - Question routing → Answer generation: answers direct chat
app/rag/workflow.py - Private KB retrieval → Pinecone vector store: retrieves chunks
app/rag/workflow.py - Private KB retrieval → Private evidence grading: grades retrieved evidence
app/rag/workflow.py - Private evidence grading → Answer generation: uses sufficient KB
app/rag/workflow.py - Private evidence grading → Web fallback search: falls back if weak
app/rag/workflow.py - Web fallback search → Tavily search: searches web
app/rag/workflow.py - Web fallback search → Web evidence grading: grades search results
app/rag/workflow.py - Web evidence grading → Answer generation: uses sufficient web
app/rag/workflow.py - Web evidence grading → Query rewrite and retry: rewrites if weak
app/rag/workflow.py - Query rewrite and retry → Private KB retrieval: retries private retrieval
app/rag/workflow.py - Question routing → OpenAI language model: routes with model
app/rag/workflow.py - Private evidence grading → OpenAI language model: grades with model
app/rag/workflow.py - Web evidence grading → OpenAI language model: grades with model
app/rag/workflow.py - Query rewrite and retry → OpenAI language model: rewrites with model
app/rag/workflow.py - Answer generation → OpenAI language model: generates answer
app/rag/workflow.py - Pinecone vector store → Application settings: configures index
app/rag/vectorstore.py - Chat and ingest API → Copilot web UI: returns answer and trace
static/js/app.js - Query audit → SQLite audit database: writes audit rows
app/services/audit.py