Skip to content

AI Module Week 6 Topic 3: Semantic RAG #64

@EricThomson

Description

@EricThomson

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.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions