Git Product home page Git Product logo

ios-xe-rag-w-agents's Introduction

IOS-XE-RAG-W-Agents

Work in progress, I do not suggest using this until updated.

Currently includes:

  • (complete) a Cisco command reference parser (only tested for IOS XE 17.X docs). Stores commands as documents in a vector database for RAG.
  • (semi-working) Agent workflow that is meant to provide high-level information about the network:
    • One agent breaks down the question into a simpler, straightforward question.
    • Another agent picks the best command from a list of commands provided by semantic search (RAG).
    • Documentation and question are validated by another agent.
    • Loops back if the command does not answer the question.
    • Topology agent selects network devices to run the chosen command on.
    • Another agent compiles the outputs from all the network devices into an overall answer to the question.
    • Starts the process again with another part of the original question.
    • Continues checking until the final answer is reached.

Still needs A LOT of work with prompting.

WindowsTerminal_QcmyD4yLOH

General warning

This uses OPENAI Embeddings and chat completion APIs and can be quite costly.

Installation

To install the necessary dependencies, clone the repository and use the provided requirements.txt file:

git clone https://github.com/jamesduv9/ios-xe-rag-w-agents.git
cd ios-xe-rag-w-agents
pip install -r requirements.txt

Usage

Configuration

Environment Variables

The project uses environment variables for configuration. Ensure you have a .env file with the required variables. An example .env file might look like this:

OPENAI_API_KEY=your_key
DEVICE_USERNAME=your_username
DEVICE_PASSWORD=your_password

Topology Configuration

The topology configuration is specified in the topology_config.json file. Edit this file to match your network topology. This file is fed directly into the topology agent and must be accurate to ensure correct devices are picked.

CLI

ios-xe-rag-w-agents.py is a CLI that can be ran to execute the main functionality of the project. Ensure you have configured the necessary environment variables and configuration files.

python ios-xe-rag-w-agents.py

Usage: ios-xe-rag-w-agents.py [OPTIONS] COMMAND [ARGS]...

Options:
  --help  Show this message and exit.

Commands:
  agent-workflow
  command-ref-scrape  Scrapes the cisco command ref docs.
  forum-scrape        Creates a forum scraper object begins scraping the...

Scraping command references

In order for the agent workflow to work at all, you'll need to scrape the cisco command reference docs to get data inside your vector db.

python ios-xe-rag-w-agents.py command-ref-scrape --base-url "https://www.cisco.com/c/en/us/td/docs/ios-xml/ios/17_xe/command/command-references.html" --vector-store my_stores/new_store --command-filter show

This will create a new vector db in the my_stores directory. Inside that vector db we will store every command that contains show (because of the filter). Each of the commands are inside the db as a single "document" and can be retrieved later through semantic search.

Starting Agent Workflow

Once you've got your vector db setup and loaded with relevant commands, run the agent workflow-

python ios-xe-rag-w-agents.py agent-workflow --vector-store-path my_stores/new_store

This will then prompt you for a question and start the workflow, cross your fingers, and hope for a good response.

ios-xe-rag-w-agents's People

Contributors

jamesduv9 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.