dRAGan: AI Agent using the RAG Technique
This project consists of a question-answering agent using Retrieval-Augmented Generation (RAG), which responds to queries based solely on local documents (PDF or TXT). It was developed as part of an Artificial Intelligence course and aims to explore modern NLP architectures applied to specialized agents (of course, this is not a new idea, but implementing it helped me understand key concepts of this technology).
⚙️ General Workflow Link to heading
- Input: The user uploads
.pdf
or.txt
documents. - Question: A natural language question is submitted.
- Semantic Search: Similarities between the question and indexed fragments are calculated using embeddings.
- Generation: A LLM (currently Phi3 Mini) is used to generate a response based only on the retrieved relevant context.
Detailed explanation Link to heading
🛠️ Tools Used Link to heading
- LangChain: Orchestration of the RAG pipeline.
- Chroma DB: Vector store for semantic search.
- Hugging Face Embeddings:
all-MiniLM-L6-v2
used to transform text into vectors. - HNSW Algorithm: Used by Chroma for nearest neighbor search.
- Python: Main programming language of the project.