This package manages the Retrieval-Augmented Generation (RAG) pipeline for GlassOps. It handles document discovery, embedding generation, vector indexing, and drift detection.
- ingestion/: Fetches and chunks markdown files from the monorepo.
- embeddings/: Generates vector embeddings using Google Gemini (via
google-generativeai). - drift/: Detects semantic drift in documentation over time.
- rag/: Provides a query engine for retrieving context-aware answers.
Ensure you have a .env file in the project root with your API key:
GOOGLE_API_KEY=your_key_hereTo scan docs, generate embeddings, and update the index:
# Using npm script (easiest)
npm run knowledge:pipelineTo avoid argument parsing issues with npm (especially on Windows), use the Python executable directly:
# Direct Python command (Recommended)
packages\knowledge\venv\Scripts\python.exe packages/knowledge/main.py --query "What is the update policy for ADRs?"
# NPM alternative (may require extra escaping on Windows)
npm run knowledge:pipeline -- --query "What is the update policy for ADRs?"To force a full re-index:
npm run knowledge:pipeline -- --index