This page details the "Smarter retrieval" tentative card on Roxy's status page. It explains why plain word search will eventually fail Bob quietly, and the three small upgrades — all inside Bob's existing Supabase — that fix it.
Status: plan only. Nothing on this page is built or scheduled. It becomes a build decision only after cited answers from the live library prove useful to Bob. It requires no new database, no new service, and no new monthly cost beyond pennies of embedding usage.
Today, when Bob asks Roxy a question, Roxy finds documents by matching the words in the question against the words in the library (full-text search). This works well when the words line up — a ticker, a company name, an author's phrase.
It fails silently when they don't. If Bob asks about "datacenter power constraints" and the newsletter said "grid interconnect queues," word search finds nothing. Roxy then honestly reports a miss — on material the library actually contains. The answer looks trustworthy and is wrong about coverage. That is the most dangerous failure a research librarian can have, because nobody notices it happening.
Two smaller problems ride along: a search hit today returns a whole newsletter (thousands of words) instead of the paragraph that matters, and there is no clean way to ask time-and-author questions like "what was this writer saying in June versus now?"
Alongside the existing word search, store an embedding for each passage — a numeric "fingerprint" of what the passage is about. Two passages about the same idea get similar fingerprints even when they use different words. At question time, Roxy runs both searches:
Supabase supports this natively via the pgvector extension — one column and one index on the existing tables. No second database, no external search service.
Store each document's text as ordered passages (roughly paragraph-sized) that point back to their parent document. Benefits:
The schema already anticipates this (documents → document_chunks); this fills that layer in for the Substack corpus. Chunks carry an ordinal and parent-document reference so full context is always one join away.
Investment research is dated claims by named people. Publisher, author, published date, title, and source URL should be queryable columns (most already arrive free in the mail headers), so that questions like these are real database queries, not text-matching luck:
| Part | Change | Cost |
|---|---|---|
| Author/date metadata | Ensure existing columns are populated and used as retrieval filters | Mostly free — data already arrives in mail headers |
| Chunking | Small migration filling the existing document_chunks layer; re-chunk current corpus | One-time script; cheapest now while the corpus is small |
| Hybrid search | pgvector column + index; embed passages at ingest; merge FTS + vector results at query time | Pennies to embed the current corpus; negligible ongoing |
Not now. At 28 documents, word search plus a capable model is genuinely good enough, and the current priority is proving cited answers Bob relies on. The right trigger is either of:
Chunking is cheapest done early (fewer documents to migrate), so if a build decision comes, chunking and metadata go first, embeddings second.