How harshadpatil108/mlsd-mini-project works
IncidentOps accepts PostgreSQL alerts, validates and queues them, then asynchronously produces advisory cause classifications, verified citations, first-response steps, and a human route. Its agent graph performs triage, multi-hop investigation, and citation verification; RAG indexes PostgreSQL documentation and runbooks for hybrid retrieval. The README documents the service boundaries and guardrail behavior; source excerpts and the SOURCE INDEX support the implementation links shown. Some guardrail and deployment wiring is documented but not shown in source excerpts, so those links are marked dashed.
Main entry points: api/main.py Run API · graph.py Agent Workflow · ingestion.py Corpus Ingestion · worker/main.py Background Worker
Components 28
Alert Intake
- Streamlit UI
frontend/app.py - Run API
src/api/main.py - Alert Contracts
src/api/schemas.py - Quarantine Store
src/api/quarantine.py
Incident Reasoning
- Agent Workflow
src/agent/graph.py - Agent State
src/agent/state.py - Triage Agent
src/agent/triage.py - Investigator Agent
src/agent/investigator.py - Citation Verifier
src/agent/verifier.py
Knowledge Retrieval
- Retrieval Tools
src/agent/tools.py - Hybrid Retriever
src/rag/retriever.py - BM25 Index
src/rag/bm25.py - Chroma Vector Store
src/rag/store.py - Corpus Ingestion
src/rag/ingestion.py - Document Parsers
src/rag/parsers.py - Hierarchical Chunker
src/rag/chunker.py
Runtime Services
- Task Queue
src/worker/queue.py - Run Status Store
src/worker/store.py - Background Worker
src/worker/main.py - LLM Gateway
src/gateway/client.py
Safety Controls
- Injection Defense
src/guardrails/injection.py - Toxicity Scan
src/guardrails/toxicity.py - Output Authorization
src/guardrails/output.py
Other components
- On-call Engineer
- Prometheus Client
- Browser User
- Redis Broker
- LLM Provider
Connections 33
- On-call Engineer → Streamlit UI: submits alert
- Browser User → Streamlit UI: uses UI
- Prometheus Client → Run API: submits alert
- Streamlit UI → Run API: sends HTTP
- Run API → Alert Contracts: validates with
src/api/main.py - Run API → Quarantine Store: stores rejects
src/api/main.py - Run API → Run Status Store: records run
src/api/main.py - Run API → Task Queue: enqueues run
src/api/main.py - Run API → Injection Defense: screens note
- Run API → Toxicity Scan: scans input
- Task Queue → Redis Broker: pushes tasks
- Redis Broker → Background Worker: delivers run
- Background Worker → Task Queue: dequeues run
src/worker/main.py - Background Worker → Run Status Store: updates status
src/worker/main.py - Background Worker → Agent Workflow: invokes graph
src/worker/main.py - Agent Workflow → Triage Agent: runs triage
src/agent/graph.py - Agent Workflow → Investigator Agent: runs investigation
src/agent/graph.py - Agent Workflow → Citation Verifier: verifies output
src/agent/graph.py - Agent Workflow → Agent State: updates state
src/agent/graph.py - Triage Agent → LLM Gateway: requests reasoning
src/agent/triage.py - Investigator Agent → Retrieval Tools: uses search tools
src/agent/investigator.py - Investigator Agent → LLM Gateway: requests synthesis
src/agent/investigator.py - Citation Verifier → LLM Gateway: requests verification
src/agent/verifier.py - Retrieval Tools → Hybrid Retriever: searches corpus
src/agent/tools.py - Hybrid Retriever → Chroma Vector Store: queries dense
src/rag/retriever.py - Hybrid Retriever → BM25 Index: queries sparse
src/rag/retriever.py - Corpus Ingestion → Document Parsers: parses documents
src/rag/ingestion.py - Corpus Ingestion → Hierarchical Chunker: chunks sections
src/rag/ingestion.py - Corpus Ingestion → Chroma Vector Store: indexes chunks
src/rag/ingestion.py - Corpus Ingestion → BM25 Index: builds index
src/rag/ingestion.py - LLM Gateway → LLM Provider: sends completions
- Agent Workflow → Output Authorization: filters result
- Citation Verifier → Run Status Store: returns verified result