CybertraceAI is an open-source AI agent designed to simplify network management through natural language interactions. It currently specializes in Cisco networking devices, with plans to expand support to other vendors like SONiC and Juniper.
CybertraceAI uses local language models to interpret and execute network commands, making network management more accessible and efficient. It combines:
- Ollama for local LLM processing (llama 3.2 3B) and embeddings (Nomic)
- Chainlit for interactive chat interface
- Langchain for LLM orchestration
- Netmiko for device communication
- Dynamic tool selection using embeddings
CybertraceAI is being developed in phases, with each phase introducing new capabilities:
-
Verification Module (Currently in Development)
- Support for common show commands
- Real-time command interpretation
- Basic network status monitoring
- Device configuration validation
-
Configuration Module (Pending)
- Support for configuration commands
- Human-in-the-loop approval process
- Configuration validation and rollback
- Change management integration
- Configuration templates and best practices
-
Observability Module (Pending)
- Advanced telemetry collection
- Performance metrics analysis
- Custom monitoring dashboards
- Anomaly detection
- Historical data analysis
-
Proactivity Module (Pending)
- Automated issue detection
- Predictive maintenance
- Network optimization recommendations
- Automated remediation workflows
- Capacity planning insights
- Natural language interface for network commands
- Local execution using Ollama language models (llama 3.2 3B)
- Dynamic tool selection using Nomic embeddings
- Zero-cloud dependency - runs entirely on your infrastructure
- Secure credential management with session-based storage
- Interactive streaming responses with interpretation
- Supports the following Cisco networking commands:
show running-config
- View current device configurationshow version
- Check system hardware and software statusshow ip route
- View IP routing tableshow interfaces
- Check detailed interface informationshow cdp neighbors
- View connected devicesshow vlan
- Check VLAN configurationshow spanning-tree
- View spanning tree statusshow ip ospf
- Check OSPF routing informationshow ip bgp
- View BGP routing informationshow processes cpu
- Monitor CPU utilizationshow interface description
- View interface descriptionsshow ip interface brief
- Check interface IP and statusshow ip protocols
- View IP protocol informationshow logging
- View system logs and events
- The
show running-config
andshow logging
commands may experience timeout issues with larger configurations.
- Python 3.11 or higher
- Ollama installed locally with:
- llama 3.2 3B model for command processing
- Nomic embedding model for tool selection
- Access to Cisco networking devices
- Required Python packages:
- chainlit
- langchain
- netmiko
- langgraph
- Minimum 16GB RAM required
- 64GB free disk space
- NVIDIA Series 40 graphics card is desirable for optimal performance
-
Clone the repository:
git clone https://github.com/yourusername/cybertrace-ai.git cd cybertrace-ai
-
Create and activate a virtual environment:
# On Windows python -m venv venv # Activate on Windows CMD .\venv\Scripts\activate.bat # Activate on Windows PowerShell .\venv\Scripts\Activate.ps1 # On macOS/Linux python3 -m venv venv source venv/bin/activate
-
Install dependencies:
pip install -r requirements.txt
-
Configure your environment:
cp .env.example .env # Edit .env with your settings if needed
-
Run CybertraceAI:
chainlit run chainlit_app.py
Once configured, you can start interacting with CybertraceAI using natural language commands. The system will securely prompt for device credentials on first use and cache them for the session.
# Check interface status
"Show me the status of all interfaces on 192.168.1.10"
# Verify VLAN configuration
"List all VLANs and their associated ports on 10.0.0.1"
# Troubleshoot connectivity
"Check if there are any errors on GigabitEthernet1/0/1 for device 172.16.0.100"
# View running configuration
"Show the running configuration of device 192.168.2.50"
CybertraceAI can be extended with additional Cisco IOS commands by modifying the following files:
-
In
tools.py
:# Add to cisco_commands dictionary cisco_commands = { # ... existing commands ... "your new command": "Description of the command", }
-
The system will automatically:
- Create the necessary tool functions
- Register the tools with unique IDs
- Index the commands in the vector store for dynamic selection
-
Update the command description in
app.py
system template under the appropriate category:AVAILABLE TOOLS: // ... existing categories ... CATEGORY: - your_new_command: Description of what it does
Remember to:
- Ensure the command is supported by Cisco IOS
- Add proper error handling
- Test thoroughly before deployment
- Consider command timeout requirements
- Credentials are stored only in session memory
- Password inputs are masked in the UI
- No data is sent to external servers
- All processing happens locally
- Automatic credential cleanup
- Session-based authentication
chainlit_app.py
: Main application interface and chat handlingapp.py
: Core logic and LLM configurationtools.py
: Network command implementations- Uses Langchain for LLM orchestration
- Implements streaming responses for real-time feedback
- Includes comprehensive error handling and debugging
We welcome contributions!
This project is licensed under the Apache 2.0 License. See the LICENSE file for more details.
- Create an issue on GitHub
- Join our Discord community
- Email: [email protected]