Skip to content

sarthak070707/RAG-Chain

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 

Repository files navigation

RAG-Chain

A Retrieval-Augmented Generation (RAG) system that answers natural-language questions over your own documents. Upload PDFs, and the app retrieves the most relevant passages via embeddings and generates grounded, source-backed answers instead of hallucinating.

Note: Built on an open-source RAG base and reworked for my own use case — [REPLACE THIS LINE with what you actually changed: e.g. swapped the embedding model, reworked chunking/retrieval, redid the UI, changed the document handling, added feature X, etc.]

What it does

  • Natural-language Q&A over a custom document set, with concise, grounded answers.
  • Bring your own documents — upload PDFs to expand the knowledge base.
  • Similarity search over AI embeddings to pull the most relevant context per query.
  • Simple web interface for querying and uploading.

How it works

PDF upload  ->  chunk text  ->  embeddings  ->  vector store (ChromaDB)
                                                      |
User query  ->  embed query ->  similarity search -> top-k context -> LLM -> grounded answer

Retrieval grounds every answer in the uploaded documents, which keeps responses factual and reduces hallucination compared to asking the LLM directly.

Tech stack

  • Language: Python 3.10+
  • Framework: LangChain
  • Vector store: ChromaDB
  • Embeddings: Google Gemini API (embedding-001)
  • LLM: Google Gemini API (gemini-1.5-pro)
  • PDF parsing: PyPDFLoader
  • Chunking: SentenceTransformersTokenTextSplitter
  • UI: Streamlit

Run locally

pip install -r requirements.txt
streamlit run app.py
  1. Add your Google API key in the sidebar.
  2. (Optional) Upload PDFs to build the knowledge base.
  3. Ask questions in the main interface.

Notes

This is a learning / portfolio project. Answer quality depends on the coverage and quality of the uploaded documents.

Author

Sarthak Arya · github.com/sarthak070707 · sarthakarya4@gmail.com

About

Document-grounded RAG pipeline in Python that automates ingestion, embedding, and vector search to answer questions over large document sets using LangChain, ChromaDB, and the Gemini API.

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages