A personal-library research assistant: upload papers, search with hybrid retrieval, and get cited answers from your own sources.
This repository is a public architecture snapshot. The production product, labeled eval set, and lab tooling stay in a private repo.
- Next.js app — workspaces, document library, chat with citations, closed-beta apply flow
- Python LangGraph agent — classify → retrieve (hybrid BM25 + vectors, optional rerank) → synthesize → reflect
- Indexing — PDF/DOCX ingest, strategy-aware chunking, Voyage embeddings
flowchart LR
UI[Next.js product] -->|chat / upload| Agent[LangGraph agent]
Agent --> Retrieve[Hybrid retrieval]
Retrieve --> Mongo[(MongoDB Atlas)]
Agent --> LLM[Claude]
UI --> S3[(S3 documents)]
| Layer | Choice |
|---|---|
| Product | Next.js, Clerk, MongoDB, Redis / BullMQ |
| Agent | FastAPI, LangGraph, Anthropic |
| Retrieval | Atlas text + vector search, RRF fusion, Voyage rerank |
| Eval harness | Retrieval metrics + RAGAS runners (example goldset only) |
1 — Product
pnpm install
cp .env.example .env.local
pnpm dev
# http://localhost:30002 — Python agent (optional)
cd backend-ai
uv sync --all-groups
cp .env.example .env.local
uv run uvicorn main:app --reload
# http://localhost:8000Set in the root .env.local to point product chat at Python:
USE_PYTHON_AGENT=true
PYTHON_AGENT_URL=http://127.0.0.1:8000
INTERNAL_API_SECRET=<long random string, same value in backend-ai/.env.local>
src/ Next.js app
workers/ TypeScript document/analysis workers
backend-ai/ Python LangGraph agent
- Production goldsets, RAGAS numbers, and the goldset generator
- The 125-paper eval corpus
- Internal admin / eval consoles
- Tuned production prompts (files here are short illustrative stubs)
Source is published for portfolio display. All rights reserved. Not a license to deploy, sell, or operate a hosted service from this code.