-
Notifications
You must be signed in to change notification settings - Fork 8
Description
Continuation of Issue #63 (naive keyword-based RAG), here we show improvements you get from semantic RAG.
We have adapted Nir Diamant's semantic RAG example, but without using langchain framework so things are written from scratch:
https://github.com/NirDiamant/RAG_TECHNIQUES/blob/main/all_rag_techniques/simple_rag.ipynb
Use embeddings to represent text chunks, and store embeddings in a FAISS index. Retrieve top-k semantically similar chunks for each query: inject retrieved content into the prompt. Re-evaluate using same criteria from deepeval as introduced in the keyword-based RAG. Expect noticeable improvements in relevance and accuracy.
In final step, move beyond FAISS and build a semantic store using pgvector for more production-level pipeline.