The memory model

Every piece of information that CMK stores passes through a classification pipeline. Five semantic gates determine what gets remembered, how long it persists, and how confidently it can be recalled.

Five semantic gates

Each memory is routed through exactly one gate. The gate determines scope, default decay, and retrieval priority.

behavioral

user

Captures preferences, habits, and workflow patterns. These are things you do consistently: your editor choice, preferred languages, formatting style, testing approach. Behavioral memories form the backbone of your identity document and tend to be stable over time.

"I always use 2-space indentation. I prefer functional components over class components. I run tests with pytest and use fixtures heavily."

relational

project

Tracks people, teams, and social context around your work. Who owns what service, who reviews which PRs, team structure, and reporting lines. Relational memories are scoped to projects because team structure varies across codebases.

"Sarah leads the auth service. Marcus handles the data pipeline. The design team uses Figma and ships weekly."

epistemic

project

Stores facts, knowledge, and technical details about your systems. Architecture decisions, API contracts, database schemas, deployment configurations. Epistemic memories are the factual foundation that Claude references when answering technical questions.

"Our API uses JWT with RS256 signing. The user table has a composite index on (org_id, email). We deploy to AWS us-east-1."

promissory

project

Records commitments, plans, and agreed-upon future actions. These naturally expire faster because plans change. When a promissory memory decays, it signals that the commitment may need to be revisited or confirmed.

"We decided to migrate to Postgres next sprint. The API v2 launch is scheduled for March. I promised to refactor the auth middleware before Friday."

correction

global

Captures mistakes to avoid and explicit corrections. When you tell Claude it got something wrong, that correction is stored globally so the same mistake is not repeated in any project. Corrections have the highest retrieval priority.

"Do not use the legacy /v1/users endpoint. The config key is database_url, not db_url. Never commit .env files to the repo."

Decay classes

Memories do not live forever by default. Each is assigned a decay class that determines how quickly its confidence degrades over time.

ephemeral

~24h

Very short-lived memories that expire within a day. Used for transient context like current debugging sessions, temporary workarounds, or in-progress tasks that will be resolved shortly.

Examples: debugging notes, temporary workarounds, WIP context

session

~7d

Memories that persist across a few sessions but fade within a week. Useful for short-term project context, sprint-level planning, or information that is relevant for a limited period.

Examples: sprint goals, short-term decisions, meeting follow-ups

durable

~90d

Long-lived memories that persist for months. Most epistemic and behavioral memories fall into this class. They represent stable knowledge that changes infrequently.

Examples: tech stack choices, coding preferences, team structure

permanent

never

Memories that never decay. Reserved for pinned memories and core identity facts. Only assigned manually via the pin endpoint or when a memory is marked as critical.

Examples: pinned corrections, core identity facts, critical preferences

Pinned memories bypass decay entirely. They persist until manually unpinned.

Confidence scoring

Every memory carries a confidence score between 0 and 100. This score determines recall priority and is influenced by several factors.

FactorEffectImpact
Initial classificationGate classifier assigns a base confidence based on signal clarity60-95
RepetitionSame information mentioned multiple times increases confidence+5 per mention
RecencyMore recent memories get a recency boost during retrieval+10 max
DecayConfidence decreases over time based on decay class-varies
ContradictionNew information that contradicts an existing memory lowers the older one-20 to -50
PinningPinned memories are locked at their current confidencelocked

Storage architecture

CMK uses a dual-store design. Structured metadata lives in SQLite. Semantic representations live in a vector store.

SQLite (metadata)

Stores memory records, identity documents, gate classifications, confidence scores, timestamps, and decay state. Single file, zero configuration.

Location~/.cmk/memories.db
Schemamemories, identity, api_keys
Migrationsauto on startup
Backupstandard file copy

Vector store (embeddings)

Stores embedding vectors for semantic search. In local mode, uses fastembed with on-disk storage. In cloud mode, uses Qdrant Cloud with Jina embeddings.

Local enginefastembed
Cloud engineQdrant Cloud + Jina
Dimensions384 (local) / 768 (cloud)
Searchcosine similarity + keyword