How entbappy/enterprise-it-support-agentic-rag-copilot works
This is an employee-facing enterprise IT support copilot. Employees submit questions through the web UI; the API invokes a LangGraph workflow that routes simple chat directly and handles support questions by retrieving and grading private knowledge, falling back to web search when needed, and returning a grounded answer with citations and a decision trace. Authorized staff can upload documents for indexing. The graph preserves these domain stages and the audit/configuration layers. Relationships reflect the README and excerpted source; unsampled template behavior and other undocumented wiring are not inferred.
Main entry points: routes.py API routes · workflow.py Evidence grading · main.py Application setup · vectorstore.py Vector store
Components 22
User interface
- Web interface
static/js/app.js - Home page
templates/index.html
API and services
- API routes
app/api/routes.py - Application setup
app/main.py - Document ingestion
app/services/ingestion.py - Query audit
app/services/audit.py
Agentic RAG
- Workflow state
app/rag/state.py - Workflow orchestration
app/rag/workflow.py - Question routing
app/rag/workflow.py - Private retrieval
app/rag/workflow.py - Evidence grading
app/rag/workflow.py - Web fallback
app/rag/workflow.py - Query rewriting
app/rag/workflow.py - Answer generation
app/rag/workflow.py
State and integrations
- Settings
app/core/config.py - Logging setup
app/core/logging.py - Vector store
app/rag/vectorstore.py - Pinecone KB
- OpenAI models
- Tavily search
- SQLite audit DB
data/audit.db
Other components
- Employee
Connections 31
- Employee → Web interface: asks question
README.md - Web interface → API routes: posts chat
static/js/app.js - Application setup → API routes: registers routes
app/main.py - Application setup → Home page: renders home
app/main.py - API routes → Workflow orchestration: calls ask
app/api/routes.py - API routes → Query audit: writes trace
app/api/routes.py - Application setup → Query audit: initializes DB
app/main.py - Query audit → SQLite audit DB: writes records
app/services/audit.py - API routes → Document ingestion: loads and chunks
app/api/routes.py - API routes → Vector store: adds chunks
app/api/routes.py - Workflow orchestration → Question routing: dispatches
app/rag/workflow.py - Question routing → Private retrieval: routes support
app/rag/workflow.py - Question routing → Answer generation: routes direct
app/rag/workflow.py - Private retrieval → Vector store: retrieves chunks
app/rag/workflow.py - Private retrieval → Evidence grading: passes evidence
app/rag/workflow.py - Evidence grading → Answer generation: uses good KB
app/rag/workflow.py - Evidence grading → Web fallback: falls back
app/rag/workflow.py - Web fallback → Tavily search: searches web
app/rag/workflow.py - Web fallback → Evidence grading: grades web evidence
app/rag/workflow.py - Evidence grading → Query rewriting: retries weak evidence
app/rag/workflow.py - Query rewriting → Private retrieval: retries query
app/rag/workflow.py - Answer generation → OpenAI models: generates answer
app/rag/workflow.py - Question routing → OpenAI models: classifies question
app/rag/workflow.py - Evidence grading → OpenAI models: grades evidence
app/rag/workflow.py - Query rewriting → OpenAI models: rewrites query
app/rag/workflow.py - Vector store → Pinecone KB: reads and writes vectors
app/rag/vectorstore.py - Vector store → OpenAI models: embeds documents
app/rag/vectorstore.py - Workflow orchestration → Workflow state: uses typed state
app/rag/workflow.py - Application setup → Settings: loads settings
app/main.py - Application setup → Logging setup: configures logging
app/main.py - API routes → Settings: checks settings
app/api/routes.py