feat(rag): adopt LlamaIndex for document ingestion and semantic retrieval#118
Merged
Conversation
keli-wen
marked this pull request as ready for review
July 18, 2026 04:17
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
quantmind.preprocess.formatand move opinionated document chunking/retrieval into the dedicatedquantmind.ragpackage.SentenceSplitterand BM25 for page-aware document evidence, and LlamaIndex for the privateLocalKnowledgeLibrarysemantic-ranking backend, while preserving QuantMind public types and SQLite canonical storage.contexts/design/rag/, and move the focused example/tests toexamples/rag/andtests/rag/.Design Boundary
quantmind.ragis an opinionated LlamaIndex data-plane package, not a generic RAG framework. It may depend onquantmind.preprocess; preprocessing andquantmind.librarymust not depend on it. LlamaIndex types remain private, and the package does not add public retriever, vector-store, provider, backend, query-engine, or plugin abstractions. A future PageIndex adapter may live beside these document operations without being forced throughLocalKnowledgeLibrary.search().Related Issue
Closes #117.
Verification
./scripts/verify.sh— 330 passed, 86.56% coverage; Ruff, basedpyright, and all 7 import contracts passed.uv run python scripts/verify_pdf_rag_e2e.py— passed with 15 pages, 33 chunks, and page 5 as the top result.uv run python examples/rag/paper.py— passed.Checklist
type(scope): summary../scripts/verify.shpasses.