How microsoft/agentrx works
AgentRx diagnoses failed AI-agent executions: a user supplies a trajectory, which is normalized to Trajectory IR, analyzed for static and per-step invariants, checked for violations, and passed to an LLM judge for failure-step and taxonomy classification; reports summarize results. The graph preserves the documented stages and major modules. Some implementation details are unsampled, so edges rely on the README or SOURCE INDEX references where available; optional client selection is shown separately.
Main entry points: run.py Pipeline Runner · checker.py Invariant Checker · judge.py Failure Judge · azure.py Azure Client
Components 15
Input Normalization
- Pipeline Runner
run.py - Package CLI
agentrx/cli.py - Trajectory IR
agentrx/ir/trajectory_ir.py
Invariant Analysis
- Domain Registry
agentrx/invariants/domain_registry.py - Static Invariants
agentrx/invariants/static_invariant_generator.py - Dynamic Invariants
agentrx/invariants/dynamic_invariant_generator.py - Invariant Checker
agentrx/invariants/checker.py
Diagnosis and Reports
- Failure Judge
agentrx/judge/judge.py - Failure Frequencies
agentrx/reports/analyze_failure_frequencies.py - Run Metrics
agentrx/reports/metrics.py
Runtime Support
- Azure Client
agentrx/llm_clients/azure.py - TRAPI Client
agentrx/llm_clients/trapi.py - Copilot Client
agentrx/llm_clients/copilot_cli.py - Runtime Settings
agentrx/pipeline/globals.py
Other components
- Trajectory User
Connections 25
- Trajectory User → Pipeline Runner: submits trajectory
README.md - Pipeline Runner → Trajectory IR: normalizes logs
run.py - Pipeline Runner → Static Invariants: runs stage
run.py - Pipeline Runner → Dynamic Invariants: runs stage
run.py - Pipeline Runner → Invariant Checker: runs stage
run.py - Pipeline Runner → Failure Judge: runs stage
run.py - Pipeline Runner → Failure Frequencies: runs report
run.py - Package CLI → Pipeline Runner: launches pipeline
- Trajectory IR → Domain Registry: uses converters
agentrx/ir/trajectory_ir.py - Static Invariants → Domain Registry: loads domain config
agentrx/invariants/static_invariant_generator.py - Dynamic Invariants → Trajectory IR: reads trajectory
agentrx/invariants/dynamic_invariant_generator.py - Invariant Checker → Trajectory IR: reads trajectory
agentrx/invariants/checker.py - Invariant Checker → Static Invariants: uses invariants
agentrx/invariants/checker.py - Invariant Checker → Azure Client: creates client
agentrx/invariants/checker.py - Invariant Checker → TRAPI Client: creates client
agentrx/invariants/checker.py - Invariant Checker → Copilot Client: creates client
agentrx/invariants/checker.py - Failure Judge → Azure Client: uses client
agentrx/judge/judge.py - Failure Judge → TRAPI Client: uses client
agentrx/judge/judge.py - Failure Judge → Copilot Client: uses client
agentrx/judge/judge.py - Failure Judge → Run Metrics: uses telemetry
agentrx/judge/judge.py - Azure Client → Runtime Settings: reads settings
agentrx/llm_clients/azure.py - Azure Client → Run Metrics: records telemetry
agentrx/llm_clients/azure.py - TRAPI Client → Runtime Settings: reads settings
agentrx/llm_clients/trapi.py - Copilot Client → Runtime Settings: reads settings
agentrx/llm_clients/copilot_cli.py - Pipeline Runner → Failure Frequencies: produces report
README.md