How hsmshubham007-code/capstone-agent works
Company Policy Agent accepts policy questions through a UI or API, applies safety and routing controls, retrieves supporting policy text, and returns an answer generated by a Groq-hosted model. Separate branches handle risky actions through human approval, document indexing, durable conversation state, and operational visibility. The README also documents automated quality evaluations. Several implementation files were not sampled, so the graph includes documented capabilities but omits uncertain internal call links.
Main entry points: graph.py LangGraph workflow · retrieval.py Document retrieval · router.py Tool router · llm.py LLM client
Components 24
User channels
- Streamlit UI
app/ui.py - FastAPI API
app/api.py
Agent workflow
- Agent entry
app/agent.py - LangGraph workflow
app/graph.py - Tool router
app/router.py - LLM client
app/llm.py
Policy knowledge
- RAG answering
app/rag.py - Document retrieval
app/retrieval.py - PDF ingestion
app/ingest.py - Local embeddings
app/retrieval.py - Chroma index
app/vectorstore.py
Safety and approvals
- Safety checks
app/safety.py - Injection guardrails
app/guardrails.py - Risky tools
app/risky_tools.py - Human approval
app/approval.py
Operations
- Conversation state
app/state.py - Durable checkpoints
app/checkpoint.py - Audit logging
app/audit.py - Metrics
app/metrics.py - Monitoring dashboard
monitoring_dashboard.py - Evaluation suite
evals
Other components
- Questioner
- Groq endpoint
- Approver
Connections 28
- Questioner → Streamlit UI: asks
- Questioner → FastAPI API: submits
- Streamlit UI → FastAPI API: calls
- FastAPI API → Agent entry: invokes
- Agent entry → LangGraph workflow: starts workflow
- LangGraph workflow → Tool router: routes request
- LangGraph workflow → Safety checks: validates
- LangGraph workflow → Injection guardrails: checks injection
- LangGraph workflow → Conversation state: updates
- LangGraph workflow → Durable checkpoints: persists state
- Tool router → RAG answering: selects search
- RAG answering → Document retrieval: searches
- Document retrieval → Local embeddings: embeds query
- Document retrieval → Chroma index: queries
- PDF ingestion → Local embeddings: embeds chunks
- PDF ingestion → Chroma index: writes chunks
- RAG answering → LLM client: generates answer
- LLM client → Groq endpoint: requests completion
- Tool router → Risky tools: selects risky action
- LangGraph workflow → Human approval: requests authorization
- Approver → Human approval: reviews
- Human approval → Risky tools: authorizes execution
- LangGraph workflow → Audit logging: records operations
- LLM client → Metrics: records usage
- Document retrieval → Metrics: records timing
- Monitoring dashboard → Metrics: reads metrics
- Evaluation suite → Agent entry: evaluates answers
- Evaluation suite → Document retrieval: evaluates search