Skip to content

Repository files navigation

πŸ›°οΈ Argus

An AI on-call engineer β€” it investigates production alerts, finds the root cause, and safely fixes it or escalates to a human.

License: MIT Python 3.12 LangGraph FastAPI React Postgres + pgvector Docker

When an alert fires, Argus does what a seasoned SRE does: it reads the logs, checks the metrics, reviews recent deploys, forms a root-cause hypothesis, has that hypothesis independently reviewed, and then β€” depending on risk and confidence β€” either fixes the problem itself or pauses and asks a human to approve. The decision to act is made by a deterministic policy, never by the language model. Every step is traced down to the individual prompt, token, and dollar. Every resolved incident becomes a memory that makes the next similar incident faster and cheaper.

It ships with its own live demo world β€” a small e-commerce stack you can break in five realistic ways β€” so you can watch the whole investigate β†’ approve β†’ remediate β†’ learn loop end to end, on your laptop, in minutes.

Trace explorer β€” a resolved live incident: 16 LLM + 8 tool calls, memory-informed, with the supervisor span opened to its exact prompt, tokens, and cost
A real resolved incident, opened as a trace β€” every LLM span drills down to its exact prompt, tokens, and cost.
Live incident feed
Live incident feed β€” status, escalation, cost
Approval card with proposed remediation, confidence, and evidence
Approval card β€” approve / modify / reject
Cost and outcome dashboard
Dashboard β€” outcomes, cost, tokens by role
Argus demo β€” inject a bad deploy β†’ diagnose β†’ approve the rollback β†’ recovery
One real incident, end to end: inject a bad deploy β†’ watch the live investigation β†’ approve the rollback β†’ recovered, and a memory written.

✨ Features

  • πŸ€– Multi-agent investigation β€” a supervisor plans the investigation, specialist agents gather evidence in parallel using real tools (log search, metric queries, deploy history), and a reviewer independently validates the hypothesis. It's a stateful graph, not a linear prompt chain.
  • πŸ›‘οΈ Safety by construction β€” the LLM only proposes a fix; a deterministic risk policy disposes. Anything risky requires human approval, and destructive actions are locked to a single node behind a privileged, token-authenticated actuator.
  • πŸ™‹ Human-in-the-loop β€” high-risk incidents pause for a human with the full context (evidence, reasoning, proposed action). The paused investigation is durable β€” it survives a restart and resumes from the exact step on approve / modify / reject.
  • 🧠 Memory that compounds β€” every resolved incident is distilled into a vector memory. When a similar fault recurs, Argus recalls the past fix and resolves it in fewer steps.
  • πŸ”­ Full observability β€” one OpenTelemetry instrumentation feeds both a queryable Postgres store (powering the UI) and an optional Jaeger view. Open any incident as a trace tree, drill into a span, and see the exact prompt, token counts, and cost.
  • πŸ–₯️ Operator console β€” a React UI: live incident feed, an interactive trace explorer, approval cards, a memory browser, and cost/outcome dashboards.
  • πŸ“Š Measured, not vibes β€” a 15-case seeded-fault evaluation suite scores root-cause accuracy, remediation correctness, recovery rate, escalation precision/recall, and cost β€” with ablations (memory on/off, model A/B).

πŸ—οΈ How it works

flowchart LR
  subgraph WORLD["🌐 Demo world (the patient)"]
    LG[load generator] --> SA[shop API]
    SA --> PS[payment service]
    SA --> DB[(Postgres)]
    SA --> RC[(Redis cache)]
    AW[alert watcher]
    ACT[actuator]
  end
  subgraph ARGUS["πŸ›°οΈ Argus platform (the doctor)"]
    API[REST API] --> Q[(queue)] --> WK[worker Β· LangGraph]
    WK --> PG[(Postgres + pgvector)]
    UI[React console] --> API
  end
  AW -- alert --> API
  WK -- reads logs / metrics / deploys --> WORLD
  WK -- remediation --> ACT
  WK -- reasoning --> LLM[Cerebras / Groq / Gemini]
Loading

The incident loop: an alert becomes an incident β†’ the graph runs plan β†’ investigate (parallel specialists) β†’ synthesize β†’ review β†’ risk gate β†’ remediate or request approval β†’ verify recovery β†’ write postmortem memory, checkpointed at every step so it can pause for a human and resume later.


🧰 Tech stack β€” and why

Every choice here is deliberate and defensible:

Concern Technology Why this one
Agent orchestration LangGraph Incidents are stateful, multi-step workflows with branching, retries, and human pauses. A graph with a durable checkpointer models that natively β€” a prompt chain can't pause, resume, or fan out to parallel workers.
API layer FastAPI Async REST with Pydantic validation at the boundary and automatic OpenAPI docs.
Background execution Celery + Redis A graph run takes minutes and must survive process restarts, so it runs on a durable task queue β€” not a request thread. Redis also backs the LLM rate limiter.
Data + memory PostgreSQL + pgvector One database for both relational data (incidents, spans, approvals) and vector memory. No separate vector service to run, secure, or pay for β€” and it's swappable behind a thin interface.
Embeddings fastembed (bge-small, ONNX) Local embeddings baked into the image β€” no embedding API, no rate limits, fully offline.
Language models Cerebras + Groq + Gemini A provider-agnostic router with record/replay caching and automatic fallback; swapping any role's model is one environment variable. High-volume roles run on Cerebras/Groq (generous free budgets); Gemini serves only the low-volume eval judge. Runs entirely on free tiers.
Observability OpenTelemetry Instrument once, export twice β€” to Postgres (powers our UI/dashboards) and optionally to Jaeger. Industry-standard trace trees, right down to prompt/token/cost.
Frontend React + TypeScript + Tailwind + Vite A typed, responsive operator console; TanStack Query polling keeps it simple (incidents last minutes, so no websockets needed).
Deployment Docker Compose The entire system β€” platform and a live demo world β€” boots with a single command, reproducibly, on any machine with Docker.
Dev toolchain uv Β· Ruff Β· Mypy Β· Pytest Fast, strict, fully typed β€” with unit, integration, and graph test tiers.

πŸš€ Getting started

Prerequisites

  • Docker + Docker Compose and git. That's it β€” every service runs in a container.
  • Three free LLM API keys (no credit card): Cerebras, Groq, and Google AI Studio (Gemini).

1 Β· Clone and configure

git clone https://github.com/Meetbarasara/argus.git
cd argus
cp .env.example .env         # then paste your GOOGLE_API_KEY and GROQ_API_KEY

2 Β· Launch the whole system

docker compose --profile platform --profile world up -d --build

This starts the Argus platform and the live demo world. Open the console at http://localhost:8081 β€” you'll see a quiet, healthy system.

3 Β· Break something and watch Argus respond

docker compose exec actuator python -m demoworld.inject --scenario S1

Within seconds an incident appears in the UI as INVESTIGATING; the trace tree grows live as the agents work; Argus diagnoses the stopped cache, restarts it, verifies recovery, and writes a memory β€” all on its own (S1 is low-risk, so it acts autonomously and just notifies you).

▢️ The guided 5-minute demo

For the full narrated storyline β€” a risky bad-deploy that pauses for your approval, then the same fault a second time resolving faster thanks to memory β€” run:

uv run python -m argus.demo          # interactive: approve in the UI when prompted
uv run python -m argus.demo --auto   # hands-free (auto-approves) β€” great for recording

The five fault scenarios

Each one is a reproducible fault with a known correct fix β€” this is what "working" means:

Scenario What breaks Argus's fix Human approval?
S1 redis_down cache container stopped restart the cache auto (just notifies)
S2 payment_latency payment service slows down β€” with no deploy to blame restart the service βœ… approve
S3 bad_deploy a deploy points checkout at a dead payment URL roll back that deploy βœ… approve
S4 db_pool_exhaustion a deploy shrinks the DB connection pool roll back that deploy βœ… approve
S5 feature_flag_500 a deploy enables a broken feature flag roll back that deploy βœ… approve

S2 is the interesting one β€” there's no recent deploy, so an agent that blindly blames the last change gets it wrong. Argus doesn't.


πŸ›‘οΈ The safety model

Argus is built so a language model can never authorize its own risky action. Three independent layers stand between a hypothesis and a production change:

  1. Independent review β€” a separate reviewer agent must accept the hypothesis before it can proceed; weak evidence loops back for revision, then escalates.
  2. A deterministic risk gate β€” plain code (not an LLM) maps (action Γ— target Γ— confidence) to an escalation level. The model proposes; policy disposes.
  3. Human-in-the-loop β€” anything above "notify" pauses for a human, who sees the full evidence and approves, modifies, or rejects. Approval resumes the exact paused step.

Plus capability isolation: only the privileged actuator can touch infrastructure, behind a token that never appears in a log or a prompt β€” agents get capabilities, not credentials.


πŸ“ Project structure

src/argus/        The platform β€” api Β· worker Β· graph Β· agents Β· llm Β· tools Β· memory Β· policy Β· obs Β· evals
src/demoworld/    The monitored world β€” shop & payment services, load generator, alerting, fault injector
ui/               React + TypeScript operator console (5 pages)
config/           Model routing, risk policy, alert rules, pricing (all YAML)
evals/scenarios/  The versioned 15-case evaluation suite

Run the checks locally: uv run poe verify (lint + types + unit tests) or uv run poe verify-all (adds the integration + world tiers).


πŸ“Š Evaluation

Argus grades itself on 15 seeded-fault cases (the five scenarios above Γ— three variants: clean, decoy-deploys, and noisy) across root-cause accuracy, remediation correctness, recovery rate, escalation precision & recall, MTTR, and cost β€” plus two ablations (memory on/off and a supervisor-model A/B). Grading is mostly deterministic: recovery is re-derived from raw metrics, so the system never grades its own homework; only root-cause phrasing is judged, with an auditable rubric.

Latest run (free-tier models, all 15 cases real investigations β€” no artifacts):

RCA accuracy Outcome Recovery Escalation
10/15 (67%) 8/15 PASS Β· 2 partial 8/8 (100%) precision 92% / recall 100%

It fails closed β€” 100% recovery on autonomous fixes and never once auto-resolves a case that needed a human. The instructive gap is RCA 67% vs PASS 53%: it diagnoses more than it acts on, preferring to escalate to a human when uncertain. Full method, per-case table, failure analysis, and reproduction command in EVALUATION.md.


πŸ—ΊοΈ Scope

Argus is a focused, single-operator system β€” deliberately not trying to be a cloud product. Out of scope by design: authentication/multi-tenancy, Kubernetes (Compose only), real PagerDuty/Slack integrations (the webhook + UI stand in), token streaming, and fine-tuning. The demo world stays intentionally small (two app services + two datastores) so the platform is where the engineering goes.


πŸ“„ License

Released under the MIT License.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages