Skip to main content

Gap Analysis: PRD Vision vs What's Built

Date: 2026-02-24 Source PRD: Bitcoin Agent Brainstorm (Feb 23) Method: Full codebase inventory (30+ API routes, 20 tables, 18 RPCs, 14 agent files) compared against PRD vision


Executive Summary

The web app has strong foundations — search, playbook, threads, community, and ETL are all working. But the core PRD thesis ("The agent IS the product") remains unrealized. The 6 critical gaps all relate to making the product genuinely agentic: Oracle routing, hybrid search, citation gating, BYOK, tiers, and the terminal-native interface.


What's Built

Inventory Scorecard

CategoryPRD ItemsBuiltPartialMissing
Search & Retrieval4112
Agent Orchestration4112
Workflows (8 total)8323
Auth & Identity3201
Monetization3003
Data & ETL3300
Community5212
Infrastructure4301
Total3415514

Completed Features

Completed Features Detail

FeatureImplementationKey FilesData
Vector searchpgvector HNSW, halfvec(1536), m=16, ef=64src/lib/db.ts, migration 007-00811,546 chunks, 345 episodes
Playbook analysis4 parallel Haiku lenses + Sonnet synthesissrc/lib/agents/playbook.ts, lenses/Beliefs, timeline, sentiment, context
Speaker graphforce-graph-2d, similarity + coappearance edges/api/graph/data, 3 RPCsAll speakers with 2+ appearances
Thread systemCRUD + beliefs + share/fork/vote6 API routes, 4 tablesMax 5 active per user
Community cardsClaims + citations + voting + feed3 tables, 2 RPCs, /api/feedCursor-paginated
ETL pipelineTrigger.dev weekly, HF SHA detectionsrc/trigger/etl-pipeline.ts~$0.001/incremental run
AuthMagic Link + Google OAuthSupabase Auth, auto-profile triggerRLS on all tables
AlertsFear/Greed + speaker/topic mentionCron check, notifications tableRealtime on notifications
Beta invitesCode generation + atomic claimbeta_invites table, /invite/[code]Status: pending/sent/claimed
Belief analysisCross-episode agreement, confidencesrc/lib/agents/analyze-belief.ts15s timeout, 10 req/min limit

The Gaps

Architecture Gap Map

This diagram shows the PRD architecture with gaps highlighted in red:

Legend: Green = built, Red = gap


Critical Gaps (G1-G6)

These gaps block the core PRD identity: "The agent IS the product."

G1: Oracle Agent — Query Decomposition & Orchestration

AspectPRDReality
Query handlingDecompose into 2-3 sub-queriesSingle-shot search
Evidence gradingLLM grades if sufficient, retries up to 2xNo grading, no retry
OrchestrationRoutes to Jackal, Playbook, or Oracle based on complexityAll queries route to direct-search
Multi-step reasoningParallel search → grade → analyze → verifySearch → synthesize (1 step)

Impact: Can't answer complex questions like "How has Lightning Network narrative evolved?" — requires decomposition into early adoption + scaling debate + current state sub-queries.


G2: Hybrid Search (Jackal)

Search TypeStrengthsWeaknessesStatus
Vector (semantic)Finds related concepts, handles paraphrasingMisses exact terms, acronyms, proper nounsBuilt
Keyword (full-text)Exact match for "UTXO", "block size war", "HODL"No semantic understandingMissing
Hybrid (RRF)Best of both — semantic + exactRequires both indexesMissing

Implementation effort: Pure SQL migration — add tsvector column, GIN index, new RPC. No new infrastructure.

Impact: Bitcoin terminology is heavy on exact terms (UTXO, HODL, halving, mempool). Vector-only search returns semantically related but not necessarily relevant results for these queries.


G3: Citation Gate

AspectPRDReality
Claim extractionLLM splits response into individual claimsNot implemented
Evidence matchingEach claim checked against cited sourcesPlaybook cites sources but doesn't verify claims
Ungrounded handlingFlagged or removed before user sees responseHallucinations pass through unchecked
Trust signal"Every claim grounded" is a product differentiatorNo verification guarantee

Impact: The PRD's non-negotiable invariant ("Every claim cites a source") is not enforced systematically.


G4: BYOK (Bring Your Own Key)

ComponentPRDReality
Key storageSupabase Vault (encrypted at rest)Not implemented
Key submission UIOne-time setup flowNot implemented
Runtime fetchTask fetches user's key before LLM callAll calls use app's API key
BillingUser pays their LLM provider directlyAll costs borne by us
Key rotationUser can update/delete their keyNot implemented

Impact: No path to monetization. All LLM costs ($0.02-0.05/query) come from our budget.


G5: User Tiers

Legend: Green = built, Yellow = partial, Red = missing

Current state: No tier differentiation. All users get the same features with no usage limits.


G6: Ink TUI (Terminal-Native Agent)

AspectPRDReality
Primary interfaceTerminal (Ink)Web (Next.js)
Build order"Agent first, web second"Web first, no agent CLI
ProtocolTyped JSON messages (renderer-agnostic)AI SDK streams (web-coupled)
Renderer swapSame agent, two frontendsSingle web frontend

Impact: The PRD's foundational thesis is inverted. This may be a deliberate pivot (web-first is pragmatic) but should be acknowledged.


Major Gaps: Workflow Coverage

PRD Workflows vs Implementation Status

Workflow Gap Detail

#WorkflowPRD DescriptionCurrent StateGap
1SearchEmbed → vector search → summarize. $0.002/queryBuilt. Direct search agent + vector search + synthesisNeeds hybrid search (G2)
2Speaker LookupSpeaker RPC → summarize profile. $0.001/queryPartial. RPCs exist, no unified profile synthesisMissing: LLM profile summary
3Episode BrowseEpisode RPC → summarize. $0.001/queryPartial. API exists, returns raw metadataMissing: LLM episode summary
4Deep ResearchDecompose → parallel search → grade → 4-lens → gate. $0.05/queryNot built. Requires Oracle (G1) + Jackal (G2) + Gate (G3)Largest gap — the flagship workflow
5Speaker Deep Dive4 parallel analyses: beliefs-over-time, sentiment, network, quotes. $0.04/queryNot built. Components exist (playbook lenses, speaker RPCs) but no unified workflowWire existing pieces together
6Compare SpeakersParallel filtered searches → comparison table → gate. $0.035/queryNot built. No speaker comparison logicNew workflow from scratch
7Claim VerifyEmbed claim → vector+keyword search → verify → CONFIRMED/NOT FOUND. $0.02/queryNot built. analyze-belief is similar but not exposed as standalone workflowRefactor existing code
8Topic TimelineEmbed → timeline RPC + vector → narrative arc. $0.035/queryNot built. Timeline lens + RPC exist but no quarterly narrative arc synthesisWire existing pieces together

Deep Research Pipeline: The Biggest Gap

The flagship Pro workflow requires 5 components, only 1 is built:

StepComponentStatusEffort
1Query decompositionMissingMedium — generateObject with sub-query schema
2Hybrid searchMissingMedium — SQL migration + new RPC
3Evidence gradingMissingSmall — LLM call to assess chunk relevance
44-lens analysisBuilt-
5Citation verificationMissingMedium — claim extraction + evidence matching

Minor Gaps

#GapPRD ReferenceEffortImpact
G7Contextual embeddings"35-49% retrieval improvement"High ($50-100, batch re-embed 11.5K chunks)Better retrieval quality
G8Thread export (MD/JSON)"markdown, JSON, or shareable links"Small (serialize + download)User convenience
G9Audio deep links"Click to hear the exact moment"Medium (need audio URLs + player)Killer feature per PRD
G10X/Twitter OAuth"X OAuth for launch"Small (Supabase config)Speaker identity linking
G11Ontology evolutionTags → Entities → GraphRAGLarge (3-phase roadmap)Long-term differentiator
G12Global rate limitingPer-user daily quotaSmall (Redis/KV counter)Cost protection
G13Search observabilityQuery analytics, trace dataMedium (telemetry pipeline)Product intelligence

Cost Model: Current vs PRD

Current State (All Costs Are Ours)

PRD Model (BYOK Shifts Cost to Pro Users)

Per-Query Cost Comparison

WorkflowModel(s)Cost/QueryWho Pays (PRD)Who Pays (Now)
#1 SearchHaiku + embedding~$0.002Us (free tier)Us
#2 Speaker LookupHaiku~$0.001Us (free tier)Us
#3 Episode BrowseHaiku~$0.001Us (free tier)Us
#4 Deep ResearchSonnet + 4x Haiku + embedding~$0.05User (BYOK)Us (no BYOK)
#5 Speaker Deep Dive4x Haiku + Sonnet~$0.04User (BYOK)Us
#6 Compare SpeakersSonnet + Haiku~$0.035User (BYOK)Not built
#7 Claim VerifySonnet + embedding~$0.02User (BYOK)Not built
#8 Topic TimelineSonnet + Haiku~$0.035User (BYOK)Not built

Bottom line: Without BYOK, every Pro-tier workflow we ship increases our cost per user with no revenue offset.


Database Schema: What Exists vs What's Needed

Existing Tables (20)

Missing Tables (for PRD features)

TablePurposeNeeded For
user_api_keysEncrypted API key storage (or Supabase Vault)G4: BYOK
user_tiersTier assignment (free/pro/community)G5: Tiers
daily_usagePer-user daily query counterG5: Rate limiting
search_analyticsQuery text, latency, result count, user satisfactionG13: Observability

Missing Indexes / Columns

ChangeTablePurposeNeeded For
Add tsvector columntranscript_chunksFull-text searchG2: Hybrid search
Add GIN indextranscript_chunks.tsvFast keyword lookupG2: Hybrid search
Add updated_attranscript_chunksTrack when rows changeETL observability
Add embedding_modeltranscript_chunksDetect embedding driftData integrity

Priority Matrix


Phase A: Unblock Monetization

GapDeliverableEffort
G2SQL migration: tsvector + GIN + hybrid_search RPC2-3 days
G4Supabase Vault integration + key submission UI3-4 days
G5Tier column on users + middleware check + daily counter1-2 days
G12Redis/KV counter or simple Supabase RPC1 day

Phase B: Make It Agentic

GapDeliverableEffort
G1Oracle agent: generateObject decomposition + evidence grading loop4-5 days
G3Gate agent: claim extraction + evidence matching + flagging2-3 days
Deep ResearchWire Oracle→Jackal→Playbook→Gate end-to-end2-3 days
Remaining workflowsSpeaker deep dive, compare, claim verify, topic timeline1-2 days each

Phase C: Polish & Differentiation


Appendix: Full Feature Matrix

FeaturePRD SectionStatusGap #Phase
Vector search (pgvector)SearchDone--
Hybrid search (vector + keyword + RRF)SearchMissingG2A
Contextual embeddingsSearchMissingG7C
Embedding cache (LRU)SearchDone--
Direct search agentWorkflows #1Done--
Speaker lookupWorkflows #2Partial-B
Episode browseWorkflows #3Partial-B
Deep research pipelineWorkflows #4MissingG1+G2+G3B
Speaker deep diveWorkflows #5Missing-B
Compare speakersWorkflows #6Missing-B
Claim verificationWorkflows #7Missing-B
Topic timelineWorkflows #8Missing-B
Oracle (orchestrator)ArchitectureMissingG1B
Jackal (hybrid retrieval)ArchitectureMissingG2A
Playbook (4-lens)ArchitectureDone--
Gate (citation verification)ArchitectureMissingG3B
BYOK via Supabase VaultKey ManagementMissingG4A
Free tier (10/day)User TiersMissingG5A
Pro tier (BYOK unlimited)User TiersMissingG5A
Community tierUser TiersMissing-C+
Magic link authAuthDone--
Google OAuthAuthDone--
X/Twitter OAuthAuthMissingG10C
Ink TUIArchitectureMissingG6C
Typed JSON protocolArchitectureMissingG6C
Thread CRUDCommunityDone--
Thread sharing + forkingCommunityDone--
Thread votingCommunityDone--
Thread export (MD/JSON)CommunityMissingG8C
Community cards + citationsCommunityDone--
Shared spacesCommunityMissing-C+
Ontology builderCommunityMissingG11C+
Audio deep linksFeaturesMissingG9C
Speaker graphFeaturesDone--
Alerts + notificationsFeaturesDone--
Beta invite systemPlatformDone--
ETL pipeline (Trigger.dev)InfrastructureDone--
Weekly cron scheduleInfrastructureDone--
Rate limiting (global)InfrastructureMissingG12A
Search observabilityInfrastructureMissingG13C

Generated 2026-02-24. Source: full codebase audit of be-bitcoinology-v1 against Feb 23 agent brainstorm PRD.