Hybrid RAG system that answers questions using both persistent documents (PDFs) and a session-specific object list.
frontend/React UI for login, object list input, and Q&Abackend/FastAPI API for auth + session + agent coordinationagent/FastAPI AI service with vector retrieval + hybrid reasoning (agentic mode + verification)
Copy PDFs into agent/data/documents/ or keep them in repo root.
Included example PDFs:
AICI Challenge_ Conversational Q&A System.pdf240213 Permitted Development Rights.pdf
cd agent
python -m venv .venv
# Windows PowerShell: .venv\Scripts\Activate.ps1
# macOS/Linux: source .venv/bin/activate
pip install -r requirements.txt
uvicorn app.main:app --reload --port 8001
The agent builds a FAISS index on first start and stores it in agent/data/index/.
It also extracts PDF images into agent/data/documents/_images/ for future use.
cd backend
python -m venv .venv
# Windows PowerShell: .venv\Scripts\Activate.ps1
# macOS/Linux: source .venv/bin/activate
pip install -r requirements.txt
uvicorn app.main:app --reload --port 8000
cd frontend
npm install
npm run dev
Open http://localhost:5173.
docker compose up --build
Backend: http://localhost:8000
Agent: http://localhost:8001
Optional env vars:
OPENAI_API_KEYfor LLM synthesis and verificationOPENAI_MODEL(defaultgpt-4o-mini)EMBEDDING_MODEL(defaultall-mpnet-base-v2)CHUNK_SIZE(default900)CHUNK_OVERLAP(default180)
POST /auth/register→{email,password}→ JWT tokenPOST /auth/login→{email,password}→ JWT token
GET /session/objects→ listPUT /session/objects→{objects:[...]}update list
POST /qa→{question, objects?, mode?}→ hybrid answerWS /ws/qa→ send{question, objects?, mode?}→ receive answermode:agentic(default) orstandard
- If
OPENAI_API_KEYis set, the agent uses the model for synthesis and verification. - If not, the agent returns a deterministic summary + heuristic verification.