Cursor BYOK Database Schema
leookun/cursor-byok
Guides SQLite schema changes in the Cursor BYOK server, keeping SQLx migrations, the Rust store, API contracts and fixtures aligned.
Walks through adding a new persisted memory kind to EverOS: choose storage among Markdown, SQLite and LanceDB, pick a Markdown strategy, then wire schemas, repos and writers.
$ npx skills add EverMind-AI/EverOS --skill add-memory-kind -a claude-codeProject install by default; add -g for ~/.claude/skills/.
$ gh skill install EverMind-AI/EverOS add-memory-kind --agent claude-codeProject scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).
$ git clone --depth 1 https://github.com/EverMind-AI/EverOS.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.claude/skills/add-memory-kind .claude/skills/add-memory-kind && rm -rf skills-srcUse ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.
Claude Code skills documentation · loads skills from .claude/skills/
Install the "add-memory-kind" agent skill from https://github.com/EverMind-AI/EverOS/tree/main/.claude/skills/add-memory-kind into .claude/skills/add-memory-kind/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "add-memory-kind", then confirm the skill loads.Claude Code copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$skill-installer install https://github.com/EverMind-AI/EverOS/tree/main/.claude/skills/add-memory-kindType this inside Codex. $skill-installer <name> installs a curated skill from openai/skills. The installer writes to $CODEX_HOME/skills (default ~/.codex/skills). Restart Codex if the skill does not show up.
$ npx skills add EverMind-AI/EverOS --skill add-memory-kind -a codexProject install goes to .agents/skills/; add -g for ~/.codex/skills/.
$ gh skill install EverMind-AI/EverOS add-memory-kind --agent codexProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/EverMind-AI/EverOS.git skills-src && mkdir -p .agents/skills && cp -r skills-src/.claude/skills/add-memory-kind .agents/skills/add-memory-kind && rm -rf skills-srcUse ~/.agents/skills/ instead of .agents/skills for a personal install.
Codex skills documentation · loads skills from .agents/skills/
Install the "add-memory-kind" agent skill from https://github.com/EverMind-AI/EverOS/tree/main/.claude/skills/add-memory-kind into .agents/skills/add-memory-kind/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "add-memory-kind", then confirm the skill loads.Codex copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ npx skills add EverMind-AI/EverOS --skill add-memory-kind -a cursorProject install goes to .agents/skills/; add -g for ~/.cursor/skills/.
$ gh skill install EverMind-AI/EverOS add-memory-kind --agent cursorProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/EverMind-AI/EverOS.git skills-src && mkdir -p .cursor/skills && cp -r skills-src/.claude/skills/add-memory-kind .cursor/skills/add-memory-kind && rm -rf skills-srcUse ~/.cursor/skills/ instead of .cursor/skills for a personal install.
Cursor skills documentation · loads skills from .cursor/skills/, .agents/skills/, .claude/skills/, .codex/skills/
Install the "add-memory-kind" agent skill from https://github.com/EverMind-AI/EverOS/tree/main/.claude/skills/add-memory-kind into .cursor/skills/add-memory-kind/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "add-memory-kind", then confirm the skill loads.Cursor copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ gemini skills install https://github.com/EverMind-AI/EverOS.git --path .claude/skills/add-memory-kind--scope user (default) or --scope workspace; --path is the subfolder of the repo that holds the skill; --consent skips the security confirmation prompt.
$ npx skills add EverMind-AI/EverOS --skill add-memory-kind -a gemini-cliProject install goes to .agents/skills/; add -g for ~/.gemini/skills/.
$ gh skill install EverMind-AI/EverOS add-memory-kind --agent gemini-cliProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/EverMind-AI/EverOS.git skills-src && mkdir -p .gemini/skills && cp -r skills-src/.claude/skills/add-memory-kind .gemini/skills/add-memory-kind && rm -rf skills-srcUse ~/.gemini/skills/ instead of .gemini/skills for a personal install, then run /skills reload.
Gemini CLI skills documentation · loads skills from .gemini/skills/, .agents/skills/
Install the "add-memory-kind" agent skill from https://github.com/EverMind-AI/EverOS/tree/main/.claude/skills/add-memory-kind into .gemini/skills/add-memory-kind/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "add-memory-kind", then confirm the skill loads.Gemini CLI copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ gh skill install EverMind-AI/EverOS add-memory-kindInstalls for Copilot at project scope by default; add --scope user for a personal install. Preview a skill first with gh skill preview. Needs GitHub CLI 2.90.0 or later (public preview).
$ npx skills add EverMind-AI/EverOS --skill add-memory-kind -a github-copilotProject install goes to .agents/skills/; add -g for ~/.copilot/skills/.
$ git clone --depth 1 https://github.com/EverMind-AI/EverOS.git skills-src && mkdir -p .github/skills && cp -r skills-src/.claude/skills/add-memory-kind .github/skills/add-memory-kind && rm -rf skills-srcUse ~/.copilot/skills/ instead of .github/skills for a personal install. Commit .github/skills so cloud agent and code review can use it.
GitHub Copilot skills documentation · loads skills from .github/skills/, .claude/skills/, .agents/skills/
Install the "add-memory-kind" agent skill from https://github.com/EverMind-AI/EverOS/tree/main/.claude/skills/add-memory-kind into .github/skills/add-memory-kind/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "add-memory-kind", then confirm the skill loads.GitHub Copilot copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ npx skills add EverMind-AI/EverOS --skill add-memory-kind -a opencodeOpenCode documents no install command of its own. Project install goes to .agents/skills/; add -g for ~/.config/opencode/skills/.
$ gh skill install EverMind-AI/EverOS add-memory-kind --agent opencodeProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/EverMind-AI/EverOS.git skills-src && mkdir -p .opencode/skills && cp -r skills-src/.claude/skills/add-memory-kind .opencode/skills/add-memory-kind && rm -rf skills-srcUse ~/.config/opencode/skills/ instead of .opencode/skills for a personal install.
OpenCode skills documentation · loads skills from .opencode/skills/, .claude/skills/, .agents/skills/
Install the "add-memory-kind" agent skill from https://github.com/EverMind-AI/EverOS/tree/main/.claude/skills/add-memory-kind into .opencode/skills/add-memory-kind/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "add-memory-kind", then confirm the skill loads.OpenCode copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
add-memory-kindWalks through adding a new persisted memory kind to EverOS: choose storage among Markdown, SQLite and LanceDB, pick a Markdown strategy, then wire schemas, repos and writers.
The skill is for adding a new persisted business entity such as an Episode, Case, Skill, AtomicFact, Foresight or Profile. It starts with the storage decision, since a memory kind need not use all three layers. Markdown is the human-readable source of truth, SQLite holds structured state with transactions and joins, and LanceDB handles vector, BM25 or hybrid retrieval, with SQLite and LanceDB treated as indexes that can be rebuilt from the Markdown. A table lists common combinations, from Markdown only to SQLite only.
Next comes the Markdown strategy from the EverOS Markdown First spec: daily-log append with dated filenames, skill-named files overwritten in place, or a single file rewritten, such as user.md or soul.md. Only the daily-log recipe is complete, in four steps beginning with a frontmatter schema under infra/persistence/markdown/mds. The other two are sketched and meant to be built as thin wrappers over MarkdownWriter until their base writers land.
8 steps, taken from the step headings in SKILL.md.
Read from SKILL.md and the folder at commit d2aa949. It shows what the files ask for, not the result of running them.
Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.
From allowed-tools in the SKILL.md frontmatter.
Shell commands in SKILL.md call:
makeFrom the folder's file list and the shell code blocks in SKILL.md.
No URLs in SKILL.md.
From URLs in SKILL.md, links to its own repository left out.
Names no API keys, tokens, secrets or passwords.
From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.
Add Memory Kind loads about 2.6k tokens when it runs. Until then it costs about 60 tokens; SKILL.md has 699 words of instructions outside code blocks.
Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.
The automated check found no risky patterns in SKILL.md.
Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.
The full file from EverMind-AI/EverOS at commit d2aa949, republished under its Apache-2.0 licence (© EverMind-AI). 699 words, ~2,619 tokens.
.claude/skills/add-memory-kind/SKILL.md (or your agent's skills folder).Adding a new persisted business entity (Episode, Case, Skill, AtomicFact, Foresight, Profile, or something custom). Multiple storage layers may be involved; this skill walks the decision then the wiring.
A memory kind does not have to use all three layers. Pick by what the kind actually needs:
| Need | Markdown | SQLite | LanceDB |
|---|---|---|---|
| Human-readable / agent-editable source-of-truth text | ✅ | ||
| Structured state, ACID transactions, joins, predicates | ✅ | ||
| Vector / BM25 / hybrid retrieval | ✅ |
Common combinations seen in EverOS:
| Combo | Example | Rationale |
|---|---|---|
| md only | scratch notes / dump bins | text-of-truth, no index needed |
| md + lancedb | episode / memcell / case | text-of-truth + semantic retrieval |
| md + sqlite | profile / playbook / soul.md state | text-of-truth + structured state to query |
| md + sqlite + lancedb | full-blown business records | when you need both transactional state AND retrieval |
| sqlite only | audit log / task queue / LSN watermark | system state, never user-facing |
| lancedb only | rare; usually you still want md | derived embeddings without text-of-truth |
Rule of thumb: markdown is the truth; sqlite and lancedb are derived indexes that can be rebuilt from md. Drop md only when the kind has no human-readable form (pure system state).
Three strategies — declared in the EverOS Markdown First spec:
| Strategy | Filename | Mutation | Examples |
|---|---|---|---|
| Daily-log append | <prefix>-YYYY-MM-DD.md | append entries | memcell / episode / case / atomic_fact / foresight |
| Skill-named in-place | skill_<name>.md | overwrite the file | skills (procedural memory) |
| Single-file rewrite | user.md / agent.md / soul.md / behaviors.md / tools.md | overwrite the file | profiles / playbooks |
This skill currently has a complete recipe for daily-log append.
Skill-named and single-file recipes are sketched at the bottom — their
base writers (BaseSkillWriter / BaseProfileWriter) land later in the
project; until then build a thin wrapper over MarkdownWriter
directly.
infra/persistence/markdown/mds/<name>.py"""Episode daily-log frontmatter."""
from __future__ import annotations
import datetime as _dt
from typing import ClassVar, Literal
from everos.core.persistence.markdown import UserScopedFrontmatter
class UserEpisodeDailyFrontmatter(UserScopedFrontmatter):
"""``users/<u>/episodes/episode-<YYYY-MM-DD>.md``."""
ENTRY_ID_PREFIX: ClassVar[str] = "ep"
DIR_NAME: ClassVar[str] = "episodes"
FILE_PREFIX: ClassVar[str] = "episode"
type: Literal["user_episode_daily"] = "user_episode_daily"
date: _dt.date
entry_count: int = 0
last_appended_at: _dt.datetime | None = NoneFor agent-track kinds subclass AgentScopedFrontmatter instead. If
user-track and agent-track share a kind name (e.g. memcell), give
each a distinct ENTRY_ID_PREFIX (e.g. umc vs amc) so reverse
lookup is unambiguous.
mds/__init__.pyfrom .episode import UserEpisodeDailyFrontmatter as UserEpisodeDailyFrontmatterinfra/persistence/markdown/writers/<name>.py"""Episode appender."""
from __future__ import annotations
from pathlib import Path
from everos.core.persistence import MarkdownReader
from ..mds import UserEpisodeDailyFrontmatter
from .base import BaseDailyWriter
class UserEpisodeAppender(BaseDailyWriter):
schema = UserEpisodeDailyFrontmatter
# OPTIONAL: override the count strategy. Default is len(entries);
# override to trust the frontmatter field instead.
def _current_count(self, path: Path) -> int:
if not path.exists():
return 0
return MarkdownReader.read(path).frontmatter.get("entry_count", 0)writers/__init__.pyfrom .episode import UserEpisodeAppender as UserEpisodeAppenderfrom everos.infra.persistence.markdown.writers import UserEpisodeAppender
appender = UserEpisodeAppender(memory_root)
eid = appender.append("u_jason", "I went to the doctor today.")
# → users/u_jason/episodes/episode-<today>.md
# → entry markers carry an auto-generated EntryId (e.g. ep_20260507_001)Skip this section if the kind doesn't need structured state beyond markdown.
infra/persistence/sqlite/tables/<name>.pyfrom everos.core.persistence.sqlite import BaseTable, Field
class EpisodeState(BaseTable, table=True):
__tablename__ = "episode_state" # type: ignore[assignment]
id: int | None = Field(default=None, primary_key=True)
entry_id: str = Field(index=True, unique=True)
cluster_id: str | None = Field(default=None, index=True)
status: str = Field(default="active")BaseTable already provides created_at / updated_at (auto-bumped).
tables/__init__.pyfrom .episode import EpisodeState as EpisodeStateinfra/persistence/sqlite/repos/<name>.pyfrom sqlalchemy.ext.asyncio import AsyncSession, async_sessionmaker
from everos.core.persistence.sqlite import RepoBase
from ..sqlite_manager import get_session_factory
from ..tables import EpisodeState
class _EpisodeStateRepo(RepoBase[EpisodeState]):
model = EpisodeState
def _factory_lookup(self) -> async_sessionmaker[AsyncSession]:
return get_session_factory()
episode_state_repo = _EpisodeStateRepo()repos/__init__.pyfrom .episode import episode_state_repo as episode_state_repoSkip this section if the kind doesn't need vector / BM25 / hybrid retrieval.
infra/persistence/lancedb/tables/<name>.pyfrom everos.core.persistence.lancedb import BaseLanceTable, Vector
class EpisodeIndex(BaseLanceTable):
entry_id: str
text: str
tags: list[str]
vector: Vector(384) # type: ignore[valid-type]Vector(N) must match your embedding dimension.
tables/__init__.pyfrom .episode import EpisodeIndex as EpisodeIndexinfra/persistence/lancedb/repos/<name>.pyfrom lancedb import AsyncTable
from everos.core.persistence.lancedb import LanceRepoBase
from ..lancedb_manager import get_table
from ..tables import EpisodeIndex
class _EpisodeIndexRepo(LanceRepoBase[EpisodeIndex]):
schema = EpisodeIndex
table_name = "episode_index"
async def _table_lookup(self) -> AsyncTable:
return await get_table(self.table_name, self.schema)
episode_index_repo = _EpisodeIndexRepo()repos/__init__.pyfrom .episode import episode_index_repo as episode_index_repoWhen the new memory kind needs:
BaseSkillWriter, or use MarkdownWriter.write_markdown directly
with a thin wrapper.user.md) — wait for
BaseProfileWriter, same fallback.These strategies do not use entry markers; their frontmatter schema
does not need ENTRY_ID_PREFIX (only id / type / schema_version plus
the scope mixin fields).
make lint — ruff + import-linter cleanmake test — existing manager / lifespan / writer tests still passTests by layer:
| Tests for | Location |
|---|---|
| Markdown frontmatter schema | tests/unit/test_infra/test_markdown/test_mds/ |
| Markdown business appender | tests/unit/test_infra/test_markdown/test_writers/ |
| SQLite RepoBase logic | tests/unit/test_core/test_persistence/test_sqlite/ |
| SQLite manager / lifespan | tests/unit/test_infra/test_sqlite/ |
| LanceDB LanceRepoBase logic | tests/unit/test_core/test_persistence/test_lancedb/ |
| LanceDB manager / lifespan | tests/unit/test_infra/test_lancedb/ |
| Mistake | Symptom | Fix |
|---|---|---|
Forgot ENTRY_ID_PREFIX / DIR_NAME / FILE_PREFIX on a daily-log schema | BaseDailyWriter.__init__ raises TypeError | Add all three ClassVars |
Same ENTRY_ID_PREFIX on user + agent variants | MemoryLayout.locate_for_entry collision error | Use distinct prefixes (e.g. umc vs amc) |
Imported RepoBase from infra.persistence.sqlite | ImportError | Lives in core.persistence.sqlite (moved earlier) |
| Skipped one of the four files (schema / writer / table / repo) | One side silently absent | Re-export both/all from each __init__.py |
Vector(N) mismatched with embedding dim | LanceDB raises on insert | Make N exactly match the model output |
Imported MemoryLayout from a writer (infra) | import-linter fails (infra → memory reverse dep) | Use MemoryRoot (in core) and let the schema's ClassVars drive paths |
Hand-rolling datetime.now() instead of today_with_timezone() | Day-boundary drift across timezones | Always go through everos.component.utils.datetime |
__init__.py re-export rules: ../../rules/init-py-and-reexport.md© EverMind-AI, Apache-2.0. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file
Just SKILL.md in .claude/skills/add-memory-kind of EverMind-AI/EverOS.
Open the folder on GitHubat commit d2aa949
Add Memory Kind next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.
| Skill | Stars | Used in | Tokens | Auto-check | Licence | Repo updated |
|---|---|---|---|---|---|---|
| Add Memory Kind this skillEverMind-AI/EverOS | 13k | — | ~2.6k | Automated safety check: Pass | Apache-2.0 | |
| Cursor BYOK Database Schemaleookun/cursor-byok | 3.2k | — | ~1.3k | Automated safety check: Pass | MIT | |
| Golang Databaseunxed/f4 | 241 | 2 repos | ~2.9k | Automated safety check: Pass | MIT | |
| Database Expertcin12211/orca-q | 224 | — | ~2.8k | Automated safety check: Pass | MIT | |
| Sqlite Schema Designfastrepl/anarlog | 9.5k | — | ~1.9k | Automated safety check: Pass | MIT | |
| SQLsendou-ink/sendou.ink | 297 | — | ~423 | Automated safety check: Pass | AGPL-3.0 |
leookun/cursor-byok
Guides SQLite schema changes in the Cursor BYOK server, keeping SQLx migrations, the Rust store, API contracts and fixtures aligned.
unxed/f4
Comprehensive guide for Go database access — parameterized queries, struct scanning, NULLable columns, transactions, isolation levels, SELECT FOR UPDATE, connection pool, batch processing, context…
cin12211/orca-q
Database performance optimization, schema design, query analysis, and connection management across PostgreSQL, MySQL, MongoDB, and SQLite with ORM integration.
fastrepl/anarlog
Design or review schemas for crates/cloudsync using SQLite Sync constraints, not generic SQLite advice.
sendou-ink/sendou.ink
Help write, debug, and explore SQLite database queries using Kysely.
XiaomiMiMo/MiMo-Code
Queries MiMoCode's raw trajectory SQLite database for cross-session analysis such as repeated errors, tool-call patterns and verifying what was actually run.
EverMind-AI/EverOS
Reviews the working tree and creates a focused commit with a Conventional Commits message, staging selectively and never bypassing hooks.
EverMind-AI/EverOS
Walks through cutting a versioned everos release: bump the version, update the changelog, tag it, and review the drafted GitHub Release page before publishing.
EverMind-AI/EverOS
Creates a Git branch from an up-to-date main using a type-prefixed, kebab-case name such as feat or fix, and keeps work off main.
EverMind-AI/EverOS
Opens a GitHub pull request against main with the gh CLI, after local checks pass and with the project's PR template filled in honestly.
Works with
Categories
Walks through adding a new persisted memory kind to EverOS: choose storage among Markdown, SQLite and LanceDB, pick a Markdown strategy, then wire schemas, repos and writers. The skill is for adding a new persisted business entity such as an Episode, Case, Skill, AtomicFact, Foresight or Profile. It starts with the storage decision, since a memory kind need not use all three layers.
Add Memory Kind fits situations like: adding a new persisted entity type to the EverOS memory layer; choosing between Markdown, SQLite and LanceDB for a new kind of record; writing the frontmatter schema and writer for a daily-log memory kind.
Run `npx skills add EverMind-AI/EverOS --skill add-memory-kind -a claude-code`. Or copy the skill folder (.claude/skills/add-memory-kind in EverMind-AI/EverOS) into .claude/skills/add-memory-kind in your project. Claude Code loads it when a task matches its description.
Run `npx skills add EverMind-AI/EverOS --skill add-memory-kind -a codex`. Or copy the skill folder (.claude/skills/add-memory-kind in EverMind-AI/EverOS) into .agents/skills/add-memory-kind in your project. Codex loads it when a task matches its description.
Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add EverMind-AI/EverOS --skill add-memory-kind -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/add-memory-kind, .gemini/skills/add-memory-kind, .github/skills/add-memory-kind and .opencode/skills/add-memory-kind in your project.
Going by SKILL.md and its folder, Add Memory Kind needs the command-line tools its instructions call (make). Our summary lists: A checkout of the EverOS repository.
SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.
Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.
Add Memory Kind is published under the Apache-2.0 licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.
About 2.6k tokens (SKILL.md is roughly 10k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.
Skills that share tags, products or a category with Add Memory Kind: Cursor BYOK Database Schema (leookun/cursor-byok, 3.2k stars), Golang Database (unxed/f4, 241 stars), Database Expert (cin12211/orca-q, 224 stars) and Sqlite Schema Design (fastrepl/anarlog, 9.5k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.
EverMind-AI (a GitHub organization) maintains it in EverMind-AI/EverOS, which has 13,371 GitHub stars. The repository holds 5 skills in this directory. The repository was last updated on October 6, 2026.
Source: EverMind-AI/EverOS on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.