This project is an AI-powered Question Answering system over documents, built using LangChain, Groq API, and Large Language Models (LLMs).
It allows users to work with PDF, HTML, and text documents and ask natural language questions, which are:
- Processed using embeddings
- Matched with relevant document chunks
- Answered using an LLM with contextual understanding
The system uses Retrieval-Augmented Generation (RAG) along with a Chroma vector database to provide accurate and context-aware responses.
- 📄 PDF, HTML & Text Document Processing
- ❓ Natural Language Question Answering
- 🧠 RAG-based Retrieval System
- 🧩 Vector Storage using Chroma DB
- 🔍 Semantic Search using Embeddings
- ⚡ Fast LLM Inference using Groq
- 🔗 LangChain Pipeline (Loader → Splitter → Embeddings → Chroma → Retriever → LLM)
- Python
- LangChain
- Groq API (OpenAI-compatible LLM)
- Chroma (Vector Database)
- HuggingFace Embeddings (BAAI/bge-small-en-v1.5)
- Jupyter Notebook
- Poetry (Dependency Management)
Basic-Rag-App/
│── data/
│ ├── 5pages.pdf
│ ├── 100-startups.html
│ ├── be-good-and-how.html
│ ├── be-good.txt
│ ├── como_podemos_aprender.txt
│ ├── good.txt
│ ├── state_of_the_union.txt
│ ├── SAMPLE-OF-ENV-FILE.txt
│
│── basic-rag-app.ipynb # Main notebook (RAG pipeline)
│── basic-schema.ipynb # Schema / experiments
│── pyproject.toml # Dependencies (Poetry)
│── poetry.lock
│── .env # API keys (ignored)
│── .gitignore
git clone https://github.com/your-username/basic-rag-app.git
cd basic-rag-apppoetry installpoetry shellCreate a .env file:
Free_API_KEY=your_groq_api_key_hereRun the notebook and execute:
query = "What was the role of Mahatma Gandhi?"
response = chain.invoke(query)
print(response.content)"What was the Revolt of 1857?"
The Revolt of 1857 was a major uprising against British rule in India, led by Indian soldiers and rulers, marking one of the earliest large-scale resistance movements.
- Load documents (PDF, HTML, Text)
- Split documents into chunks
- Convert text into embeddings
- Store embeddings in Chroma vector database
- Retrieve relevant chunks based on query
- Generate answer using LLM
Pipeline:
Query → Retriever → Chroma → Context → LLM → Answer
.envfile is ignored using.gitignore- API keys are not exposed
- Add Streamlit / Web UI
- Multi-document upload support
- Improve retrieval accuracy
- Add chat memory
- Build FastAPI backend
Ayush Pandey B.Tech CSE | AI Engineer
Give it a ⭐ on GitHub and share it!