# abellache-rabah/ai-network-engineer architecture

> Architecture diagram of the GitHub repository abellache-rabah/ai-network-engineer, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-30). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/abellache-rabah/ai-network-engineer
- Repository: https://github.com/abellache-rabah/ai-network-engineer

## Overview

This is a natural-language network-automation agent for a GNS3 simulation, exposed through seven MCP servers. The principal workflow is an AI client coordinating IP allocation, inventory updates, configuration deployment, and connectivity verification. Separate capabilities provide topology and documentation lookup, pre-deployment checks, monitoring, security audits, and traffic tests. Shared console utilities connect several services to simulated devices. The README documents the workflow and server roles; source excerpts show implementation details for the listed servers and shared helpers, but not the AI client’s internal orchestration.

Main entry points: [`servers/librarian/server.py`](https://github.com/abellache-rabah/ai-network-engineer/blob/main/servers/librarian/server.py) (Librarian), [`shared/gns3_utils.py`](https://github.com/abellache-rabah/ai-network-engineer/blob/main/shared/gns3_utils.py) (GNS3 console), [`servers/verifier/src/server.py`](https://github.com/abellache-rabah/ai-network-engineer/blob/main/servers/verifier/src/server.py) (Verifier), [`servers/ipam/server.py`](https://github.com/abellache-rabah/ai-network-engineer/blob/main/servers/ipam/server.py) (IPAM)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_source["Network source"]
  node_librarian["Librarian<br/>[server.py]"]
  node_inventory[("Inventory<br/>[inventory.yaml]")]
  node_knowledge["Network docs"]
  node_topology["Physical topology"]
  node_ipam["IPAM<br/>[server.py]"]
  node_ipamdb[("IPAM database<br/>[ipam_db.json]")]
end

subgraph group_change["Config changes"]
  node_verifier["Verifier<br/>[server.py]"]
  node_batfish["Batfish checks<br/>[batfish_utils.py]"]
  node_hostverify["Host config checks<br/>[host_utils.py]"]
  node_deployer["Deployer<br/>[server.py]"]
end

subgraph group_operations["Operations"]
  node_observer["Observer<br/>[server.py]"]
  node_auditor["Auditor<br/>[server.py]"]
  node_traffic["Traffic generator<br/>[server.py]"]
end

subgraph group_shared["Shared runtime"]
  node_console["GNS3 console<br/>[gns3_utils.py]"]
end

node_agent(("AI agent"))
node_devices{{"GNS3 devices"}}

node_agent -->|"allocates address"| node_ipam
node_agent -->|"updates inventory"| node_librarian
node_agent -->|"deploys config"| node_deployer
node_agent -->|"checks connectivity"| node_observer
node_agent -->|"validates config"| node_verifier
node_agent -.->|"requests audit"| node_auditor
node_agent -.->|"requests traffic test"| node_traffic
node_librarian -->|"reads and writes"| node_inventory
node_librarian -->|"searches docs"| node_knowledge
node_librarian -->|"reads topology"| node_topology
node_ipam -->|"reads and writes"| node_ipamdb
node_verifier -->|"checks device config"| node_batfish
node_verifier -->|"checks host config"| node_hostverify
node_deployer -->|"deploys commands"| node_console
node_observer -->|"queries device state"| node_console
node_traffic -->|"runs iperf commands"| node_console
node_console -->|"connects by socket"| node_devices

click node_librarian "https://github.com/abellache-rabah/ai-network-engineer/blob/main/servers/librarian/server.py"
click node_inventory "https://github.com/abellache-rabah/ai-network-engineer/blob/main/shared/inventory.yaml"
click node_knowledge "https://github.com/abellache-rabah/ai-network-engineer/tree/main/shared/docs"
click node_topology "https://github.com/abellache-rabah/ai-network-engineer/blob/main/shared/topology_physical.yaml"
click node_ipam "https://github.com/abellache-rabah/ai-network-engineer/blob/main/servers/ipam/server.py"
click node_ipamdb "https://github.com/abellache-rabah/ai-network-engineer/blob/main/servers/ipam/ipam_db.json"
click node_verifier "https://github.com/abellache-rabah/ai-network-engineer/blob/main/servers/verifier/src/server.py"
click node_batfish "https://github.com/abellache-rabah/ai-network-engineer/blob/main/servers/verifier/src/batfish_utils.py"
click node_hostverify "https://github.com/abellache-rabah/ai-network-engineer/blob/main/servers/verifier/src/host_utils.py"
click node_deployer "https://github.com/abellache-rabah/ai-network-engineer/blob/main/servers/deployer/server.py"
click node_observer "https://github.com/abellache-rabah/ai-network-engineer/blob/main/servers/observer/server.py"
click node_auditor "https://github.com/abellache-rabah/ai-network-engineer/blob/main/servers/auditor/server.py"
click node_traffic "https://github.com/abellache-rabah/ai-network-engineer/blob/main/servers/traffic_gen/server.py"
click node_console "https://github.com/abellache-rabah/ai-network-engineer/blob/main/shared/gns3_utils.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_librarian,node_inventory,node_knowledge,node_topology,node_ipam,node_ipamdb toneBlue
class node_verifier,node_batfish,node_hostverify,node_deployer toneAmber
class node_observer,node_auditor,node_traffic toneMint
class node_console toneRose
class node_agent,node_devices toneIndigo
```

## Components

### Network source

- [Librarian](https://github.com/abellache-rabah/ai-network-engineer/blob/main/servers/librarian/server.py): `servers/librarian/server.py`
- [Inventory](https://github.com/abellache-rabah/ai-network-engineer/blob/main/shared/inventory.yaml): `shared/inventory.yaml`
- [Network docs](https://github.com/abellache-rabah/ai-network-engineer/tree/main/shared/docs): `shared/docs`
- [Physical topology](https://github.com/abellache-rabah/ai-network-engineer/blob/main/shared/topology_physical.yaml): `shared/topology_physical.yaml`
- [IPAM](https://github.com/abellache-rabah/ai-network-engineer/blob/main/servers/ipam/server.py): `servers/ipam/server.py`
- [IPAM database](https://github.com/abellache-rabah/ai-network-engineer/blob/main/servers/ipam/ipam_db.json): `servers/ipam/ipam_db.json`

### Config changes

- [Verifier](https://github.com/abellache-rabah/ai-network-engineer/blob/main/servers/verifier/src/server.py): `servers/verifier/src/server.py`
- [Batfish checks](https://github.com/abellache-rabah/ai-network-engineer/blob/main/servers/verifier/src/batfish_utils.py): `servers/verifier/src/batfish_utils.py`
- [Host config checks](https://github.com/abellache-rabah/ai-network-engineer/blob/main/servers/verifier/src/host_utils.py): `servers/verifier/src/host_utils.py`
- [Deployer](https://github.com/abellache-rabah/ai-network-engineer/blob/main/servers/deployer/server.py): `servers/deployer/server.py`

### Operations

- [Observer](https://github.com/abellache-rabah/ai-network-engineer/blob/main/servers/observer/server.py): `servers/observer/server.py`
- [Auditor](https://github.com/abellache-rabah/ai-network-engineer/blob/main/servers/auditor/server.py): `servers/auditor/server.py`
- [Traffic generator](https://github.com/abellache-rabah/ai-network-engineer/blob/main/servers/traffic_gen/server.py): `servers/traffic_gen/server.py`

### Shared runtime

- [GNS3 console](https://github.com/abellache-rabah/ai-network-engineer/blob/main/shared/gns3_utils.py): `shared/gns3_utils.py`

### Other components

- **AI agent**
- **GNS3 devices**

## Connections

- AI agent → IPAM: allocates address (evidence: `README.md`)
- AI agent → Librarian: updates inventory (evidence: `README.md`)
- AI agent → Deployer: deploys config (evidence: `README.md`)
- AI agent → Observer: checks connectivity (evidence: `README.md`)
- AI agent → Verifier: validates config (evidence: `README.md`)
- AI agent → Auditor: requests audit
- AI agent → Traffic generator: requests traffic test
- Librarian → Inventory: reads and writes (evidence: `servers/librarian/server.py`)
- Librarian → Network docs: searches docs (evidence: `servers/librarian/server.py`)
- Librarian → Physical topology: reads topology (evidence: `servers/librarian/server.py`)
- IPAM → IPAM database: reads and writes (evidence: `servers/ipam/server.py`)
- Verifier → Batfish checks: checks device config (evidence: `servers/verifier/src/server.py`)
- Verifier → Host config checks: checks host config (evidence: `servers/verifier/src/server.py`)
- Deployer → GNS3 console: deploys commands (evidence: `servers/deployer/server.py`)
- Observer → GNS3 console: queries device state (evidence: `servers/observer/server.py`)
- Traffic generator → GNS3 console: runs iperf commands (evidence: `servers/traffic_gen/server.py`)
- GNS3 console → GNS3 devices: connects by socket (evidence: `shared/gns3_utils.py`)
