Spaces:
Running
Running
PM-RAG-ChatBot Setup Guide
Prerequisites
1. Python 3.8 or higher
Make sure Python is installed on your system.
2. System Dependencies (for PDF processing)
Windows:
Poppler (for PDF to image conversion):
- Download from: https://github.com/oschwartz10612/poppler-windows/releases/
- Extract and add
binfolder to your system PATH - Or set
POPPLER_PATHenvironment variable to thebinfolder
Tesseract OCR (optional, for OCR):
- Download from: https://github.com/UB-Mannheim/tesseract/wiki
- Install and add to PATH
Alternative (using conda):
conda install -c conda-forge poppler tesseract
3. API Keys
Create a .env file in the project root with:
ANTHROPIC_API_KEY=your_anthropic_api_key_here
POPPLER_PATH=C:\path\to\poppler\bin # Optional, if not in PATH
CLAUDE_VISION_MODEL=claude-sonnet-4-5-20250929 # Optional, defaults to this
Get your Anthropic API key:
- Sign up at https://console.anthropic.com/
- Create an API key
- Add it to your
.envfile
Installation Steps
1. Navigate to the project directory
cd PM-RAG-ChatBot
2. Create a virtual environment (recommended)
python -m venv venv
3. Activate the virtual environment
Windows (PowerShell):
.\venv\Scripts\Activate.ps1
Windows (Command Prompt):
venv\Scripts\activate.bat
4. Install Python dependencies
pip install -r requirements.txt
Note: Some packages may require additional setup:
camelot-py[cv]requiresghostscriptandtcl-tkon some systemsspacymay need a language model:python -m spacy download en_core_web_sm
5. Install Spacy language model (if needed)
python -m spacy download en_core_web_sm
Running the Application
Option 1: Web Interface (Chainlit) - Recommended
chainlit run app.py
This will start a web server (usually at http://localhost:8000)
Option 2: Command Line Interface
python main_final.py
Project Structure
app.py- Main Chainlit web applicationmain_final.py- Command-line interfacesrd_engine_v2.py- Main RAG engine with knowledge basesrd_engine_final.py- Core SRD chatbot enginedb.py- SQLite database modelsrequirements.txt- Python dependencies
Features
- Upload SRD PDF documents
- Process diagrams with vision models (Qwen2-VL and/or Claude Vision)
- Chat interface for querying documents
- Persistent chat history
- Learning from user feedback
Troubleshooting
"ghostscript not found" error:
- Install Ghostscript: https://www.ghostscript.com/download/gsdnld.html
"Poppler not found" error:
- Make sure Poppler is installed and in PATH, or set
POPPLER_PATHin.env
- Make sure Poppler is installed and in PATH, or set
"ANTHROPIC_API_KEY not set" error:
- Create a
.envfile with your API key
- Create a
Import errors:
- Make sure virtual environment is activated
- Reinstall requirements:
pip install -r requirements.txt --force-reinstall