A fast, lightweight, and self-contained Retrieval-Augmented Generation (RAG) and search engine for Juniper technical documentation (KBs) and networking books (PDFs).
---
## 🚀 Features
- **Semantic Section-based Chunking**: Automatically parses Juniper KB metadata and chunks sections (Description, Symptoms, Cause, Solution/Workaround, and Fixed/Upgrade) separately.
- **Accurate PDF Extraction**: Uses `pdfplumber` with word boundary reconstruction (`x_tolerance=1.5`) to parse text from networking book PDFs without run-together words.
- **Ultra-Fast Vector Search**: Uses optimized **NumPy** matrix cosine similarity operations, delivering query retrieval times under **5 milliseconds**.
- **Resumable Indexing**: Remembers indexed files using a SQLite tracking table to ensure indexing is safe to pause and resume.
- **RAG Generation Endpoint**: Generates detailed, structured network engineering responses using Ollama LLMs by passing retrieved context chunks.
- **FastAPI REST API Service**: Exposes clean endpoints for `/health`, `/search`, and `/generate` (RAG synthesis) with autogenerated OpenAPI Swagger documentation.
- **Dockerized Deployment**: Fully containerized environment packaged with a pre-computed 170MB vector database for instant deployment.
---
## 📁 Repository Structure
```text
├── Dockerfile # Docker deployment configuration
├── README.md # Project documentation
├── app.py # FastAPI REST API web server
├── embed_docs.py # Document ingestion, parsing, and embedding script
You can expose the Juniper RAG Engine as tools to your AI Agent (like Claude Desktop) using the Model Context Protocol (MCP). The python script `mcp_server.py` implements the standard JSON-RPC stdio protocol.
### How it Works
The MCP server is a lightweight stdio subprocess. When the AI Agent starts, it spawns `mcp_server.py` which communicates with the running RAG Engine Docker container on `http://localhost:8010`.
### Configure your AI Agent Client
Add the following config block to your MCP client config file (e.g. `claude_desktop_config.json`):