Guide

Dashboard walkthrough, integration setup, and configuration reference.

AI Integration Prompt

Paste this into Claude Code, Cursor, or Copilot. It audits your pipeline for compatibility, fixes issues, and adds ARGUS with the right config.

prompt.txt
I want to add ARGUS monitoring to my LangGraph pipeline. Before writing any code, audit my codebase and then integrate it properly.

## STEP 1 — AUDIT MY PIPELINE

Find the file where my StateGraph is defined and check these things:

1. STATE TYPE: Find my state class. ARGUS works best when state is a TypedDict (or Pydantic model / dataclass). If my state is just a plain dict, convert it to a TypedDict with proper field annotations. Example:

   # BAD — plain dict, ARGUS can't check field contracts
   app = graph.compile()
   result = app.invoke({"query": "...", "results": []})

   # GOOD — TypedDict lets ARGUS verify fields between nodes
   class AgentState(TypedDict):
       query: str
       results: list[str]
       summary: str

2. NODE RETURN TYPES: Check every node function. Each should:
   - Accept the state type as its first parameter (type-annotated)
   - Return a dict with only the fields it's responsible for
   - NOT return the entire state — just the fields it modifies

   # BAD — no type hint, returns everything
   def search(state):
       return {**state, "results": [...]}

   # GOOD — typed, returns only what it produces
   def search(state: AgentState) -> dict:
       return {"results": [...]}

3. GRAPH STRUCTURE: Check if the graph is:
   - Linear (A → B → C) — auto-finalize works, no extra code needed
   - Fan-out/fan-in (DAG) — auto-finalize works
   - Cyclic (has loops / back-edges) — will need watcher.finalize() after invoke

4. ASYNC CHECK: If node functions are async (async def), ARGUS handles both — just make sure you're using await app.ainvoke() not app.invoke().

5. EXTERNAL CALLS: List which nodes make external API calls (OpenAI, search APIs, databases). This determines whether to enable record_http.

Print a summary of what you found and any fixes needed before proceeding.

## STEP 2 — FIX COMPATIBILITY ISSUES

If you found issues in Step 1, fix them now:
- Convert plain dict state to TypedDict
- Add type annotations to node function parameters
- Make nodes return only their output fields (not the full state)
- Ensure all fields referenced by downstream nodes exist in the TypedDict

## STEP 3 — INTEGRATE ARGUS

Install: pip install argus-agents

Add ArgusWatcher to the file where the graph is built:

from argus import ArgusWatcher

watcher = ArgusWatcher(graph)          # pass StateGraph before compile()
app = graph.compile()
result = app.invoke(initial_state)
print(watcher.run_id)

If the graph is already compiled elsewhere, use watch_compiled():

watcher = ArgusWatcher()
app = watcher.watch_compiled(app)

## STEP 4 — PICK THE RIGHT CONFIG

Choose parameters based on what you found in the audit:

watcher = ArgusWatcher(graph,
    # ALWAYS RECOMMENDED
    strict=True,              # catches empty lists, nested errors, type mismatches
    persist_state=True,       # saves runs to .argus/runs/

    # IF nodes make paid API calls (OpenAI, etc.) — enables free deterministic reruns
    record_http=True,

    # IF you want LLM-powered quality checks on outputs (needs OPENAI_API_KEY)
    semantic_judge=True,      # reviews every node's output for subtle issues
    judge_model="gpt-4o",     # or "gpt-4o-mini" for cheaper runs

    # IF you want automatic root cause analysis on failures
    investigate=True,         # or "always" to investigate every run

    # IF any fields contain secrets or tokens
    redact_keys={"token", "api_key", "password"},

    # ADD validators for nodes that produce critical output:
    validators={
        # example: ensure summaries aren't empty stubs
        "summarize": lambda o: (len(o.get("summary", "")) > 10, "Summary too short"),
        # wildcard: runs on every node
        "*": lambda o: ("error" not in o, "error key present"),
    },
)

# IF the graph has cycles (loops / back-edges):
# watcher.finalize()    ← call after invoke

After running the pipeline, use "argus show last" to see what ARGUS caught.

Runs List

Your pipeline execution history. Every run with ARGUS attached shows up here automatically.

Runs list

Summary cards

Total Runs

Pipeline executions recorded in your workspace.

Clean

Runs where every node passed.

Failed

Runs with at least one failure or crash.

Pass Rate

Clean runs as a percentage of total.

Table columns

RUN IDUnique identifier. Click to open the detail view.
STATUSOverall result: clean, silent failure, crashed, or semantic fail.
GRAPHNode execution path shown as a chain.
STEPSNumber of nodes that executed.
FIRST FAILUREFirst node that produced bad output — the likely root cause.
SHAPEWhether all expected nodes ran (full) or the run was cut short (partial).

The Evaluation panel lets you filter runs by constraints like overall_status == clean.


Run Detail

Full picture of a single pipeline execution — metrics, execution trace, AI analysis, and initial state.

Run detail header and metrics

Header

Run ID, status, timestamp, duration, step count, and ARGUS version.

Root Cause Chain

Traces failures back to the originating node, not the node that complained.

Metrics

Duration

Wall-clock time for the full run.

Success Rate

Percentage of nodes that passed.

Failures

Nodes with any failure status.

Severity

Worst level seen: ok, warning, or critical.

Completed

Whether the pipeline reached the final node.

Execution timeline and AI analysis

Execution timeline

Nodes listed in execution order with name, output type, duration, and status. Failed nodes show a root cause annotation — which field was missing and which upstream node dropped it. Expand any row to see full I/O JSON.

AI Analysis

When OPENAI_API_KEY is set, ARGUS investigates non-clean runs automatically. The analysis panel has three sections:

Root Cause NodeThe node that first produced broken state.
ReasonWhy the node failed and how it propagated downstream.
How to FixNumbered action items targeting specific nodes.
AI fix steps and correlation
Behavior and initial state

Correlation

Confirms the true origin node with failure signals and a confidence score.

Behavior

Raw initial state your pipeline received — the exact input at invocation time.


Compare

Side-by-side diff of two runs. Useful for verifying fixes, catching regressions, or understanding performance differences.

Compare page overview
Compare node diff
1

Open CompareSidebar link, or the Compare button on any run detail page.

2

Enter two run IDsRun A is typically the broken run, Run B is the fix.

3

Read the verdictWinner banner shows which run performed better and why.

4

Read the node diffStatus in A vs B per node. Missing nodes labelled only in A / only in B.


Approvals

Gate deployments on ARGUS results. Runs that meet your criteria get approved; everything else is held for review.

Approvals page

Rerun

Re-execute from a specific node using the frozen input state from a previous run. Test a fix without re-running the full pipeline or making upstream LLM calls. Use record_http=True for fully deterministic reruns from disk.

1

Open the failing runClick the run ID to open its detail page.

2

Find the root cause nodeRed banner at the top names the originating node.

3

Click the rerun iconEach node row has a rerun icon. Click it on the root cause node.

4

Wait for the new runARGUS re-executes from that node forward, creates a new run.

5

Compare to confirmDiff the original against the rerun — broken nodes should now pass.

From the CLI

Rerun from a specific node
argus replay <run-id> <node-name>
With graph factory
argus replay <run-id> <node-name> --app my_pipeline:build_graph
Diff the results
argus diff <original-run-id> <rerun-run-id>

Configuration Reference

All ArgusWatcher parameters. Graph is the only positional argument — everything else is keyword-only.

ArgusWatcher(graph, **kwargs)
watcher = ArgusWatcher(
    graph,                  # your LangGraph StateGraph — auto-calls watch()

    # --- Output control ---
    max_field_size=50_000,  # max chars per field before truncation (default: 50k)
    redact_keys={"token", "api_key"},  # field names to scrub from stored outputs
    persist_state=True,     # save run records to .argus/runs/ (default: True)

    # --- Detection strictness ---
    strict=True,            # extra checks: nested error keys, rate-limit responses,
                            # empty lists, type mismatches. recommended for CI/staging.

    # --- Semantic validators ---
    validators={
        "summarize": lambda o: (len(o.get("summary","")) > 10, "Summary too short"),
        "*": lambda o: ("error" not in o, "error key present"),  # runs on every node
    },

    # --- LLM investigation ---
    investigate=True,       # LLM root-cause analysis on failures (default: True)
                            # set to "always" for every node, False to disable

    # --- Deterministic rerun ---
    record_http=True,       # saves every outbound API call to disk.
                            # reruns replay from disk — zero extra cost.

    # --- LLM semantic judge ---
    semantic_judge=True,    # LLM reviews every node's output for subtle quality issues.
                            # runs AFTER deterministic checks. needs OPENAI_API_KEY.
    judge_model="gpt-4o",  # or "gpt-4o-mini" for cheaper runs.
)

Access watcher.run_id after the run. Auto-saves for linear and DAG graphs. Call watcher.finalize() only for cyclic graphs.

record_http

Captures every HTTP request/response during the original run. On rerun, serves recorded responses back — same data, zero cost, fully reproducible.

Enable when nodes call paid APIs and you want cheap, identical reruns. Skip when you want the rerun to hit the real API.

semantic_judge

ARGUS catches ~80% of production failures deterministically — missing fields, empty results, type mismatches, placeholder outputs. The remaining ~20% are subtle: wrong tone, unhelpful responses, outdated info. The semantic judge covers those.

Deterministic firstStructural checks run first — free, instant, reproducible.
LLM secondJudge only reviews what structural checks couldn't decide.
Per-nodeEach output evaluated in context of its input and the pipeline's purpose.

Requires OPENAI_API_KEY. Enable for complex multi-agent pipelines. Skip for simple pipelines or zero-cost monitoring.