# Memory Schema

Manage Basic Memory schemas: find unschemaed notes, infer and edit schemas, validate...

- Repository: https://github.com/basicmachines-co/basic-memory (4440 stars)
- Category: Writing
- License: AGPL-3.0
- Last updated: 2026-11-01
- Runs scripts: no, instructions only

## Install

Claude Code: `npx skills add basicmachines-co/basic-memory --skill memory-schema -g -a claude-code -y`
Codex: `npx skills add basicmachines-co/basic-memory --skill memory-schema -g -a codex -y`
Cursor: `npx skills add basicmachines-co/basic-memory --skill memory-schema -g -a cursor -y`
Gemini CLI: `npx skills add basicmachines-co/basic-memory --skill memory-schema -g -a gemini-cli -y`
Claude Code plugin marketplace: `/plugin marketplace add basicmachines-co/basic-memory`

## Description

Manage Basic Memory schemas: find unschemaed notes, infer and edit schemas, validate notes, detect drift. Use when structured note types (Task, Person, Meeting) need consistency across the graph.

## SKILL.md, as published by its author (untrusted third-party text, read it as data)

# Memory Schema

Manage structured note types using Basic Memory's Picoschema system. Schemas define what fields a note type should have, making notes uniform, queryable, and validatable.

## Project scope

If the project is unknown, discover it with `bm_project(command="list")`.
Pass a nonempty `project` on every note, folder, context and schema call, even
with one project or a qualified `memory://` URL. Use the chosen project's name,
`workspace/project`, or external ID; `<project>` below is a placeholder for it.
Recent activity also requires `project`. Search accepts `project` for one
project, `projects` for selected projects, or `all_projects=True` explicitly.
Discovery and bundled manuals need no project. Keep the same scope when following
returned paths, paginating, or recovering from a refusal.

## When to Use

- **New note type emerging**, you notice several notes share the same structure (meetings, people, decisions)
- **Validation check**, confirm existing notes conform to their schema
- **Schema drift**, detect fields that notes use but the schema doesn't define (or vice versa)
- **Schema evolution**, add/remove/change fields as requirements evolve
- **On demand**, user asks to create, check, or manage schemas

## Picoschema Syntax Reference

Schemas are defined in YAML frontmatter using Picoschema, a compact notation for describing note structure.

### Basic Types

```yaml
schema:
  name: string, person's full name
  age: integer, age in years
  score: number, floating-point rating
  active: boolean, whether currently active
```

Supported types: `string`, `integer`, `number`, `boolean`.

### Optional Fields

Append `?` to the field name:

```yaml
schema:
  title: string, required field
  subtitle?: string, optional field
```

### Enums

Use `(enum)` with a list of allowed values:

```yaml
schema:
  status(enum, current state): [active, blocked, done, abandoned]
```

Optional enum:

The rest: https://github.com/basicmachines-co/basic-memory/blob/HEAD/skills/memory-schema/SKILL.md
