← All documentation

Reference

Local database schema

Everything OOMU stores, and how. All of it lives on your Mac.

Fileoomu-beta2.sqlite
EngineSQLite via SQLCipher
Schema version1
Namespaceai.eldris.oomu.gpd.beta2

1. Encryption

The database is encrypted with SQLCipher. Every connection opens with:

PRAGMA key='<key>';
PRAGMA cipher_memory_security=ON;
PRAGMA foreign_keys=ON;
PRAGMA secure_delete=ON;
  • The key is held in the macOS Keychain, under a service namespace specific to Beta 2. It is never written to disk in plain text and never transmitted.
  • cipher_memory_security wipes sensitive pages from memory.
  • secure_delete overwrites deleted content rather than merely unlinking it.
  • After opening, OOMU verifies the database is actually encrypted before proceeding. Failure raises data_encryption_failed rather than continuing against a readable file.

A copied database file is not enough to read your data. The key is bound to your Keychain, on this Mac.

What is not in here

Secrets. API keys, OAuth refresh tokens, and channel bot tokens live in the Keychain. The database stores only an opaque reference (credential_ref, account_binding_digest) plus non-secret metadata.


2. Schema conventions

Every table is written with constraints rather than trusting the caller.

ConventionExample
Prefixed identifiers, enforced by GLOBproject_id GLOB 'project_*', turn_id GLOB 'turn_*'
Enumerations as CHECK constraintsdata_policy IN ('local_only','cloud_permitted')
Digests as exactly 64 charactersCHECK (length(sha256) = 64)
JSON validated on writeCHECK (json_valid(metadata_json))
Millisecond timestamps, orderedCHECK (updated_at_ms >= created_at_ms)
Cross-field consistencyA completed activity must have receipts; a failed one must not

The last is worth dwelling on. Illegal states are rejected by the database, not just avoided by the code above it.


3. Projects

TableHolds
projectsName, description, data_policy (local_only or cloud_permitted), instructions up to 32,000 characters, archive timestamp.
project_documentsImported files. Format is pdf, xlsx, xls, docx, or csv; up to 8 MB each; SHA-256; extracted markdown up to 256 KB. Unique per (project_id, sha256).
project_document_chunksIndexed passages with ordinal, page number, heading, content up to 4 KB, content digest, and precomputed lexical and semantic term sets.
project_scratchpadsThe Notes markdown, up to 256 KB, with a revision counter.
project_artifactsLinks artifacts to projects, maintained by triggers on artifacts.
recoverable_project_deletionsStaged deletions with a purge deadline.

4. Chat

TableHolds
chat_sessionsTitle and title source, project, provider and model, context limit (2,048 – 2,000,000).
chat_messagesRole (user, assistant, system, tool), content up to 1 MB, provider and model, metadata JSON, content digest.
chat_attachmentsAttached files with source path, source identity digest, private copy, media type, extracted text and its digest, and extraction state (complete, truncated, not_text).
completed_turnsOne row per committed turn: request digest, result JSON, result digest.
accepted_turn_routingThe routing decision for a turn, with its digest.
recoverable_chat_deletionsStaged deletions with a purge deadline.

completed_turns and accepted_turn_routing are keyed by turn_id and store a request digest, which is what makes a turn replay-safe.


5. Activity and evidence

activity_records is one row per turn, with a state of queued, routing, running, verifying, completed, failed, or recovery_required.

Its constraint is the interesting part:

  • completed requires receipt_count > 0, an evidence_digest, and no failure category.
  • failed requires receipt_count = 0, no evidence digest, and a failure category from routing, local_model, cloud_service, native_execution, persistence, setup, or unknown.
  • Any other state requires no receipts, no evidence, and no failure category.

A turn cannot be recorded as completed without evidence behind it. The database refuses the row.


6. Ledger

TableHolds
model_usage_ledgerOne row per turn: execution_kind (local or cloud), provider, model, and input/output token counts.

Token counts are nullable, but only together: a row cannot have input tokens without output tokens. Where a cloud provider did not return usage, the interface reports it: "{count} cloud responses did not include token totals." It does not estimate.


7. Agents

TableHolds
agentsName, description, instructions, routing mode, provider and model, favorited, archived.
agent_profilesPersonality: template, identity, communication style, traits, values, boundaries.
agent_model_policiesPer-agent context limit (2,048 – 1,000,000) and max output (256 – 8,192).
agent_mod_policiesWhether the agent uses all enabled Mods.
agent_mod_bindingsSpecific Mod bindings.
chat_session_agentsWhich agent is bound to which chat.

8. Workflows and schedules

TableHolds
workflowsName, project, version, state, graph digest, last run.
workflow_graphsThe compiled graph per version, with its digest, origin turn, decision digest, and capability manifest version.
workflow_authoring_definitionsThe authored definition per version.
workflow_execution_contextsThe snapshot and envelope a version runs against.
workflow_instancesRuns, with run_key, state, current step, output, pause reason, and error code. Unique per (workflow_id, workflow_version, run_key).
workflow_step_runsPer-step state, effect JSON and digest, arguments and digest, missing fields, and receipt JSON and digest.
workflow_routinesSchedule JSON, missed-run policy and cap (1–12), required connections, controlled destinations, active flag, next run, and a lease token with expiry.
workflow_routine_occurrencesOne row per scheduled slot, unique per (routine_id, scheduled_for_ms).
schedulesSource and normalized expression, and kind (cron or interval).
schedule_runsResult state and notification state per occurrence.
recoverable_workflow_deletionsStaged deletions with a purge deadline.

The uniqueness constraint on (routine_id, scheduled_for_ms) is what makes scheduled execution exactly-once across restarts. The lease token is what stops two processes claiming the same routine.

workflow_instances references workflow_graphs with ON DELETE RESTRICT: a graph version with runs against it cannot be deleted, so history never dangles.


9. Documents produced

TableHolds
artifactsKind, display name, canonical path, byte length, SHA-256, and verification state (verified, missing, changed).
artifact_inspectionsPage, sheet, slide, and formula counts; preview key, digest, byte length, and dimensions; renderer identifier and its SHA-256.

artifact_inspections deliberately holds no filesystem path. The preview is addressed by content key, so a preview record cannot leak where a file lives.


10. Connections

TableHolds
connectionsThe unified view. Kind is apple, mcp, connector, or channel; state is configured, connected, degraded, expired, unavailable, or disconnected.
remote_connections · remote_operations · remote_oauth_attemptsOAuth connectors and their cataloged operations.
remote_channel_accountsTelegram or Discord accounts, with a credential_ref of the form channel-secret:* and an account binding digest. Unique per (provider, account_binding_digest).
remote_channel_destinationsVerified destinations per account.
local_mcp_serversExecutables you selected, with per-tool read-only flags.
mcp_setup_manifests · mcp_setup_connections · mcp_setup_secret_bindings · mcp_setup_secret_cleanup_obligations · mcp_setup_operationsManifest-configured MCP connections.

mcp_setup_secret_cleanup_obligations exists so that a secret whose connection is removed is recorded as needing removal from the Keychain, and cannot be forgotten because the delete happened between two failures.


11. Models and providers

TableHolds
local_modelsDisplay name, architecture, canonical path, byte length, SHA-256, device, inode, and modification time, and default flag.
cloud_model_connectionsProvider, verified model, and an account digest.
custom_cloud_providersDisplay name, origin, endpoint path, and model IDs.
remote_model_catalogA signed catalog snapshot with version, ETag, and a 128-character signature.

Recording device, inode, and modification time alongside the hash means OOMU can tell a model file that moved from one that was replaced.


12. Mods

TableHolds
installed_modsName, description, version, author, category, enabled flag, integrity state (verified, invalid, missing), package digest, declared capability IDs, and declared endpoint hosts.
installed_mod_packagesInstalled root, entry point, canonical manifest JSON, trust state, file count, byte count.

Trust state and integrity state are separate columns because they answer different questions: who signed it, and do the files still match.


13. Memory and profile

TableHolds
internal_memory_recordsContent up to 16,000 characters, scope (global or project), and the session, turn, and goal it came from. Forgetting sets four fields together or none. A unique partial index prevents duplicate active memories with the same content in the same scope.
profile_settingsDisplay name, locale, appearance (cool, creme, dark, system), cloud permitted, default provider and model.
profile_personalizationPronouns, role, background, timezone, languages, expertise, interests, priorities, current projects, context, response guidance, tone, length, formatting, boundaries.
enterprise_security_settingsair_gap_mode. Seeded on creation.
daily_briefingsOne row per date, keyed YYYY-MM-DD, with the synthesized content.

Every memory record carries its provenance. A saved fact can always be traced to the turn that produced it.


14. Mutation journal

data_mutations records one row per durable change:

Column
operation_idPrimary key, supplied by the caller.
operationWhat was requested.
request_digestSHA-256 of the request.
entity_kind, entity_idWhat changed.
result_json, result_digestWhat the result was.
committed_at_msWhen.

This is what makes the bridge idempotent. Replaying an operation_id returns the recorded result rather than repeating the change.


15. What is stored outside the database

Where
SecretsmacOS Keychain, service ai.eldris.oomu.gpd.beta2.credentials
Audit signing keyThe Secure Enclave. Non-extractable.
Model filesWherever you chose them, referenced by canonical path and hash
Private document and attachment copiesThe application data root
Effect journalexecution/effect-journal-v1.json in the application data root
ArtifactsWhere they were written, referenced by canonical path and hash