How leokwsw/local-rag works
Main Components
• Python Application: Represent the core “local_RAG.py” script, which acts as the backbone of the application logic – handling document ingestion, pre-processing with the Unstructured library, and orchestrating the retrieval and generation workflow.
• Document Ingestion & Pre-processing: Indicate the Unstructured library that is integrated in the Python code to ingest and process documents.
• Vector Database (Weaviate): Illustrate the Weaviate vector database that is started via Docker Compose (as indicated in the Docker instructions). This component stores indexed document embeddings.
• Llama2 Model Inference Engine: Include the locally installed Llama2 model (obtained using llama-cpp-python) used for generating responses based on the information retrieved from the vector database.
Relationships and Data Flow
• For the query or retrieval process, show a reverse flow: from the user or an “Application Query” component to the vector database to fetch relevant documents.
Architectural Patterns and Design Components
• Separation of concerns: the ingestion/pre-processing is decoupled from the data storage (Weaviate) and from the generation logic.
• Stress that the design is self-contained, meaning that each component is deployed locally (the Weaviate DB runs as a Docker container and the Llama model is installed locally).
Relevant Technologies
• Python (with details like version 3.9+ and virtual environment usage)
• Unstructured (the library for document processing)
• Docker & Docker Compose (for spinning up the Weaviate container)
• Weaviate (for the Vector Database)
• llama-cpp-python with Llama2 model files (for text generation)