Storage (SQLite)
The Context Graph needs a home. All data is stored in a local, encrypted SQLite database with three key extensions: FTS5 for full-text search, sqlite-vec for vector similarity queries, and WAL mode for crash-safe writes.
Data model
The database contains five core entities:
- ContextNode EPages captured in the graph (URL, title, AI summary, entities, embedding, dwell time, tags)
- ContextEdge EConnections between nodes (type, weight, timestamps)
- Space EContext workspaces (name, color, icon, position)
- Tab EIndividual browser tabs (URL, title, suspension state, position within Space)
- ResearchSession EDetected research clusters (node IDs, status, AI summary)
-- Core table: Context Graph nodes
CREATE TABLE context_node (
id TEXT PRIMARY KEY, -- UUID v7
url TEXT NOT NULL,
title TEXT NOT NULL,
domain TEXT NOT NULL,
ai_summary TEXT,
ai_entities TEXT, -- JSON array
ai_embedding BLOB, -- 384-dim float32 vector
visit_count INTEGER DEFAULT 1,
total_dwell_time INTEGER DEFAULT 0,
first_visited TEXT NOT NULL,
last_visited TEXT NOT NULL,
user_tags TEXT, -- JSON array
space_id TEXT REFERENCES space(id),
is_excluded INTEGER DEFAULT 0
);
-- Full-text search index
CREATE VIRTUAL TABLE context_node_fts USING fts5(
title, url, ai_summary, ai_entities, user_notes,
content=context_node
); Encryption at rest
The SQLite database is encrypted with a user-derived key. WAL (Write-Ahead Logging) mode ensures no data loss on unexpected shutdown. Periodic session state snapshots provide crash recovery.
Was this page helpful?