Flagship Project RAG & Knowledge Graph Engine Next.js + Supabase pgvector + Whisper

ChronoCast Personal AI Memory & Grounded RAG

"You capture. It remembers. You ask." A complete personal knowledge retrieval system that rescues bookmarked video and social posts from closed walled gardens, transcribes audio on-device, turns content into 1,536-dimensional embeddings, and delivers answers backed by verifiable source citations.

1,536
Vector Embedding Dimensions
0.30
Calibrated Similarity Floor
100% Local
Audio Whisper STT Processing
RRF k=60
Hybrid Rank Reciprocal Fusion
Pillar 01 Core Intent & Motivation

Unlocking the Saved Box: From Trapped Bookmarks to Verifiable Memory

The Problem with Saved Content

Every day, users bookmark insightful video reels, recipes, coding tutorials, and research snippets across social networks. But social platforms are walled gardens. There is no export button, no full-text search across spoken dialogue, and no guarantee a video won't be deleted next month.

Worse, the most valuable information in a video is spoken aloud, not written in the brief caption. Without transcription, 90% of saved knowledge remains unsearchable dark data.

The Core Architecture: Look It Up First, Then Talk

ChronoCast operates as a strict, transparent Retrieval-Augmented Generation (RAG) system. It fetches your own saved content, transcribes every spoken sentence locally, maps it into vector space, and establishes a semantic bridge between your natural language questions and the source media.

The overarching promise is not a smarter answer, but a checkable one: every assertion links directly to an ordinal source footnote pointing to the exact timecoded video capture.

Pillar 02 Engineering Architecture

Production Technology Stack

NJS

Next.js App Router & Tailwind

Modern responsive frontend with server-side streaming, TanStack Query, React Virtual for rendering extensive media lists, and Day.js for scheduling timelines.

App Router · TanStack Query · React Virtual
VEC

Supabase PostgreSQL & pgvector

Relational storage augmented with the pgvector extension for storing and querying 1,536-dimensional float arrays via cosine distance dot products with HNSW indexing.

pgvector · RLS Security Policies · Storage Buckets
AI

Embeddings & Claude AI Digest

Uses text-embedding-3-small for unified 1,536-dim document and query embedding, paired with Claude Haiku (@ai-sdk/anthropic) for automated entity extraction.

text-embedding-3-small · Claude Haiku · Vercel AI SDK
STT

Local Whisper & yt-dlp Pipeline

Audio is extracted with yt-dlp and transcribed locally using faster-whisper on-device with zero external API fees or privacy leakage.

faster-whisper · yt-dlp · Private Media Bucket
GRP

Interactive Knowledge Graph

Extracted entities (people, tools, concepts, places) are synced into an interactive dynamic graph rendered with react-force-graph-2d, revealing unexpected connections across saved media.

react-force-graph-2d · Force-Directed Layout
MV3

Zero-Credential Browser Addon

Manifest V3 service worker wakes on a 4-to-7-hour alarm, executing a same-origin fetch inside the user's active session tab via chrome.scripting without storing login credentials.

Dumb Sensor / Smart Sink · Idempotent Relays
Pillar 03 Data Pipeline & Movement

The 10-Stop Pipeline: From Instagram Bookmark to Grounded Answer

ChronoCast End-to-End Pipeline

How a Saved Post Becomes an Answer

10-stop deterministic RAG and knowledge graph pipeline

10 Decoupled Stops RRF k=60
01 You 02 The 03 It 04 The 05 The 06 Words 07 Sticky 08 Two 09 The 10 The
01
You Save It
Capture

Tapping the bookmark drops the post into your Instagram saved list. Read-only source of truth; ChronoCast never deletes or mutates the remote state.

02
The Robot Checks
Extension

Chrome MV3 background service worker wakes every 4–7 hours, injecting a same-origin fetch inside the active authenticated tab. Zero credentials stored; session cookies never leave the browser.

03
It Stays Dumb
Extension

Dumb sensor, smart sink: the extension re-sends the entire batch without maintaining client-side state. PostgreSQL ON CONFLICT handles idempotency with zero drift.

04
The Doorman
Security

Bearer token verified before request body is parsed or DB clients are instantiated. User ID is cryptographically resolved from the token, never trusted from payload.

05
The Copy Machine
Enrichment

yt-dlp archives metadata and media into private Supabase Storage. faster-whisper runs local on-device audio transcription with zero third-party API keys.

06
Words to Numbers
Vector Space

text-embedding-3-small transforms title, caption, and full transcript into a 1,536-dimensional unit vector in pgvector. Similarity computed via cosine dot product.

07
Sticky Notes
Knowledge Graph

Claude Haiku generates a 1-sentence summary, up to 8 topic tags, and extracts named entities (people, tools, places) to construct an interactive 2D/3D knowledge graph.

08
Two Searchers
Retrieval

Hybrid search executes two parallel retrieval arms: semantic vector search (conceptual meaning) and lexical ILIKE search (exact names), fused via Reciprocal Rank Fusion: 1 / (60 + rank).

09
The Floor Gate
Reliability

Hard threshold gate at 0.30 cosine similarity. If the top result is below 0.30, zero LLM model calls are made and zero tokens spent. Prevents hallucinations on unanswerable queries.

10
The Answer
Grounded Generation

Model receives up to 8 surviving captures and 4,000 chars of verified transcript. Citations [1], [2] are generated in a single pass with ordinal source links directly to video timestamps.

Stop 08 Deep Dive: Two Searchers & Reciprocal Rank Fusion (RRF)

When a user asks a question, two distinct searchers run simultaneously against the user's private dataset:

ARM 1: SEMANTIC VECTOR SEARCH

Converts the question into a 1,536-dim vector and computes cosine distance. Finds conceptual equivalents (e.g. searching for "cooking sauces" retrieves "making reductions").

ARM 2: LEXICAL FULL-TEXT SEARCH

Executes PostgreSQL ILIKE matching across titles, captions, and transcripts. Incomparable at exact handles, software names, and rare technical keywords.

The results are combined via Reciprocal Rank Fusion: each item at rank r contributes a score of 1 / (60 + r). Items supported by both semantic and lexical signals float to the top with high confidence.

Pillar 04 Testing, Calibration & Security

Development Process: Empirical Calibration & Fail-Soft Engineering

Generation Gate

The 0.30 Cosine Similarity Floor

Calibrated against 54 labeled questions and 5 unanswerable controls to prevent AI hallucination

Threshold: 0.30 text-embedding-3-small

An LLM presented with weak, irrelevant scraps doesn't say "I don't know" — it fabricates a fluent, convincing hallucination. ChronoCast enforces a hard gate: if the top semantic match falls below 0.30, zero LLM calls are made and zero tokens are spent.

0.00 0.25 0.50 0.75 FLOOR: 0.30 Top semantic match 0.66 ✓ Passed to AI Secondary context 0.48 ✓ Passed to AI Weak synonym 0.27 ✗ Rejected Unanswerable control question benchmark 0.24 ✗ Rejected Random background corpus noise 0.19 ✗ Rejected
Zero tokens burned when corpus lacks answer 100% Grounded Citations

Empirical Gate Calibration

The 0.30 floor was calibrated with 54 labeled questions and 5 genuine unanswerable questions. The unanswerable controls never exceeded 0.242, while answerable queries never scored below 0.413, placing the 0.30 gate squarely in the noise margin.

Fail-Soft Stage Decoupling

If an Instagram video is private or yt-dlp fails to download media, the caption and author metadata are still preserved, embedded, and made searchable. A partial capture always beats a silent failure.

RLS Security Testing

Every database table enforces Supabase Row-Level Security (RLS) with dedicated automated testing (vitest.rls.config.ts). Users can never access or leak another account's captures or vector coordinates.

Interactive Field Guide

Walk through the ChronoCast pipeline live

See how one saved Instagram video moves through the 10 stops, from browser tap to timecoded transcript and cited answers.