Feature: RAG#765
Open
sofiachavezb wants to merge 247 commits into
Open
Conversation
TODO: Divide the Retriever component in single responsability configurable objects Allow the load of multiple documents the Document selector Store documents bytes in the DB Implement UI re-render after deleting a session in RAG sessions table Implement documents view in front Implement trained models (like retrievers) load and save
Documents table flashing solved
Awful implementation
Note: can't use formSchemaStore in the same component because it produces context problems with React
…with other modules
…ationStep component
…nfigurationStep component
dashAI 0.9.5
AppImage generation error
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR implements the Retrieval-Augmented Generation (RAG) module in DashAI, enabling users to chat with their documents through a 4-stage pipeline: Document Loading, Chunking, Retrieval, and LLM Generation.
The RAG pipeline takes a user query, splits the user's documents into chunks, retrieves the top-k most relevant chunks for the query, injects them into a prompt template, and feeds the result to an LLM that generates a grounded response with cited sources.
Pipeline stages:
Document Loading — loads files from the database and hydrates them into in-memory document objects. Six file extensions are accepted, though only two have dedicated parsing:
Chunking — splits documents via CharacterChunkModel, TokenChunkModel, or RecursiveCharacterChunkModel. Chunks are persisted with a SHA-256 signature cache for reuse across sessions.
Retrieval — finds relevant chunks via Sparse (TF-IDF, BM25), Dense (embedding-based similarity), or Composite retrievers (Sequential, Parallel, MMR Reranker).
Generation — injects chunks into a multi-language prompt template (en/es/pt) and generates a response via an LLM.
Scope: ~25,400 lines added across 226 files (213 core code + docs + translations).
Type of Change
Check all that apply like this [x]:
Changes (by file)
Briefly list the important modified files and what was done.
Backend
Frontend
API Endpoints
No new endpoints were added. Existing generative session endpoints were extended with RAG-specific logic:
Database
15 new SQLAlchemy ORM models across 5 areas, all with UniqueConstraints and CASCADE deletes. Four Alembic migrations orchestrate the schema evolution.
Document & Chunk Storage
Pipeline Configuration
Retriever Hierarchy
Embedding Layer
Session-Document-Pipeline Links
Documentation
7 new files in docs/rag/:
Testing (optional)
Only add if there's something reviewers should verify.
Notes (optional)
Known Limitations
Documented in docs/rag/05-known-limitations.md. Key items: