Most AI knowledge bases give you a confident paragraph and a list of file names. You still have to open the file and hunt for the sentence. PageTruth takes you straight to the page.
Today we're open-sourcing it under the MIT licence: github.com/infonex/pagetruth. Here's what it does, how it's built, and how to run your own.
What PageTruth does
Teams create a knowledge base, upload their handbooks, contracts and policies, and invite colleagues by Gmail address. Then anyone can ask a question in plain words.
- Answers only from your files. If the documents don't cover it, it says so.
- Every claim is cited. Click a source and the original opens at the exact page.
- Each knowledge base is sealed. Members of one can't see another's documents.
- PDF, Word, text and Markdown, including scanned PDFs through OCR.

How it's built
Uploads go straight from the browser to S3 with a presigned URL. An S3 event lands on an SQS queue, and a Lambda worker extracts the text page by page, chunks it, embeds it with OpenAI, and indexes it in Amazon S3 Vectors.
Every knowledge base gets its own vector index. A query can only name one, so retrieval can't cross tenants even if an authorisation check were missed. Row Level Security in Supabase Postgres is the second layer.
When someone asks a question, the pipeline rewrites it against the conversation, searches under several phrasings, fuses the results and reranks them with a model. The surviving passages go to Claude as document blocks with native citations enabled. Each citation maps back to a real chunk, document and page, so the model never has to name its sources in prose.
We measured it, including the bad news
The repo ships an evaluation harness. It renders 16 synthetic PDFs, runs the real pipeline over 268 questions with known answers, and has Claude Opus 5 judge the results.

Compared with plain nearest-neighbour search, the tuned pipeline:
- cut the hallucination rate on unanswerable questions from 69.6% to 39.1%
- raised precision from 20.5% to 34.3%
- halved the context sent per answer, from 9,627 tokens to 4,650
Run your own
You'll need:
- Node.js 20+ and pnpm
- An AWS account in a region with S3 Vectors, such as
us-east-1orap-southeast-2 - A Supabase project
- A Google OAuth client for sign-in
- Anthropic and OpenAI API keys
git clone https://github.com/infonex/pagetruth.git
cd pagetruth
cp .env.bootstrap.example .env.bootstrap
pnpm install
pnpm bootstrap
pnpm dev
Fill in .env.bootstrap before running bootstrap. It's the only file you edit by hand, and docs/setup.md covers the two steps no API can do.
pnpm bootstrap creates the buckets, queue, Lambda and IAM identities, pushes the database schema, turns on Google sign-in and writes the app's env files. Then it runs a real document through the pipeline to prove citations land on the right page. It's safe to re-run, and pnpm bootstrap:destroy --yes removes everything.
Open http://localhost:3000, sign in with Google, create a knowledge base and upload a PDF.
What's in the repo
- The Next.js app, the ingestion worker and the provisioning scripts
- Database migrations with Row Level Security tests
- The evaluation harness and its corpus
- Unit tests and a Playwright end-to-end suite
- Optional Stripe billing, custom domains and transactional email
Want help running it?
We build and run AI systems like this for clients, including retrieval tuning, evals and production hardening. Get in touch and let's scope it.
