Inspiration

My peers and I kept getting made-up answers when we studied with AI: confident replies our course materials never said. At AI Lodge, Makendra taught me that hallucinations can be measured and reduced, so I built a study assistant that answers only from your own files, and proved it on real course questions.

What it does

Anchor lets you drag your course files (PDFs, slides, Word documents, notes, pictures, spreadsheets) into a chat and ask anything about them.

  • Every answer is written step by step, and each step quotes the exact words it rests on. A Source button opens that excerpt with the words highlighted, and one more click opens the file at the page, slide, line or cell.
  • If your files don't cover the question, it says "Not found in your materials" instead of guessing. If they cover only part, you get that part plus a note on what's missing.
  • Each step is checked against your files. If a check fails, the answer is labelled Unsure and names the check.
  • It reads graphs, flowcharts and screenshots, and shows the picture beside any answer that rests on one. Number questions are answered from the exact spreadsheet cell.
  • Each user's Library is private, answers stream in as they're written, and it works on a phone.

How I built it

  • Reading files: Docling extracts text, tables and equations, keeping each page, slide or line so answers can cite it. Pictures get a written description from GPT-5.6 Luna; arrows are read three times and kept only where the readings agree.
  • Search: Postgres full-text search plus pgvector, using OpenAI's text-embedding-3-small. The two result lists are merged with Reciprocal Rank Fusion, then reranked by a self-hosted bge-reranker-v2-m3.
  • Routing: a router sends number questions to text-to-SQL over DuckDB, so figures come straight from spreadsheet cells.
  • Checking: a checker confirms every quote word for word and judges whether each step follows from it.
  • Measuring: a comparison ladder (the model alone, then vector search, hybrid search, and the full app) scored on the same practice questions. A grader judges every claim against the whole Library.
  • Website: FastAPI with plain HTML, CSS and JavaScript; WorkOS for sign-in. The front end runs on Vercel and the app on my Mac through Tailscale Funnel. Demo clips are recorded from the live app with Playwright. Claude Code was my coding partner.

What we learned

  • Most wrong answers were retrieval misses: the errors were exactly the questions whose passage was ranked below the cutoff.
  • Measure before changing anything: timing showed one step, not the model, made answers slow.
  • A checker only sees what it's given. It can't catch a wrong date calculation or a misread picture, so the app shows the picture and labels anything it couldn't confirm.

Built With

  • baai-bge-reranker-v2-m3
  • docling
  • duckdb
  • fastapi
  • ffmpeg
  • git
  • google-gemini-3.5-flash-lite
  • javascript
  • openai-gpt-5.6-luna
  • openai-text-embedding-3-small
  • pgvector
  • pillow
  • playwright
  • postgresql
  • pypdfium2
  • python
  • pytorch
  • tailscale-funnel
  • tiktoken
  • uvicorn
  • vercel
  • workos-authkit
Share this project:

Updates

Submission history