# 📄 TextVerse
TextVerse is a full-stack **PDF-interaction chatbot** powered by **LangChain**, **FAISS**, and **Hugging Face models**. It allows users to upload a PDF and ask questions related to its content via a conversational interface.
Built with:
- 🧠 **LLM**: Mistral-8x7B-Instruct (via HuggingFace)
- 📚 **Vector Store**: FAISS with BGE-small embeddings
- ⚙️ **Backend**: FastAPI + LangChain
- 💬 **Frontend**: React
---
## 🌟 Features
- Upload a PDF (feature coming soon)
- Ask natural language questions about the document
- Uses Retrieval-Augmented Generation (RAG) to answer based on document context
- Smooth chat UI with loading indicators and state transitions
---
## 🖼️ Screenshot

👉 To add a screenshot:
1. Create an `assets/` folder in the repo root (if not already).
2. Place your image inside it, e.g., `screenshot.png`.
3. Reference it using the Markdown syntax above.
---
## 🏗️ Project StructureTextVerse/
├── backend/ \# FastAPI + LangChain backend
│ ├── main.py \# API + RAG setup
│ └── .env \# HuggingFace API token
├── frontend/ \# React-based UI
│ ├── src/App.js \# Main chat component
│ └── src/App.css \# Styles
├── assets/ \# (optional) screenshots and images
├── faiss\_index/ \# Precomputed FAISS index
└── README.md
git clone [https://github.com/your-username/TextVerse.git](https://github.com/your-username/TextVerse.git)
cd TextVersecd backend
pip install -r requirements.txtIf requirements.txt doesn't exist, use:
pip install fastapi uvicorn langchain langchain-community python-dotenv huggingface_hub faiss-cpuCreate a .env file in the backend folder:
HUGGINGFACEHUB_API_TOKEN=your_token_hereuvicorn main:app --reloadcd ../frontend
npm installnpm startThe app runs at http://localhost:3000 and connects to the backend at http://127.0.0.1:8000.
Send a question to the RAG chatbot.
Request body:
{
"question": "What is the summary of this document?"
}Response:
{
"answer": "This document is about..."
}