Skip to main content

Memory Schema

Every piece of information Mindr stores is a MindrMemory. Understanding the schema lets you write precise queries and custom integrations.

MindrMemory

interface MindrMemory {
id: string // stable UUID
content: string // the text of the memory
role: 'user' | 'system' // 'user' = manual; 'system' = auto-detected
sessionId?: string // agent session that created this memory
tags: MindrTag[] // key/value labels for filtering
metadata?: Record<string, unknown> // structured data beyond text
createdAt: string // ISO 8601 timestamp
deletedAt?: string // set on soft-delete; excluded from queries
}

interface MindrTag {
key: string
value: string
}

Memory types

The type tag is the primary classifier. Every memory has exactly one type tag (except metering records which are internal).

TypeWho creates itPurpose
decisionPost-commit hook, mindragent rememberArchitectural or significant code choices
conventionPost-commit hook, mindragent initNaming and file conventions per language
bug_patternPost-commit hook (fix commits)Structural fingerprint of a known bug shape
debtPost-commit hook, mindragent debt addTODO / FIXME / HACK markers with location
debt_resolvedmindragent debt resolveMarker that a debt item was addressed
session_checkpointmindragent session checkpointSession summary written before context switch
notemindragent rememberFree-form manual notes
contextPost-commit hookActivity record for session metering

Common tags

Tags are stored as { key, value } objects in the SDK and as mindr:<key>:<value> strings on the wire (in the Remembr backend). packages/core/src/schema.ts is the conversion boundary.

KeyValuesUsed on
typeSee table aboveAll memories
moduleDirectory name (e.g. auth, api)Most memories
languagetypescript, python, go, rust, javascriptconvention
fingerprintSHA-256 hex stringbug_pattern
fix_commitGit SHAbug_pattern
severityhigh, medium, lowdebt
debt_idStable hash of file+keyword+textdebt
git_commitGit SHAdecision, context
branch_lineageBranch namedecision, context
reversed_decisiontruenote (reversal markers)
original_decisionMemory IDnote (reversal markers)
original_debtMemory IDdebt_resolved
sourcemanualManually-added debt and memories

Decision metadata

Decision memories carry structured metadata beyond the tag set:

{
date: "2026-05-01", // YYYY-MM-DD
trigger: "keyword", // primary trigger type
triggers: ["keyword", "dep-change"], // all triggered signals
confidence: 0.55, // sum of signal weights [0, 1]
rationale: "...", // commit body text
filesAffected: ["package.json", "src/api/index.ts"]
}

Debt metadata

{
file: "src/billing/invoice.ts",
line: 47,
keyword: "FIXME",
severity: "high",
manual: true // only present for manually-added items
}

Convention metadata

Convention memories store a full ConventionProfile in metadata:

{
language: "typescript",
profile: {
language: "typescript",
analyzedFiles: 42,
analyzedAt: "2026-05-01T10:00:00Z",
conventions: [
{ pattern: "camelCase", category: "functionNames", score: 97, sampleCount: 210 },
{ pattern: "PascalCase", category: "classNames", score: 100, sampleCount: 18 },
{ pattern: "kebab-case", category: "fileNames", score: 89, sampleCount: 45 }
]
}
}

Wire format

When memories are stored in the Remembr backend, tags are serialised as strings in the format mindr:<key>:<value>. For example:

mindr:type:decision
mindr:module:api
mindr:git_commit:a1b2c3d4

The MindrTag ↔ wire format conversion is handled automatically by packages/core/src/schema.ts. You never need to construct wire-format strings unless writing a custom backend.