Upload any PDF book and have a real conversation with it β grounded, cited answers pulled straight from its pages.
RAGVerse AI turns any PDF book into a conversational partner. Drop in a file, and instead of skimming hundreds of pages yourself, you just ask β and get answers pulled directly from the source, with the exact page cited.
Under the hood it's a full Retrieval-Augmented Generation (RAG) pipeline, built end-to-end rather than wrapped around a single prompt: chunking, embeddings, a per-session vector database, MMR-based retrieval, and a strict "answer only from context" prompt so the model doesn't hallucinate content that isn't actually in your book.
This project was built to practice production-style RAG system design β document ingestion, vector search tuning, session-state management, and a fully custom UI β rather than a toy llm.invoke(prompt) demo.
Upload any PDF β a textbook, a novel, a research paper, a manual β and it will:
- π Load and parse the PDF page by page
- π§© Split it into overlapping chunks for better retrieval accuracy
- π§ Embed every chunk using Mistral's embedding model
- ποΈ Build a fresh, isolated vector store for that specific book
- π¬ Let you chat with it β retrieving the most relevant passages for every question
- π Show you exactly which page(s) each answer came from
No installation needed β open the link, upload a PDF, and start asking questions.
Repository: github.com/garvkumarsharma/RAGVerse-AI-Project
| Upload Screen | Chat + Sources | Settings Sidebar |
|---|---|---|
![]() |
![]() |
![]() |
- π Upload any PDF, instantly β no pre-indexing or setup, just drag and drop
- π§ True RAG pipeline β chunking β embedding β vector search β grounded generation, not a single prompt trick
- π MMR retrieval β Maximal Marginal Relevance balances relevance and diversity so answers aren't built from redundant chunks
- ποΈ Tunable retrieval settings β adjust chunk size, chunk overlap, and number of retrieved chunks live from the sidebar
- π No hallucinated answers β the model is instructed to say so explicitly when the document doesn't contain the answer
- π Transparent sourcing β every answer comes with an expandable panel showing the exact source passages and page numbers
- π Per-session isolation β each uploaded book gets its own vector store; switch books anytime without restarting
- π¨ Custom-designed UI β fully custom dark, gradient-themed Streamlit interface, not default styling
βββββββββββββββββββββ
PDF Upload βββββΆ β PyPDFLoader β β Loads and parses the PDF page by page
βββββββββββ¬βββββββββββ
βΌ
βββββββββββββββββββββ
β Text Splitter β β Chunks text (adjustable size / overlap)
βββββββββββ¬βββββββββββ
βΌ
βββββββββββββββββββββ
β Mistral Embeddings β β Embeds every chunk into vector space
βββββββββββ¬βββββββββββ
βΌ
βββββββββββββββββββββ
β Chroma Vector β β Fresh, isolated store per uploaded book
β Store β
βββββββββββ¬βββββββββββ
βΌ
User Question βββΆ βββββββββββββββββββββ
β MMR Retriever β β Fetches top-k relevant, diverse chunks
βββββββββββ¬βββββββββββ
βΌ
βββββββββββββββββββββ
β Context-Bound β β "Answer ONLY from this context" prompt
β Prompt Template β
βββββββββββ¬βββββββββββ
βΌ
βββββββββββββββββββββ
β Mistral Chat LLM β β Generates the grounded answer
βββββββββββ¬βββββββββββ
βΌ
Answer + Cited Source Passages (in-app)
| Layer | Technology |
|---|---|
| LLM | Mistral AI (mistral-medium-3-5) via langchain-mistralai |
| Embeddings | Mistral AI Embeddings (langchain-mistralai) |
| Vector Store | ChromaDB via langchain-chroma |
| Orchestration | LangChain (document loaders, text splitters, prompt templates) |
| Document Parsing | pypdf / PyPDFLoader |
| UI / Frontend | Streamlit (custom CSS, no default theme) |
| Deployment | Streamlit Community Cloud |
| Language | Python 3.10+ |
RAGVerse-AI-Project/
βββ app.py # Streamlit UI β main entry point for deployment
βββ create_db.py # Standalone script for building a persistent vector store from a fixed PDF (reference/legacy)
βββ main.py # CLI-based query loop against a persistent vector store (reference/legacy)
βββ requirements.txt # Python dependencies
βββ config.toml # Streamlit configuration (theme/server settings)
βββ document_loaders/ # Sample/local PDFs used for testing (gitignored)
βββ .gitignore # Excludes .env, .venv, chroma_db/, *.sqlite3
βββ README.md
Note:
app.pybuilds a fresh, per-upload vector store at runtime β it does not depend oncreate_db.pyormain.py. Those two are kept in the repo as standalone reference scripts for building/querying a persistent, pre-indexed vector store outside the web UI.
- Python 3.10 or higher
- A Mistral AI API key
1. Clone the repository
git clone https://github.com/garvkumarsharma/RAGVerse-AI-Project.git
cd RAGVerse-AI-Project2. Create and activate a virtual environment
python -m venv .venv
# Windows
.venv\Scripts\activate
# macOS/Linux
source .venv/bin/activate3. Install dependencies
pip install -r requirements.txt4. Set up environment variables
Create a .env file in the project root:
MISTRAL_API_KEY=your_mistral_api_key_here
β οΈ Never commit your.envfile. It's already excluded via.gitignore.
5. Run the app
streamlit run app.pyThe app will open at http://localhost:8501. Upload a PDF, click Process Book, and start chatting.
This project is deployed on Streamlit Community Cloud, connected directly to this GitHub repository.
Live app: ragverse-ai-garv.streamlit.app
If you'd like to deploy your own fork:
- Push your fork to GitHub
- Go to share.streamlit.io β Create app
- Point it at your repo, branch
main, main fileapp.py - Under Advanced settings β Secrets, add:
MISTRAL_API_KEY = "your_key_here"
- Deploy π
- Support multiple document formats (
.docx,.txt,.epub) - Multi-document chat (query across several uploaded books at once)
- Persistent chat history across sessions
- Support for additional LLM providers (OpenAI, Gemini) via a model switcher
- Downloadable chat transcript / summary export
Garv Kumar Sharma
- GitHub: @garvkumarsharma
- LinkedIn: linkedin.com/in/garv-kumar-sharma
- Email: garvdhiman2004@gmail.com
This project is open source and available under the MIT License.
If you found this project interesting, consider giving it a β on GitHub!


