Schema

Understanding RA-H's data structure

Why SQLite?

RA-H uses SQLite for true local-first data ownership. Your knowledge stays on your machine - no cloud dependencies, no data mining, no vendor lock-in.

Benefits:

  • Single file database - Simple and portable
  • No cloud dependencies - Your data never leaves your Mac
  • Fast vector search - sqlite-vec extension for semantic connections
  • Full-text search - Google-like text search across all your content
  • Your data forever - Portable format that migrates with future Mac app

Database Location: ~/Library/Application Support/RA-H/db/rah.sqlite

Database Schema

RA-H SQLite Database Schema - Core tables and relationships

Core Data Model

Nodes

Your knowledge items. Each node represents a discrete piece of information:

  • Papers, ideas, people, projects, videos, tweets, etc.
  • Title, description (WHAT + WHY), and notes (user's thoughts)
  • Event date (when the thing actually happened, distinct from created_at)
  • External links to source material
  • Metadata for structured information
  • Embeddings for semantic search

Temporal dimensions: Each node has three timestamps:

  • created_at - When the node entered the graph (transaction time)
  • updated_at - When the node was last modified
  • event_date - When the thing actually happened (valid time)

Edges

Connections between nodes that form your knowledge graph:

  • Directed relationships (from → to)
  • Context describing the relationship (stored as JSON with category, type, explanation)
  • Source tracking (user-created vs agent-discovered)

Dimensions

Flexible categorization tags that emerge from your content:

  • Multi-select (nodes can have many dimensions)
  • No rigid hierarchies
  • Icon support (persisted in database)
  • Automatically suggested by AI based on content

Chunks

Long-form content split into searchable pieces:

  • Enables detailed search within documents
  • Each chunk indexed separately
  • Maintains reference back to source node
  • Powers the content embedding search

RA-H uses two types of embeddings for different search needs:

Node-Level Embeddings

Search across all your knowledge items at a high level. Find nodes that are semantically similar to your query, even if they don't contain the exact words.

Chunk-Level Embeddings

Search within the content of long documents. Find specific passages that answer your question, even deep within large papers or notes.

Data Ownership

Everything lives in a single SQLite file on your Mac:

  • No cloud sync required
  • No subscription to access your own data
  • Easy to backup (just copy one file)
  • Portable to future versions of RA-H
  • Compatible with standard SQLite tools

Auto-updates preserve your data — your knowledge graph persists through all app updates.