How irajput215/incident-response-agent works
This is an incident-response agent for failed data pipelines. An orchestrator or on-call user submits an alert; the workflow triages it, gathers evidence with typed log, metadata, and read-only warehouse tools, assesses root cause, plans remediation, pauses for human approval when changes are required, then executes the approved action and records a report. PostgreSQL-backed state supports persistence and resumption; evaluation and observability are important supporting capabilities. The graph follows documented workflow relationships; unsampled implementation details are not inferred.
Main entry points: nodes.py Triage and investigation · registry.py Typed tool registry · agent.py Agent assembly · routes.py Incident API
Components 20
Incident entry
- Incident API
app/api/routes.py
Investigation workflow
- Agent assembly
app/agents/agent.py - Workflow graph
app/agents/graph.py - Triage and investigation
app/agents/nodes.py - Incident domain models
app/schemas.py - LLM clients
app/llm/__init__.py
Evidence and tools
- Typed tool registry
app/tools/registry.py - Log investigation
app/tools/logs.py - Pipeline metadata
app/tools/pipeline.py - Warehouse queries
app/tools/database.py - Read-only SQL guard
app/tools/sql_guard.py - Pipeline estate
app/estate.py
State and reporting
- Incident repository
app/db/repository.py - Platform PostgreSQL
app/db/schema.py - Graph checkpointing
app/platform.py
Operations and evaluation
- Metrics and logging
app/observability.py - LangSmith tracing
app/tracing.py - Agent evaluation
app/evaluation/harness.py
Other components
- Alert source
- On-call reviewer
Connections 23
- Alert source → Incident API: submits alert
README.md - On-call reviewer → Incident API: approves or rejects
README.md - Incident API → Agent assembly: starts investigation
README.md - Agent assembly → Workflow graph: builds workflow
app/agents/agent.py - Workflow graph → Triage and investigation: dispatches stages
app/agents/graph.py - Triage and investigation → LLM clients: requests analysis
app/agents/nodes.py - Triage and investigation → Typed tool registry: invokes tools
app/agents/nodes.py - Typed tool registry → Log investigation: registers tools
app/tools/__init__.py - Typed tool registry → Pipeline metadata: registers tools
app/tools/__init__.py - Typed tool registry → Warehouse queries: registers tools
app/tools/__init__.py - Warehouse queries → Read-only SQL guard: checks queries
app/tools/database.py - Log investigation → Pipeline estate: reads pipeline estate
- Pipeline metadata → Pipeline estate: reads metadata
- Warehouse queries → Pipeline estate: uses estate context
app/tools/database.py - Triage and investigation → Incident repository: records evidence
app/agents/nodes.py - Incident repository → Platform PostgreSQL: persists incident data
- Agent assembly → Graph checkpointing: configures graph state
app/platform.py - Workflow graph → Graph checkpointing: suspends for approval
README.md - Triage and investigation → On-call reviewer: requests approval
README.md - Triage and investigation → Incident API: returns report
README.md - Triage and investigation → Metrics and logging: records run metrics
app/agents/nodes.py - Triage and investigation → LangSmith tracing: emits traces
app/agents/nodes.py - Agent evaluation → Agent assembly: evaluates outcomes
app/evaluation/harness.py