-
Notifications
You must be signed in to change notification settings - Fork 1
RAG Service
peter-olai edited this page May 7, 2025
·
4 revisions
The rag_service/ directory and its modules implement the Retrieval Augmented Generation functionality. RAG enhances the responses of LLMs by providing them with relevant information retrieved from a knowledge base. This is a key part of the overall Chat Service Pipeline.
For step by step instructions on how to upload documents to the RAG-Database please click here
-
Document Ingestion/Indexing: Processes and stores documents (e.g., text files, PDFs, database records) in a way that allows for efficient searching (e.g., vector embeddings). The
context_upload.pyscript is primarily responsible for this. - Retrieval: Given a user query, searches the indexed knowledge base to find the most relevant document snippets or pieces of information.
- Context Augmentation: Provides the retrieved information as additional context to the LLM when generating a response.
- Vector Database: Often, a vector database (e.g., Pinecone, FAISS, ChromaDB) is used to store embeddings of the documents for similarity search.
- Embedding Model: A model used to convert text into numerical vectors (embeddings).
- Search/Retrieval Logic: Algorithms to find the most relevant documents based on query embeddings.
When a user query is received:
- The query may be embedded.
- The RAG service searches the knowledge base for relevant information using the query or its embedding.
- The retrieved information is combined with the original query and system prompts.
- This augmented prompt is then sent to the LLM (see LLM Integration and
LLM.py) to generate a more informed and contextually accurate response.
(Information on the specific vector database used, the embedding models, and the structure of the knowledge base should be detailed here.)
Authors:
Peter Olai Johnsen
Tobias Fremming
Erik Le Blanc Pleym
About Chat-Service
Core Components
Development
Codebase Details
- Codebase Architecture
- Routes
- Command-py
- Config-py
- Context Upload-py
- LLM-py
- Main-py
- Pipeline-py
- Streaming WS-py
- Transcribe-py
Deployment and Operations