This project is a Retrieval-Augmented Generation (RAG) chatbot for network engineering documentation.
- β‘ Runs entirely on CPU β no GPU required (This makes it lightweight and portable, but responses may be slower compared to GPU setups.)
- π Privacy-focused β everything is processed locally on your machine:
- Documents are never uploaded to the cloud
- Embeddings are stored in a local Chroma database
- LLM inference is done through Ollama, fully offline
This makes the chatbot lightweight, portable, and secure for use with sensitive networking documentation.
- Ollama for running local LLMs (e.g., llama3.2:3b)
- Chroma as the vector database
- HuggingFace embeddings for semantic search
- Unstructured for PDF/Doc parsing
- LangChain Text Splitters for clean chunking
- Rich for colored terminal UI
The chatbot retrieves context from your networking documentation (PDFs) and answers queries with proper citations.
.
βββ .env # Environment variables
βββ chat.py # Interactive chatbot loop
βββ RAG_network_documents.py # Script to process docs & build vector DB
βββ tools.py # Utilities (embedding, retriever, logging, checks)
βββ docs/ # Place your PDF docs here
β βββ CISCO - XR
β β βββ Cisco XR 12000 Series Router.pdf
β β
β βββ HUAWEI - NE40e
β β βββ NE40E Product Description.pdf
β β
β βββ NOKIA - SR-7750
β βββ nokia-7750-service-router-datasheet-en.pdf
β
βββ chromadb/ # Chroma persistence directory (auto-created)
βββ chat_logs/ # Saved chat logs (JSON + Markdown, auto-created)
pip install -r requirements.txtStart the Ollama server:
ollama serveEdit the .env file:
MODEL_NAME="llama3.2:3b"
CHROMA_DB_PATH="./chromadb"
COLLECTION_NAME="network_docs"
DOCS_PATH="./docs"
EMBEDDING_MODEL_NAME="intfloat/multilingual-e5-large-instruct"
TOP_K=5To process your networking PDFs into embeddings and store them in Chroma:
python RAG_network_documents.pyThis will:
- Parse PDFs from
./docsusing unstructured - Chunk the text using LangChain text splitters
- Generate embeddings
- Store them in the Chroma DB
Start an interactive chat:
python chat.py- Colored terminal UI
- Context-aware answers with citations
/exit,/quit,/qto exit- Empty queries are ignored
- Chat logs saved as JSON + Markdown on exit
This project was inspired by and adapted from: Ray End-to-End RAG Tutorial
LinkedIn: Lahcen Khouchane WebSite : NetOpsAutomation.com