Retrieval-Augmented Generation (RAG) database generator for OpenShift Container Platform Assisted Installer documentation.
Retrieval-Augmented Generation (RAG) is a powerful AI technique that combines the capabilities of large language models with external knowledge retrieval. Instead of relying solely on the model's training data, RAG systems:
- Retrieve relevant information from a knowledge base (vector database)
- Augment the user's query with this retrieved context
- Generate more accurate and up-to-date responses using both the retrieved information and the model's capabilities
This approach enables AI systems to provide more accurate, contextual, and current information by leveraging external documents and knowledge sources.
This RAG system processes documentation from Red Hat's Assisted Installer for OpenShift Container Platform. The source material is the official PDF documentation:
- Source: Red Hat Documentation - Assisted Installer for OpenShift Container Platform 2025
- Format: Converted from PDF to Markdown using docling
The processed documentation is stored in the docs/ directory as a markdown file, making it easier to chunk and embed for the RAG system.
- Python 3.12
- uv (Python package manager)
- Git with Git LFS support
- Podman (for container builds)
-
Clone the repository:
git clone https://github.com/carbonin/assisted-chat-rag cd assisted-chat-rag -
Install dependencies:
make install
This will:
- Install Python dependencies using uv
- Set up Git LFS for large file support
To generate the complete RAG database with default settings:
make build-dbThis single command will:
- Install all dependencies
- Download the embedding model
- Process the documentation
- Create the vector database
If you prefer to run the process step by step:
-
Download and convert documentation (optional - docs are already included):
make docs
This downloads the latest PDF from the official docs site and converts it to markdown.
-
Download the embedding model:
make all-mpnet-base-v2
This downloads the
sentence-transformers/all-mpnet-base-v2model for creating embeddings. -
Build the RAG database:
uv run ./main.py \ -o llama_stack_vector_db \ -f docs \ -md all-mpnet-base-v2 \ -mn sentence-transformers/all-mpnet-base-v2 \ -i ocp-assisted-installer-2025-07-18 \ --vector-store-type llamastack-faiss
The RAG database generation supports various configuration options:
-o: Output directory for the vector database-f: Input folder containing markdown documents-md: Directory containing the embedding model-mn: Name of the embedding model-i: Index name for the vector store--chunk: Chunk size for document processing (default from lightspeed-rag-content)--vector-store-type: Type of vector store (llamastack-faiss)
The generated RAG database will be saved in the llama_stack_vector_db/ directory.
Build a container image for deployment:
make build-imageThe default image name is quay.io/carbonin/assisted-chat-rag:latest. You can override this:
IMAGE_NAME=your-registry/your-image:tag make build-imageRemove generated files:
make cleanThis removes:
llama_stack_vector_db/directoryall-mpnet-base-v2/directory
View all available commands:
make help