- Upload: Files are uploaded to
data/<session_id>/, split, embedded, and saved as a FAISS index infaiss_index/<session_id>/. - Chat: Each request loads the FAISS index for the given
session_idand answers using RAG. - Sessions: A simple in-memory history per session on the server (resets on restart). The browser stores
session_idinlocalStorage.
- Install deps
pip install -r requirements.txt- Start the server
uvicorn main:app --reload- Open the FastAPI Swagger
open http://localhost:8000/docs/GET /– Serves the UI.GET /health– Health check.POST /upload– Form-data file upload. Returns{ session_id, indexed }.POST /chat– JSON body{ session_id, message }. Returns{ answer }.
Run LangSmith evaluations on your RAG system:
# Quick start - run with default settings
python run_evaluations.py
# Run with all evaluators
python run_evaluations.py --evaluator all
# Custom parameters
python run_evaluations.py --evaluator correctness --chunk-size 500 --k 10Available Evaluators:
correctness- Custom LLM-as-a-Judge (Gemini 2.5 Pro)cot_qa- Chain-of-Thought QA evaluatorall- Run all evaluators
- Ensure your API keys/config are set for the
ModelLoaderto load embeddings/LLM. - For evaluations, you need
LANGSMITH_API_KEYandGOOGLE_API_KEYin your.envfile. - Supported file types:
.pdf,.docx,.txt. - For production, add persistence for chat history and auth; consider cleanup of old session directories.