Git Product home page Git Product logo

askbatfish's Introduction

AskBatfish: Chat-based Network Management and Verification

AskBatfish allows you to interact with Batfish through natural language Q&A using Large Language Models (LLMs). It provides a Chatbot UI built with Chainlit and integrates LLMs via LangChain, with persistence handled by Neo4j.

Getting Started

Prerequisites

  1. Create a .env File: Generate this file based on the env.example template.

    Note: The chatbot uses gpt-4o. You need to generate an OpenAI API key and configure it in the .env file.

  2. Environment Variables:

    Variable Name Default Value Description
    OPENAI_API_KEY None REQUIRED - Your OpenAI API key
    NEO4J_URI neo4j://neo4j:7687 REQUIRED - URL to Neo4j database
    NEO4J_USERNAME neo4j REQUIRED - Username for Neo4j database
    NEO4J_PASSWORD 12345-password REQUIRED - Password for Neo4j database

Running AskBatfish

  1. Build and Start (If first time or changes have been made):

    cd chatbot/
    docker compose up --build
  2. Start:

    cd chatbot/
    docker compose up
  3. Watch Mode (Auto-rebuild on file changes):

    • First, start everything.
    • Then, in a new terminal:
    cd chatbot/
    docker compose watch

Using AskBatfish

The chatbot UI will prompt you to upload a snapshot of your network in .zip format. If you are unfamiliar with Batfish, refer to this page to learn how to package your network snapshot configuration files.

Example network snapshots are available in the /networks directory for you to experiment with.

Modes of Operation

AskBatfish offers two modes:

  1. Agent Mode: This mode includes an agent that can interpret results and provide detailed explanations.
  2. Basic Mode: This mode returns raw results directly from Batfish, preferred by engineers who need to see direct results.

In Basic Mode, users can prefix their queries with /ask to get help formulating their questions. This feature guides users in providing the necessary details for accurate responses.

Shutting Down

If health checks fail or containers do not start as expected, shut down completely before starting up again:

docker compose down

Contributing

Please read CONTRIBUTING.md for details on our code of conduct and the process for submitting pull requests.

License

This project is licensed under the MIT License - see the LICENSE.md file for details.

Contact

For any questions or concerns regarding this project, please feel free to contact us at: amaroxmo <at> gmail <dot> com.

askbatfish's People

Contributors

amar-ox 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.