Status: v2 — decided 2026-09-27 after research (see docs/research/). Supersedes v1.
A personal memory. You dump anything (text, voice, photo, PDF, link, transcript) in under 3 seconds, from any device. Later you ask a question in plain language and get one direct answer with the source item — verbatim recall, not an essay.
Test case: you save a video about an "agentic browser". Weeks later you ask "what was that agentic browser I watched?" → the answer names it and links the saved video.
- Calendar / email / any auto-sync integrations. Manual capture only.
- Browser extension (designed for, built after V1 — see §11).
- Knowledge graph (door kept open — see §6).
- Local/on-device models.
- "Cheap mode". One pipeline, best quality.
- Proactive resurfacing, dashboards.
- Multi-user from day one (single user today; open-source / commercial later).
- BYOK for the user's own model spend. Each user adds one key in settings:
- OpenRouter — chat, enrichment, STT, embeddings (required)
- The transcript API (Supadata) and the reader API (Jina) are operator-paid Worker secrets behind a per-user daily allowance; see ADR-0006.
- Without an operator secret, or past the daily allowance, the corresponding fallback is skipped and the item is saved
partial. - Web app (responsive) is the only V1 client.
Rule: a capture never fails. Raw input is stored before any processing starts.
| Type | Source | Extraction |
|---|---|---|
| Text | typed / pasted (thoughts, facts, quotes, meeting notes) | as-is |
| Voice | browser mic, audio file | OpenRouter STT (Whisper / Qwen3 ASR, auto language). Raw audio kept. |
| Photo | upload / camera (screenshots, calendar photos, book pages) | vision model: OCR text + scene description |
| upload | text PDF → pure-JS extraction in Worker; scanned → vision OCR per page. Original kept. | |
| YouTube | URL | §4.2 ladder |
| URL | metadata API (operator key, daily allowance) → caption, author, hashtags. No key or allowance → link + user note, partial. Audio is not transcribed: see ADR-0003. |
|
| Blog / web page | URL | §4.1 ladder. Cleaned markdown + raw HTML snapshot stored. |
| Any URL | fetch failed | item saved, status failed, retryable |
fetch()withAccept: text/markdown(Cloudflare Markdown for Agents — free win when the site has it on).- HTML → Defuddle on linkedom → markdown. Covers most public pages.
- Output thin for an article page → Browser Run
/content(headless Chrome, free tier to start) → Defuddle again. Covers JS-rendered pages. - Still blocked (403 / bot wall) → hosted reader API on the user's key, if present.
- Paywall / login wall / no key →
capture_quality = partial: title, OpenGraph description, user note. No server-side fix exists. Extension completes it later (§11).
- Metadata always: official Data API
videos.list(title, channel, description) on the operator's key. Free, 10k units/day, 1 unit per video, reliable. Chapters are not available from this API; they exist only as timestamps people type into the description, so they arrive as description text and are not parsed. - Transcript: transcript API on the user's optional key, pinned to
mode=native. 1 credit per video. - No transcript, or no key → metadata-only item,
partial.
Revised 2026-09-30 (see docs/research/15-youtube-ingestion.md):
- The former step 2, opportunistic Innertube captions via
youtubei.js, is dropped. YouTube now gates/get_transcriptbehind a BotGuard attestation the library does not implement; solving it needseval, which Workers forbid; and the maintainers state server IPs are blocked with no known solution. Three independent blockers. Revisit only ifLuanRT/YouTube.js#1102closes and someone demonstrates it working from a Worker. - AI transcription of uncaptioned videos is not used. The transcript API's default
automode bills 2 credits per minute, so one 40-minute uncaptioned video would consume 80 of a free plan's 100 monthly credits in a single save.mode=nativekeeps every video at 1 credit; an uncaptioned video stayspartial, still searchable by title, channel and description.
No yt-dlp, no ffmpeg, no Container anywhere.
capture → extract → enrich → chunk → index (vector + keyword) → [facts]
ask → rewrite → retrieve (hybrid, RRF) → rerank → answer with citations
Runs as a Cloudflare Workflow per item, triggered from a Queue. Each stage is a durable step with its own retry. Status visible per item: pending | processing | ready | failed, plus capture_quality: full | partial.
titlesummary— 2–3 sentences, always English regardless of source language (cross-language recall)clean_text— raw text with STT/OCR errors corrected in context ("Asian tech browser" → "agentic browser").raw_textkept untouched.kind—quote | fact | thought | meeting | link | video | article | image | pdf | otherentities— people, products, books, places (stored as rows, not JSON — graph door)tags— 5–10, embedding-assisted: nearest-neighbour items' tags are fed into the prompt to keep vocabulary stable (Karakeep pattern)language
- ≤ ~500 tokens → one chunk.
- Longer → header-aware split (markdown headings / transcript timestamps), ~400 tokens, small fragments merged forward, ~15% overlap.
- Parent-child: chunks are the search unit, the item is the answer unit. Retrieval returns chunks; answers cite items.
- Every chunk is embedded as
"{title} — {summary}\n\n{chunk_text}"(contextual retrieval).
Per chunk: embedding (pgvector) + embedding_model + tsv (Postgres full-text over chunk + title + entities + tags).
Embedding model is fixed per platform and versioned: one multilingual model via OpenRouter for all users. Upgrading = platform-wide re-embed job. Users choose chat/enrich model only.
Runs on kind ∈ {thought, fact, meeting, quote} and voice notes — things the user said, not other people's content.
- LLM extracts atomic facts ("dentist is Dr. Mehta", "prefers window seat").
- Per fact: retrieve top-10 similar existing facts → LLM picks ADD / UPDATE / DELETE / NOOP (Mem0 loop).
- Superseded facts are invalidated, never deleted (
valid_from,valid_to), with provenance to the source item. - Facts are embedded and full-text indexed like chunks; retrieval queries both and fuses.
- Rewrite (LLM): fix typos, expand ("that browser that browses for you" → "agentic browser"), extract filters — date range ("recently" = 30d, "few days ago" = 14d),
kind, type. Generate 2–3 query variants. - Vector + full-text search over chunks and facts, filters applied in SQL, in parallel per variant.
- RRF (k = 60) → top 30.
- Rerank (LLM) → top 5–8.
- Answer — only from retrieved content. Rules:
- Verbatim: quotes, facts, names, numbers returned exactly as stored, never paraphrased.
- Every answer cites item IDs → UI shows source cards (title, kind, date, link/file).
- Multiple plausible hits → list candidates with dates, don't guess.
- Conflicting facts → newest valid wins, older shown with date.
- Below similarity floor → "I don't have anything saved about that." Never invent.
Chat threads in V1. A thread holds prior questions + answers + cited item IDs; follow-ups ("tell me more about that one") resolve against the thread's cited items first, then run a fresh retrieval with the thread summary as context. Every answer in a thread still cites.
users id, email, created_at
user_keys user_id, provider (openrouter|transcript|reader), key (encrypted)
items id, user_id, type, kind, status, capture_quality, source_url,
file_key, raw_text, clean_text, title, summary, tags[], language,
captured_at, source_published_at, error, deleted_at
item_captures item_id, captured_at -- same URL twice = 1 item, 2 captures
chunks id, item_id, idx, text, embedding vector, embedding_model, tsv
entities id, user_id, name, type -- graph door: plain rows
item_entities item_id, entity_id
facts id, user_id, text, embedding, embedding_model, tsv,
source_item_id, valid_from, valid_to
threads id, user_id, title, created_at
messages id, thread_id, role, text, cited_item_ids[], created_at
Dedupe: normalised URL per user; file hash for uploads.
- Edit text / title, soft delete, "forget this fact", "reprocess" (re-run from extract) per item.
- Failed items show the error and a retry button.
- Nightly DB + R2 backup. Non-negotiable.
Notes, questions and saved content go to third-party models on the user's own OpenRouter key. Video and blocked-page link addresses also go to the operator-paid transcript and reader providers (ADR-0006). Both are stated plainly in settings. No PII scrubbing in V1.
apps/web Next.js 16 — UI only. Vercel Hobby ($0; Pro when commercial).
apps/api Cloudflare Worker (Hono). All backend in one deploy:
REST API (capture, ask, threads, items, settings, keys)
Better Auth
Queue consumer + Workflows (pipeline)
Browser Run binding (JS-rendered articles)
apps/extension Later. Client of apps/api.
packages/db Drizzle schema + queries (Neon via Hyperdrive)
packages/ai OpenRouter calls (STT, vision, enrich, embed, rerank, answer)
| Layer | Choice | Why |
|---|---|---|
| Compute | Cloudflare Workers, free plan to start | No Container, no binary. Upgrade to Paid ($5/mo) only when a limit bites (10 MiB Worker size, Browser Run minutes, CPU ms). |
| Pipeline | Cloudflare Queues + Workflows | durable per-step retries, no Redis, no server |
| DB | Neon Postgres + pgvector via Hyperdrive, Drizzle | hybrid search in one DB; Hyperdrive = connection pool for Workers |
| Files | Cloudflare R2 | 10 GB free, zero egress |
| Auth | Better Auth | multi-user, TS-native, runs in the Worker |
| Models | OpenRouter (chat, STT, embeddings) | single BYOK key covers the chain |
| Articles | Defuddle → Browser Run → reader API → partial | §4.1 |
| Video | Data API metadata (operator key) → transcript API, mode=native |
§4.2 |
Monthly cost at personal scale: $0. Model/API spend on the user's keys.
- Supermemory — Workers + Hono + Drizzle + Workflows ingestion; same shape as ours.
RafalWilinski/cloudflare-rag— RRF fusion + multi-query on Workers.rahilp/second-brain-cloudflare— capture classify → dedupe → contradiction → index.- Mem0 paper — ADD/UPDATE/DELETE/NOOP loop.
- Defuddle — extractor.
- AGPL (Karakeep, Khoj, Readeck): read for patterns, don't copy code.
- Sends
{url, title, text}from the rendered DOM (Defuddle in the extension). Paywalls, logins, JS — irrelevant, the browser already has it. - Reads the YouTube transcript panel for videos being watched.
- Completes
partialitems: when the user visits a URL that's savedpartial, the extension upgrades it tofullautomatically. - Auto-capture ("save everything I read") with enable/disable and filter rules — separate research session.
- Calendar / email integrations.
- Graph retrieval (LightRAG on Postgres) — entities/relations already stored as rows.
- Cloudflare AI Search — revisit when pricing is public.
- Cross-encoder reranker instead of LLM rerank — if answer latency or cost becomes a problem.