A NotebookLM-style clone: upload your sources, ask questions, and get answers that are grounded in your documents — with citations that jump to the exact passage the answer came from. If the sources do not contain the answer, it says so instead of guessing.
Status: milestone 00 of 08 — walking skeleton. The application shell, the verification gate, and the review pipeline are in place. Product features land from milestone 01 onward. See
docs/STATUS.mdfor what works today.
- Live: pending — added at the end of milestone 00
- Demo account: pending
Requires Node 20.11+ and pnpm 10.
git clone <repo-url> && cd notebook-clone
pnpm install
cp .env.example .env.local # defaults are fine for milestone 00
pnpm dev # http://localhost:3000Run the full verification gate exactly as CI does:
pnpm verify| Script | What it does |
|---|---|
pnpm dev |
Development server |
pnpm typecheck |
tsc --noEmit |
pnpm lint |
ESLint + Prettier check |
pnpm test |
Unit + integration (Vitest) |
pnpm test:e2e |
End-to-end (Playwright) |
pnpm check:secrets |
Fails on committed credentials or leaked NEXT_PUBLIC_ secrets |
pnpm verify |
All of the above, in CI order |
Every variable is documented in .env.example. Only the
variables that shipped code actually reads are validated, so a missing value
always means a real breakage rather than a placeholder for something unbuilt.
app/ Next.js routes and components — thin adapters only
api/… parse → authorize → call lib → serialize
lib/
ai/ Provider-agnostic AI layer (AiProvider interface)
providers/ the ONLY place a provider SDK may be imported
ingestion/ extract → normalize → chunk → embed → persist
retrieval/ query embedding, hybrid search, context assembly
db/ typed queries, RLS-aware clients
shared/ env, errors, logging
supabase/migrations/ SQL migrations — the only way the schema changes
tests/ unit · integration · e2e
docs/ plans · journal · ADRs · evidence
The rule that holds it together: a function in lib/ must be testable
without an HTTP request and without Next.js. Boundaries are enforced by
ESLint, not by good intentions — no-restricted-imports stops a provider SDK
from being imported outside lib/ai/providers/.
A request walkthrough for "user asks a question" is added in milestone 04.
Every milestone runs one plan → do → verify → decide loop, and the trail is committed:
| Where | What it holds |
|---|---|
AGENTS.md |
The operating manual every agent session reads first |
docs/plans/ |
What was going to be built, and how it would be verified — written before any code |
docs/journal/ |
What actually happened, what deviated, what was learned, and the SHIP/FIX/RE-PLAN/DESCOPE call |
docs/adr/ |
Decisions that are expensive to reverse |
docs/evidence/ |
Screenshots and command output backing each acceptance criterion |
Nothing reaches main except through a pull request that passes three gates:
the CI verification suite, an automated review (four specialised
review subagents locally, plus a Claude review on the PR
itself), and a human review against
.github/REVIEW_GUIDE.md.
| Decision | Why | Where |
|---|---|---|
| Branch protection without required approvals | GitHub cannot accept a self-approval or a bot approval; a required-review rule would block every merge on a solo repo. Status checks + conversation resolution + a procedural sign-off instead. | ADR 0002 |
System font stack instead of next/font/google |
Removes a network fetch from the production build, so CI is hermetic and deploys cannot fail on a font CDN. | app/globals.css |
| Strict-plus TypeScript from day one | noUncheckedIndexedAccess and friends are nearly free at this size and painful to retrofit after the retrieval code exists. |
tsconfig.json |
Retrieval strategy, chunking parameters, and the provider adapter get their own ADRs as they land.
- Unit — pure logic: env parsing, the error taxonomy, log redaction. Later: chunking, RRF fusion, citation parsing, token budgeting.
- Integration — real wiring,
FakeProvider, test database. Two tests are mandatory from the milestone they become possible: grounding (a question the sources cannot answer must be refused) and isolation (user B cannot read user A's rows). - E2E — one hardened happy path plus one failure path.
- No network, no real API keys, no
sleep-based waits.
Out of scope for this build, deliberately: Audio Overview / podcast generation, mind maps, collaboration and sharing, Drive/YouTube ingestion, OCR of scanned PDFs, and internationalisation.
An independent reimplementation of the idea behind Google NotebookLM. Not affiliated with Google; no Google branding, assets, or trademarks are used.
MIT — see LICENSE.