Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Agentic-RAG

A Retrieval-Augmented Generation project built with LangChain, LangGraph, and FAISS. The goal is to load documents from a local folder, embed them into a vector store, and answer questions about them by retrieving relevant chunks and passing them to an LLM.

This is a work-in-progress — most of the experimentation lives in the notebook/ folder, and the src/ modules wire those experiments into a reusable pipeline.

What it does

  • Loads PDF and text documents from a data/ directory
  • Chunks and embeds them using HuggingFace sentence-transformer models
  • Stores the embeddings in a FAISS index (Chroma is also available as an option)
  • Runs similarity search against a user query and feeds the top results to an LLM (Groq or OpenAI) to produce a grounded answer
  • Uses LangGraph for the agent flow

Project structure

Agentic-RAG/
├── data/             # source documents (PDFs, etc.)
├── notebook/         # exploratory Jupyter notebooks
├── src/              # core modules
│   ├── data_loader.py     # loads documents from data/
│   ├── vectorstore.py     # FAISS store: build, save, load, query
│   └── search.py          # RAGSearch: retrieve + summarize
├── app.py            # entry point that wires the pieces together
├── main.py           # placeholder script
├── pyproject.toml    # dependencies (managed with uv)
└── requirment.txt    # pip-style requirements

Tech stack

  • Python 3.13
  • LangChain (langchain, langchain-core, langchain-community, langchain-text-splitters)
  • LangGraph for agent orchestration
  • FAISS (faiss-cpu) for the vector store, with ChromaDB as an alternative
  • HuggingFace sentence-transformers via langchain-huggingface for embeddings
  • LLM providers: langchain-groq and langchain-openai
  • PDF parsing: pymupdf and pypdf
  • uv for dependency management

Getting started

1. Clone the repo

git clone https://github.com/BharathiDonku7/Agentic-RAG.git
cd Agentic-RAG

2. Install dependencies

If you have uv installed:

uv sync

Or with pip:

pip install -r requirment.txt

3. Set up environment variables

Create a .env file in the project root with your API keys:

OPENAI_API_KEY=your_key_here
GROQ_API_KEY=your_key_here

4. Add your documents

Drop PDFs or text files into the data/ folder.

5. Run the app

python app.py

Right now app.py just loads and prints the documents. The vector store and RAG search lines are commented out — uncomment them once you've added documents and set your keys.

Usage example

from src.data_loader import load_all_documents
from src.vectorstore import FaissVectorStore
from src.search import RAGSearch

# Load and index documents
docs = load_all_documents("data")
store = FaissVectorStore("faiss_store")
store.build_from_documents(docs)

# Query
rag_search = RAGSearch()
summary = rag_search.search_and_summarize("What is attention mechanism?", top_k=3)
print(summary)

Notes

  • The notebook/ folder has the original exploration work and is useful for understanding how each piece was put together.
  • The FAISS index is saved to disk after the first build, so subsequent runs can just load() it instead of rebuilding.

Roadmap

  • Add a CLI or simple web interface
  • Plug in a LangGraph agent that decides when to retrieve vs. answer directly
  • Add evaluation on a small QA set
  • Document chunking strategy comparison (recursive vs. semantic)

Author

Built by Bharathi Donku.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages