How xiaoxiaohexin/netops-ai-agent works
NetOps AI Agent is a CLI-driven network automation and self-healing product. Its documented primary flow turns an operator’s natural-language intent into a generated topology, offline checks it, requests approval, deploys it, probes connectivity, and attempts diagnosis and repair before a circuit-breaker decision. The repository also contains a Day-2 incident workflow for baseline and telemetry analysis, SOP-supported remediation, and sandbox preflight. Workflow wiring is represented at the documented stage level; unsampled implementation details are not inferred.
Main entry points: nodes.py Topology generation · runner.py Deployment · cli.py NetAgent CLI · operational_nodes.py Incident diagnosis
Components 22
CLI and orchestration
- NetAgent CLI
langgraph_netagent/langgraph_netagent/cli.py - Design workflow
langgraph_netagent/langgraph_netagent/workflow/graph.py - Day-2 workflow
langgraph_netagent/langgraph_netagent/workflow/operational_graph.py
Intent and topology
- Intent parsing
langgraph_netagent/langgraph_netagent/workflow/nodes.py - Topology generation
langgraph_netagent/langgraph_netagent/workflow/nodes.py - LLM providers
langgraph_netagent/langgraph_netagent/llm/providers
Network execution
- Offline validation
langgraph_netagent/langgraph_netagent/validation/offline_validator.py - Human approval
langgraph_netagent/langgraph_netagent/workflow/nodes.py - Deployment
langgraph_netagent/langgraph_netagent/tools/runner.py - Probe verification
langgraph_netagent/langgraph_netagent/tools/probes.py - Diagnosis and healing
langgraph_netagent/langgraph_netagent/workflow/nodes.py - Circuit breaker
langgraph_netagent/langgraph_netagent/workflow/edges.py
Day-2 operations
- Baseline and telemetry
langgraph_netagent/langgraph_netagent/workflow/operational_nodes.py - Incident diagnosis
langgraph_netagent/langgraph_netagent/workflow/operational_nodes.py - SOP retrieval
langgraph_netagent/langgraph_netagent/tools/sop_retriever.py - Remediation planning
langgraph_netagent/langgraph_netagent/workflow/operational_nodes.py - Sandbox preflight
langgraph_netagent/langgraph_netagent/tools/sandbox.py
Models and providers
- Domain contracts
langgraph_netagent/langgraph_netagent/models
Other components
- Network operator
- LLM service
- Approver
- Containerlab network
Connections 24
- Network operator → NetAgent CLI: provides intent
- NetAgent CLI → Design workflow: starts workflow
- Design workflow → Intent parsing: dispatches
- Intent parsing → LLM providers: requests parsing
- LLM providers → LLM service: queries
- Intent parsing → Topology generation: routes intent
- Topology generation → LLM providers: requests generation
- Topology generation → Domain contracts: produces topology
- Topology generation → Offline validation: submits topology
- Offline validation → Human approval: passes validation
- Approver → Human approval: decides
- Human approval → Deployment: authorizes deployment
- Deployment → Containerlab network: deploys lab
- Deployment → Probe verification: starts probes
- Probe verification → Diagnosis and healing: reports failures
- Diagnosis and healing → Deployment: retries deployment
- Diagnosis and healing → Circuit breaker: reports outcome
- NetAgent CLI → Day-2 workflow: starts operations
- Day-2 workflow → Baseline and telemetry: dispatches
- Baseline and telemetry → Incident diagnosis: supplies incident context
- Incident diagnosis → SOP retrieval: retrieves guidance
- Incident diagnosis → Remediation planning: informs plan
- Remediation planning → Sandbox preflight: preflights plan
- Remediation planning → Domain contracts: uses operational models