npm installCreate .env.local:
NEXT_PUBLIC_API_URL=http://localhost:8000npm run devOpen http://localhost:3000.
- Upload a PDF
- Select no pruning strategy (default)
- Ask a question, get an answer with source pages
Exposes the full backend pipeline:
- Pruning Strategy Selector — choose between
none,cosine,cosine_whitened,kmeans,mmr - Pipeline Inspector — step-by-step breakdown of ingestion → chunking → embedding → pruning → storage
- Pruning Report — per-chunk scores, threshold, retention rate, score distribution
- Embedding Visualizer — 768D vector heat map (sampled) per chunk
- Query Parameters — temperature slider, max tokens, MaxSim re-ranking toggle
Switching pruning strategies automatically calls /reset before re-uploading, so stale vectors from a previous strategy don't pollute the new run.
This frontend requires the RAG backend to be running. See the backend repo for full setup instructions. In short:
# Install Python dependencies
pip install fastapi uvicorn pymupdf spacy sentence-transformers transformers
pip install bitsandbytes accelerate psycopg2-binary pgvector python-dotenv
python -m spacy download en_core_web_sm
# Configure .env with your DB credentials and HuggingFace token
# Then start the server
uvicorn main:app --reload --host 0.0.0.0 --port 8000| Method | Endpoint | Purpose |
|---|---|---|
| POST | /upload?pruning_strategy= |
Upload PDF, starts background processing |
| GET | /status |
Poll processing state (polled every 1.5s) |
| GET | /pruning-report |
Full per-chunk pruning stats |
| POST | /query |
Ask a question, get answer + sources |
| GET | /reset |
Clear pgvector + in-memory state |