A powerful application that allows users to upload PDF documents and ask questions about their content. The application uses advanced AI techniques to provide accurate answers based on the document content.
- PDF document upload and processing
- Intelligent question answering using RAG (Retrieval Augmented Generation)
- Document-specific responses (answers are generated only from the currently uploaded document)
- Modern web interface using Streamlit
- Fast and efficient backend using FastAPI
- Local LLM integration with Mistral-7B model
- Vector storage using ChromaDB
- Sentence transformers for semantic search
- Python 3.12 or higher
- Virtual environment (recommended)
- Required Python packages (see requirements.txt)
- Mistral-7B model file (GGUF format)
- Clone the repository:
git clone https://github.com/VishnuRam16/PDF-Parser-Chatbot.git
cd PDF-Parser-Chatbot- Create and activate a virtual environment:
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate- Install dependencies:
pip install -r requirements.txt- Download the Mistral model:
- Place the
mistral-7b-instruct-v0.2.Q4_K_M.ggufmodel file in themodelsdirectory
PDF-Parser-Chatbot/
├── backend/
│ ├── main.py # FastAPI application
│ ├── rag.py # RAG implementation
│ ├── db.py # Vector database operations
│ └── llm.py # LLM integration
├── frontend/
│ └── app.py # Streamlit interface
├── models/ # Directory for model files
├── requirements.txt # Python dependencies
└── README.md # Project documentation
- Start the backend server:
cd backend
PYTHONPATH=/path/to/PDF-Parser-Chatbot uvicorn main:app --reload --port 8000- Start the frontend server:
cd frontend
streamlit run app.py- Open your browser and navigate to:
- Frontend: http://localhost:8501
- Backend: http://localhost:8000
- Upload a PDF document and start asking questions!
GET /health: Health check endpointPOST /upload: Upload and process PDF documentsPOST /ask: Ask questions about the uploaded documentPOST /clear: Clear all documents from the vector store
The application includes configurable timeouts for various operations:
- PDF processing: 600 seconds (10 minutes)
- Question answering: 300 seconds (5 minutes)
- General requests: 600 seconds (10 minutes)
Contributions are welcome! Please feel free to submit a Pull Request.
This project is licensed under the MIT License - see the LICENSE file for details.
- Mistral AI for the language model
- ChromaDB for vector storage
- Sentence Transformers for embeddings
- FastAPI and Streamlit for the web framework