Skip to content
Agent Memory
Skill

/enzyme-sqlite-source

Connect an unfamiliar SQLite database to Enzyme without changing the source data. Inspect the database, decide which query columns represent identity, people, time, content, and folders, show real examples for approval, save a workspace program in the Enzyme language, and verify

From plugin
enzyme
1602 skills

Claude Code

$ npx -y skills add byenzyme/enzyme --skill enzyme-sqlite-source --agent claude-code

SKILL.md

enzyme-sqlite-source.SKILL.md
name: enzyme-sqlite-source
description: Connect an unfamiliar SQLite database to Enzyme without changing the source data. Inspect the database, decide which query columns represent identity, people, time, content, and folders, show real examples for approval, save a workspace program in the Enzyme language, and verify init and refresh. Use for email, message, CRM, archive, or other structured SQLite sources with no app-specific preset.

Enzyme SQLite Source

The main rule:

> Inspect the source without changing it. Before writing config, show the user real joined rows and explain the timestamps. After the user confirms the mapping, record it in config so `enzyme init` and `enzyme refresh` can repeat the same work without an LLM.

The first job of every user-facing message is revelation, not a report about the engine. Speak in the vocabulary of the archive: its people, dates, messages, mailboxes, threads, folders, and questions. Column names, SQL, NULL rates, source row/bucket counts, embedding counts, entities, and catalysts are evidence for the agent. Translate what they mean before speaking to the user, and keep the raw details in the technical appendix unless the user asks for them.

Follow this order:

1. Inspect the database read-only. 2. Identify the person, date, message, folder, and ID columns and choose a workspace name. 3. Show real examples and ask the user to confirm the mapping. 4. Write the confirmed `source sqlite` declaration in `$ENZYME_HOME/configs/<name>.enzyme`. 5. Validate it with `enzyme scan --workspace <name>`. 6. Build it with `enzyme --workspace <name> init`, then use `refresh`. 7. Verify document and embedding counts. 8. Test whether searches for a person are actually about that person.

Enzyme needs these parts from each source row:

  • `id`: a stable value that uniquely identifies the row.
  • `who`: people, organizations, or other named entities.
  • `when`: when the record happened.
  • `what`: the text to index.
  • `where`: an optional thread, mailbox, folder, or similar group.

Never edit, migrate, vacuum, attach to, or create anything in the source database. Open it read-only. Do not write config or initialize Enzyme until the user has seen and confirmed the proposed mapping.

Choose the source and workspace

Choose a short workspace name such as `imessage`, `mail`, or `crm`. It must be one filesystem component, not a path. Address it only as `--workspace <name>`. Enzyme owns its index at `$ENZYME_HOME/workspaces/<name>/enzyme.db` (default `~/.enzyme/workspaces/<name>/enzyme.db`); the skill never chooses, creates, or writes that storage path.

The readable program lives in `$ENZYME_HOME/configs/<name>.enzyme` when `ENZYME_HOME` is set and `~/.enzyme/configs/<name>.enzyme` otherwise. The skill writes one `workspace` with its confirmed `source sqlite` declaration and only the readings the user reviewed. It never chooses an index storage path. For SQLite sources, mapped `who` values deterministically become people and mapped `where` values become threads/folders during indexing; there is no agent task to enumerate them.

Set absolute paths and check that the database and Enzyme command are available:

SOURCE_DB="/absolute/path/to/source.sqlite"
WORKSPACE_NAME="imessage"
ENZYME_BIN=enzyme
test -f "$SOURCE_DB"
sqlite3 -readonly "$SOURCE_DB" 'PRAGMA query_only; PRAGMA quick_check;'
"$ENZYME_BIN" --version

`sqlite3 -readonly` is the safeguard that prevents source writes. The displayed `PRAGMA query_only` value may be `0`; do not present that value as proof that the source was writable or read-only. `PRAGMA quick_check` checks database integrity, not write protection.

If the application is actively using the database, work from a safe snapshot or use SQLite's backup API. Do not copy only the main database file because its WAL file may contain committed data.

1. Inspect the database without changing it

Do not trust a column only because it is named `date`, `from_id`, or `text`. Check its values and joins.

List the schema and count the rows

This first query lists every table, view, and trigger, shows their definitions, and inspects keys and columns on a candidate table. The final command counts that table's rows.

sqlite3 -readonly "$SOURCE_DB" <<'SQL'
.headers on
.mode column
SELECT name, type
FROM sqlite_schema
WHERE type IN ('table','view','trigger') AND name NOT LIKE 'sqlite_%'
ORDER BY type, name;
SELECT type, name, tbl_name, sql
FROM sqlite_schema
WHERE type IN ('table','view','trigger') AND name NOT LIKE 'sqlite_%'
ORDER BY type, name;
PRAGMA foreign_key_list('candidate_table');
PRAGMA index_list('candidate_table');
PRAGMA table_info('candidate_table');
SQL
sqlite3 -readonly "$SOURCE_DB" 'SELECT count(*) AS rows FROM "candidate_table";'

Read views and triggers as well as tables. A view may contain the application's intended join. A trigger may explain how timestamps or soft deletion work. Do not assume foreign keys are declared; many application databases omit them.

2. Identify the person, date, message, and folder columns

The remaining inspection decides how source rows map to Enzyme. Find `who` (people or organizations), `when` (date), `what` (message text), and optional `where` (folder or thread). Also find a stable `id` and prove that the joins still return one row per record.

Find possible `who` columns

For each promising text column or foreign key, check how often it has a value, how many different values it has, and which values appear most often:

SELECT count(*) AS rows,
       count(candidate) AS nonnull,
       count(DISTINCT candidate) AS distinct_values,
       round(1.0 * count(DISTINCT candidate) / nullif(count(candidate), 0), 4) AS distinct_ratio
FROM "candidate_table";

SELECT candidate, count(*) AS occurrences
FROM "candidate_table"
WHERE candidate IS NOT NULL AND trim(CAST(candidate AS TEXT)) <> ''
GROUP BY candidate
ORDER BY occurrences DESC
LIMIT 20;

Good `who` values are

Read more
@byenzyme
Ships withenzyme

Enzyme compiles your notes and other knowledge sources into a local index that: Uses temporally grounded context sampling that captures the contextual use of tags and wikilinks, or natural accumulation in folders (i.e.

Stars on GitHub

Momentum

stars in total
160
Star history of byenzyme/enzyme on GitHub, a chart by star-history.com

Other skills on enzyme.

enzyme-workspace-setup

enzyme-workspace-setup

Set up or check Enzyme in a Markdown workspace. Use for first setup, re-setup, diagnosis, or requested cleanup; existing Enzyme…

@byenzyme@byenzymeInstall Skill

More skills from other plugins.

agent-cost-report

agent-cost-report

Believable agent cost report for any period, default the last 7 full days PT, not counting today. Measured tokens from Claude…

claude-mem10d116k
@thedotmack@thedotmackInstall Skill
bot-handoff

bot-handoff

Keep a durable record of work passed between Bots in the shared Hindsight memory bank. Use when handing work to another Bot, when…

hindsight11d60k
@vectorize-io@vectorize-ioInstall Skill
mempalace

mempalace

Install, configure, and operate MemPalace, including a private local palace, a shared-brain hub, or a client joining an existing…

@mempalace@mempalaceInstall Skill
mempalace

mempalace

Install, configure, and operate MemPalace, including a private local palace, a shared-brain hub, or a client joining an existing…

@milla-jovovich@milla-jovovichInstall Skill

Questions about enzyme-sqlite-source.

Which coding agents can use enzyme-sqlite-source?
enzyme-sqlite-source installs in Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, OpenCode and Windsurf with the skills CLI, using each agent's flag shown on this page. Flowy's auto-invocation, which fires a skill when your prompt matches, runs in Claude Code only.