This is a full-stack RAG application powered by LangChain, Groq LLM, FAISS vector store, and React frontend. It allows you to upload PDF documents, index them with semantic search, and query them via an interactive chat interface.
project-root/
├── backend/
│ ├── app.py # Flask API entry point
│ ├── connect_memory_with_llm.py # LangChain chain that connects vector DB with Groq LLM
│ ├── create_memory_for_llm.py # PDF ingestion and vector store creation
│ ├── data/ # Directory for input PDFs
│ ├── vectorstore/db_faiss/ # FAISS index storage
│ ├── .env # Environment variables
│ ├── requirements.txt # Backend dependencies
│ ├── Pipfile / Pipfile.lock # Optional: pipenv dependency management
│ └── vercel.json # Optional: deployment config for Vercel
└── frontend/
└── ... # React application (Chat UI)
cd backend
pip install -r requirements.txtOr use pipenv:
pipenv install
pipenv shellCreate a .env file in the backend/ directory:
GROK_API=your_groq_api_key_hereRun this to process and chunk PDF files and store in FAISS:
python create_memory_for_llm.pyEnsure your PDFs are placed in the
backend/data/directory.
python app.pyThe API will be live at: http://localhost:5001/api/chat
cd frontend
npm installCreate a .env file in the frontend/ directory:
REACT_APP_API=http://localhost:5001npm startNavigate to http://localhost:3000 in your browser to use the chat UI.
- Upload and index PDFs using HuggingFace embeddings and FAISS
- Ask natural language questions and retrieve answers grounded in the uploaded documents
- Groq LLM handles question answering with a custom prompt
- Sources of each answer are returned for transparency
- React-based interactive chat interface
-
Backend
- Python, Flask
- LangChain
- Groq API (LLM)
- HuggingFace Transformers (embeddings)
- FAISS (vector store)
-
Frontend
- React
- Axios
- Tailwind CSS (optional for styling)
You can deploy app.py via vercel.json using Vercel’s Python support.
Set your environment variable REACT_APP_API to your deployed backend API URL.
Screen.Recording.2025-06-28.at.5.37.43.PM.mp4
This project is licensed under the MIT License.
Let me know if you'd like:
- Docker support
- Markdown formatting for source links
- Advanced RAG strategies like MapReduce or HyDE
I'm happy to help!