How sebulba46/document-rag-pipeline works
Main components
• Open-WebUI & Pipelines Container: This component hosts the RAG pipeline logic (e.g., document_RAG.py) and the necessary Python libraries (like llama-index libraries) for document processing. It is responsible for managing document ingestion, processing, and invoking the RAG pipeline.
• VLLM Container: This container runs the local LLM (the small 7B Mistral model) and is deployed via its own Docker Compose configuration.
• Docker Compose Environment: Represents the orchestration layer managing the two containers.
• External/Local Resources: These can include the PDF documents (or other documents) that are parsed for information, as well as any configuration details such as file paths or embedding choices.
Out relationships and interactions
• The Open-WebUI/pipelines container interacts with the user interface and serves as the front-facing endpoint where users can upload documents or define prompts.
• The pipelines container executes the RAG document pipeline (via document_RAG.py) by calling the necessary libraries to process documents and generate embeddings.
• Once a document is processed, the container forwards requests (or queries) to the VLLM container, which runs the local 7B Mistral model that generates responses based on the processed inputs.
• The Docker Compose setup interlinks these containers, ensuring network communication and dependency management.
• There is an inherent data flow from document ingestion, through processing, to LLM-based generation.
Important architectural patterns/design principles
• Microservices/Containerization: Each major functionality is isolated in its own container (i.e., one for Open-WebUI and one for VLLM), following a microservice-like approach.
• Pipeline Pattern: The RAG pipeline processes documents sequentially through several stages (embedding extraction, prompt configuration, model inference).
• Modular Deployment: Flexibility is provided by docker-compose files for both components, allowing independent scaling or modifications.
Relevant technologies, frameworks, or libraries
• Docker & Docker Compose: For deploying and orchestrating containers.
• Open-WebUI: Provides the front-end and interaction capabilities.
• VLLM Container: Runs the local LLM (7B Mistral).
• Python Libraries: llama-index and its variants (llama-index-core, llama-index-llms-openai-like, etc.), which are crucial for document processing and integration with LLM.
• Local File System & External Document Path: The README even explains modifications to PDF paths, which should be noted.
• For example, use rectangles for containers (Open-WebUI/Pipelines and VLLM).
• From the user (or document input source) to the Open-WebUI.
• From Open-WebUI to the pipelines execution (document_RAG.py) to indicate processing.
• From the pipelines to the VLLM container to illustrate LLM query invocation.
• Back from the VLLM container to the pipelines and then returning the response to the UI.
• Configuration and library-level dependencies (e.g., “llama-index libraries”) as annotations near the pipelines component.
• Optionally, include the Docker Compose symbols to show how both containers are orchestrated, indicating shared networks.