Web application with lexical, semantic, and hybrid search capabilities and answer generation based on selected documents.
- Interactive Leaflet map for drawing bounding boxes
- Three search modes: lexical (BM25), semantic (pgvector), and hybrid (RRF)
- Conversational interface via Azure OpenAI (default model is GPT-4o-mini)
- Generation of presigned URLs for viewing contextual PDF documents
- User feedback logging
- Observability via Logfire integration
- Python 3.8+
- PostgreSQL with the pgvector and ParadeDB extensions
- MinIO/S3 storage for PDF documents
- Azure OpenAI API access
-
Clone the repository:
git clone https://github.com/gregorgatej/zrsvn-rag.git cd zrsvn-rag -
Install dependencies:
pip install -r requirements.txt
-
Create a
.envfile with the following variables:POSTGRES_PASSWORD=your_postgres_password S3_ACCESS_KEY=your_s3_access_key S3_SECRET_ACCESS_KEY=your_s3_secret_key ZRSVN_AZURE_OPENAI_ENDPOINT=your_azure_endpoint ZRSVN_AZURE_OPENAI_KEY=your_azure_openai_key
-
Prepare the PostgreSQL database:
- Create the
zrsvndatabase with therag_najdbeschema - Install the
pgvectorandparadedbextensions
python app.py