Platform

SQLite Index & Monorepo Sync

How Strata stores project metadata in .strata/graph.db and keeps it up to date incrementally.

Strata stores its local index in <workspaceRoot>/.strata/graph.db using SQLite in WAL mode (Schema v3). Everything stays inside your project's .strata/ directory (ignored by Git).

What Gets Stored in .strata/graph.db

  • packages: Monorepo packages (from pnpm-workspace.yaml, package.json#workspaces, or root), detected framework, router, tsconfig.json path, and package exports.
  • files: Tracked frontend files with mtime, size, SHA-256 content_hash, page/layout flags, and cached contracts.
  • symbols & symbols_fts: Indexed components, functions, composables, stores, types, props, emits, slots, and models with a SQLite FTS5 full-text index.
  • symbol_edges: Relationships between files and symbols (imports, reexports, renders, calls, reads_state, writes_state, watches_state, passes_prop, listens_event, provides_context, consumes_context, outbound_http).
  • routes: Page and API routes per package.

How Incremental Sync Stays Fast

Strata avoids re-scanning the entire repository on every tool call:

  1. Clean Git fast path: If git status --porcelain is clean and HEAD plus package manifests match the last sync, sync finishes in under 15ms without walking the filesystem.
  2. File watcher dirty queue: While the MCP server is running, edits are queued in memory. If no files changed, sync returns immediately; if only a few files changed, only those files are re-parsed and updated in SQLite.
  3. Parallel worker pool: On large initial scans (>= 1,000 files to parse), Strata automatically distributes parsing across up to 4 Bun worker threads.
  4. Automatic full-sync fallback: Changes to config files (package.json, tsconfig.json, pnpm-workspace.yaml, .gitignore) or bursts of more than 100 dirty files fall back to a full workspace sync so the index stays consistent.
  5. Single-flight coalescing: Concurrent tool calls targeting the same workspace share one in-flight sync instead of duplicating work or fighting over SQLite locks.