Skip to content

Replace custom RAG with LlamaIndex - #1

Closed
cacohe wants to merge 1 commit into
masterfrom
feat/llamaindex-rag
Closed

cacohe wants to merge 1 commit into
masterfrom
feat/llamaindex-rag

Conversation

@cacohe

@cacohe cacohe commented Aug 12, 2026

Copy link
Copy Markdown
Owner

Summary

  • Swap the hand-rolled character splitter and keyword overlap scorer for LlamaIndex SimpleDirectoryReader + SentenceSplitter.
  • Index chunks in memory and retrieve with LlamaIndex BM25 (Chinese-friendly tokenization, no vector DB).
  • Keep the existing knowledge upload / chunk-size UI and chat RAG injection path.

Test plan

  • uv sync && uv run pytest tests/unittest/test_backend -q
  • Start with python run.py, confirm sample leave-policy docs load
  • Ask “年假有几天” and verify the answer uses retrieved context
  • Upload a new .md from the sidebar and re-chunk with different size/overlap
  • Confirm chunk preview still lists documents after reload

Made with Cursor

Use SimpleDirectoryReader and SentenceSplitter for loading/chunking,
and BM25 retrieval so indexing stays in-memory without a vector store.

Co-authored-by: Cursor <cursoragent@cursor.com>
@cacohe cacohe closed this Aug 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant