How manojvarmapenmetsa/ai works
This is an evidence-aware IT support copilot: a browser question reaches FastAPI, then the LangGraph workflow routes casual messages directly or grounds IT answers in the private knowledge base, falling back to web evidence and a bounded rewrite when needed. A separate authenticated upload flow parses and chunks documents before indexing them. The graph also shows answer/audit handling and the model, vector database, and web-search integrations. Workflow stages share one implementation file; their internal transitions are documented in that excerpt. Other connections are limited to shown calls or README statements.
Main entry points: routes.py API routes · workflow.py Private KB retrieval · vectorstore.py Vector store · main.py FastAPI app
Components 21
Web experience
- Chat interface
static/js/app.js - Chat page
templates/index.html
API and ingestion
- FastAPI app
app/main.py - API routes
app/api/routes.py - Document loader and chunker
app/services/ingestion.py
RAG workflow
- Question routing
app/rag/workflow.py - Direct response
app/rag/workflow.py - Private KB retrieval
app/rag/workflow.py - Private evidence grading
app/rag/workflow.py - Web fallback
app/rag/workflow.py - Web evidence grading
app/rag/workflow.py - Query rewrite
app/rag/workflow.py - Answer generation
app/rag/workflow.py - Workflow state
app/rag/state.py
Knowledge and audit
- Vector store
app/rag/vectorstore.py - Audit records
app/services/audit.py - Company knowledge files
data/sample_kb
External services
- OpenRouter model
- Pinecone
- Tavily search
Other components
- Support user
Connections 30
- Support user → Chat interface: asks
README.md - Chat interface → API routes: posts chat
static/js/app.js - FastAPI app → Chat page: renders
README.md - FastAPI app → API routes: registers
app/main.py - API routes → Question routing: calls ask
app/api/routes.py - Question routing → Direct response: routes casual
app/rag/workflow.py - Question routing → Private KB retrieval: routes IT
app/rag/workflow.py - Private KB retrieval → Private evidence grading: grades evidence
app/rag/workflow.py - Private evidence grading → Answer generation: uses good evidence
app/rag/workflow.py - Private evidence grading → Web fallback: falls back
README.md - Web fallback → Web evidence grading: grades results
app/rag/workflow.py - Web evidence grading → Answer generation: uses good evidence
README.md - Web evidence grading → Query rewrite: retries weak evidence
app/rag/workflow.py - Query rewrite → Private KB retrieval: repeats retrieval
app/rag/workflow.py - Direct response → OpenRouter model: invokes
app/rag/workflow.py - Answer generation → OpenRouter model: invokes
app/rag/workflow.py - Question routing → OpenRouter model: classifies with
app/rag/workflow.py - Query rewrite → OpenRouter model: rewrites with
app/rag/workflow.py - Private KB retrieval → Vector store: gets retriever
app/rag/workflow.py - Vector store → Pinecone: retrieves vectors
app/rag/vectorstore.py - Web fallback → Tavily search: searches with
README.md - API routes → Audit records: writes chat audit
app/api/routes.py - FastAPI app → Audit records: initializes
app/main.py - API routes → Document loader and chunker: loads and chunks
app/api/routes.py - API routes → Vector store: adds chunks
app/api/routes.py - Document loader and chunker → Vector store: provides chunks
app/api/routes.py - Vector store → Pinecone: indexes vectors
app/rag/vectorstore.py - Company knowledge files → Document loader and chunker: indexed from
README.md - Private KB retrieval → Workflow state: reads and updates
app/rag/workflow.py - Answer generation → Chat interface: returns citations and trace
README.md