How maharanasunil1843/signalmesh works
1. What this repository is
- A small CLI-based multi-agent incident triage system.
- Its core job is to turn deterministic network telemetry into a structured incident report using two separate LLM agent roles: Analyst and Reporter.
2. Top-level execution path
- main.py is the entrypoint.
- It selects a scenario or runs the success metric, wires together the provider and graph, and prints the final report to stdout while emitting trace output to stderr.
- There is no server, UI, or background worker model here; each run is a single synchronous pipeline.
3. Core runtime boundary: the agent graph
- src/graph.py is the orchestration layer.
- It wires the Analyst and Reporter into a small graph with one bounded conditional branch: if the Analyst output is low-confidence or missing, the flow can re-run once, then either continue or fail safe.
- This is the main control-flow boundary in the repo.
4. Analyst subsystem
- src/agent_analyst.py is responsible for tool use, root-cause interpretation, and producing a validated finding.
- It is the only place that can invoke telemetry data.
- Its output is constrained to the typed handoff contract, which prevents downstream agents from receiving raw telemetry directly.
5. Reporter subsystem
- src/agent_reporter.py consumes only the validated Analyst finding.
- It produces the final incident report and is structurally isolated from the telemetry tool and raw telemetry payloads.
- This separation is the repo’s main architectural enforcement mechanism for agent decoupling.
6. Typed handoff contract
- src/handoff_contract.py defines the boundary object passed from Analyst to Reporter.
- The contract is what makes the boundary enforceable: the Reporter’s input is not “whatever the Analyst saw,” but a specific validated finding type.
- This is the key dependency barrier in the system diagram.
7. Telemetry source
- src/tool_network_data.py provides synthetic, deterministic telemetry.
- The Analyst is the only agent that can call this tool, and the data is intentionally mockable and reproducible.
- In architecture terms, this is an internal data source, not an external service.
8. Provider abstraction and model backends
- src/provider.py defines a ModelProvider protocol and implements both a deterministic mock provider and an OpenAI-backed provider.
- Agents never import vendor SDKs directly; they speak only through this provider interface.
- Vendor-specific failures are normalized so provider concerns do not leak into agent logic.
9. Resilience and failure handling
- src/resilience.py centralizes bounded retry, timeout, and explicit guard logic.
- The repo deliberately avoids scattered ad hoc exception handling in the agents.
- This module supports the single retry policy and the “fail-safe” unresolved outcome when the Analyst cannot identify a real router id.
10. Observability
- src/observability.py emits structured JSON decision traces.
- Tracing is a first-class integration point rather than an afterthought, and it is kept separate from the agent logic.
- The README indicates this module can later be pointed at OpenTelemetry or LangSmith without changing agent code.
11. Evaluation and task-success metric
- src/success_metric.py implements a deterministic programmatic score for the triage behavior.
- The metric validates that good scenarios carry the Analyst’s router id through to the report, while empty or malformed telemetry causes a safe decline instead of fabrication.
- docs/EVALUATION_LOG.md records the evaluation outcome.
12. Testing strategy
- tests/test_success_metric.py and tests/test_resilience.py cover the offline deterministic behavior.
- tests/test_provider_integration.py covers the OpenAI path and auto-skips unless the environment is configured for the real provider.
- The test suite mirrors the architecture: contract validation, retry/failure behavior, and provider integration are separated.
13. Operational profile
- The default mode is offline and reproducible, with no API key required.
- Real model usage is an opt-in switch via environment configuration.
- This makes the system suitable for local evaluation, CI, and reproducible demos without changing code.
14. Main architectural takeaway
- The repo is built around a narrow, enforceable pipeline: telemetry tool → Analyst → typed contract → Reporter → final report, with one bounded retry and an explicit unresolved fallback.
- The strongest architectural boundaries are between tool access, agent roles, and provider implementation.
Main entry points: agent_analyst.py Analyst · agent_reporter.py Reporter · graph.py Agent graph · success_metric.py Success metric
Components 14
Runtime
Synchronous CLI execution and graph orchestration
- main.py · Selects scenario or runs the metric, wires the pipeline, and prints the final report
main.py - Agent graph · Coordinates Analyst and Reporter with one bounded retry/fail-safe branch
src/graph.py
Agents
Analyst and reporter roles plus their typed boundary
Infrastructure
Provider, telemetry, resilience, and observability support
- Telemetry · Synthetic deterministic network telemetry available only to the Analyst
src/tool_network_data.py - Provider · Protocol plus mock and OpenAI-backed model implementations
src/provider.py - Resilience · Central retry, timeout, and explicit fail-safe logic
src/resilience.py - Tracing · Emits JSON decision traces separate from agent logic
src/observability.py
Evaluation
Deterministic task success metric and recorded results
- Success metric · Deterministic score for triage correctness and safe decline behavior
src/success_metric.py
Tests
Offline and integration test coverage
- Provider tests · OpenAI-path coverage with environment-gated skip
tests/test_provider_integration.py - Resilience tests · Retry and failure-path coverage
tests/test_resilience.py - Metric tests · Offline deterministic behavior coverage for the success metric
tests/test_success_metric.py
Docs
Evaluation log and project documentation
- Eval log · Recorded evaluation outcome and notes
docs/EVALUATION_LOG.md
Connections 21
- main.py → Agent graph: runs · Entry point launches the orchestration layer
- main.py → Success metric: can run · CLI can execute the deterministic success metric path
- Agent graph → Analyst: invokes · Orchestration starts with the Analyst
- Agent graph → Reporter: invokes · Reporter is called after validated analysis
- Analyst → Telemetry: reads · Only the Analyst may access raw telemetry
- Analyst → Provider: uses · Agent speaks to model backends through the provider interface
- Analyst → Resilience: guards · Retry and fail-safe behavior is centralized outside agent logic
- Analyst → Tracing: traces · Analysis decisions are emitted as structured traces
- Analyst → Handoff: produces · Validated finding becomes the typed boundary object
- Handoff → Reporter: consumed by · Reporter accepts only the typed, validated finding
- Reporter → Provider: uses · Reporter can use the provider without vendor SDK coupling
- Reporter → Resilience: guards · Reporter participates in centralized guard and timeout policy
- Reporter → Tracing: traces · Final reporting decisions are traced structurally
- Agent graph → Resilience: applies · Graph enforces one bounded retry and fail-safe unresolved outcome
- Agent graph → Tracing: emits · Pipeline control-flow decisions are traced
- Success metric → Handoff: validates · Metric checks whether the router id survives into the handoff/report path
- Success metric → Reporter: scores · Metric inspects report quality and safe decline behavior
- Success metric → Eval log: records · Evaluation outcome is documented
- Provider tests → Provider: covers · Exercises the real provider path when configured
- Resilience tests → Resilience: covers · Validates retry and failure behavior
- Metric tests → Success metric: covers · Checks deterministic offline scoring behavior