Skip to content

RAG (Retrieval-Augmented Generation) Implementation

AI

Implemented RAG (Retrieval-Augmented Generation) for the 3 instances of LLMs running in the project, since a database of past legal cases was provided and it was essential to ensure the LLMs could meaningfully incorporate that domain-specific information into their outputs. I handled the vector embedding, integration, and the entire end-to-end implementation of it. The steps I followed were: data loading with preserved metadata, document chunking with the correct structure (case ID, title, etc), embedding generation (generated 1, 536-dimensional embeddings with an embedding service from a Hugging Face model), engineered a vector store and retrieval layer with FAISS/Chroma for high-performance indexing and retrieval, supporting metadata filtering and efficient nearest-neighbour search.


• Project Link: https://github.com/alina-ahmed-tech/hk25