Agent skill

Memory Schema

by basicmachines-co in basicmachines-co/basic-memory

Schema lifecycle management for Basic Memory: discover unschemaed notes, infer schemas, create and edit schema definitions, validate notes, and detect drift.

AGPL-3.0Auto-check passedKnowledge Management

Install Memory Schema

skills CLI
$ npx skills add basicmachines-co/basic-memory --skill memory-schema -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install basicmachines-co/basic-memory memory-schema --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/basicmachines-co/basic-memory.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/memory-schema .claude/skills/memory-schema && rm -rf skills-src

Use ~/.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/

Facts

Skill name
memory-schema
GitHub stars
4.1k
Used in
1 other repo
Token cost
~2k tokens
SKILL.md length
638 words
Files
1
Skills in repo
49
Repo updated
First seen
Licence
AGPL-3.0

At a glance

Schema lifecycle management for Basic Memory: discover unschemaed notes, infer schemas, create and edit schema definitions, validate notes, and detect drift.

  • Works in 3 steps: Search by type:… → Infer a schema: Use schema_infer to… → Review the suggestion — the inferred…
  • Working with structured note types (Task
  • SKILL.md covers When to Use, Picoschema Syntax Reference, Discovering Unschemaed Notes and Creating a Schema, plus 4 more sections
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md

What it does

Memory Schema is an agent skill from basicmachines-co/basic-memory. Schema lifecycle management for Basic Memory: discover unschemaed notes, infer schemas, create and edit schema definitions, validate notes, and detect drift. Use when working with structured note types (Task, Person, Meeting, etc.) to maintain consistency across the knowledge graph.

Its SKILL.md is about 2k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.

It sits in Knowledge Management, covering Knowledge graphs. The repository describes itself as: AI conversations that actually remember. Never re-explain your project to your AI again. Join our Discord: https://discord.gg/tyvKNccgqN. The licence is AGPL-3.0.

When your agent uses it

  • Working with structured note types (Task
  • Etc.) to maintain consistency across the knowledge graph

Example prompts

  • “/memory-schema”

Requirements

  • Python 3

Workflow steps

3 steps, taken from the first numbered list in SKILL.md.

  1. Search by type: search_notes(note_types=["meeting"]) — if many notes share a type but no schema/Meeting.md exists, it's a candidate.
  2. Infer a schema: Use schema_infer to analyze existing notes and generate a suggested schema
  3. Review the suggestion — the inferred schema shows field names, types, and frequency. Decide which fields to keep, make optional, or drop.

What it can do on your machine

Read from SKILL.md and the folder at commit 6982cfc. It shows what the files ask for, not the result of running them.

  • Tool permissions

    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.

  • Runs code

    No scripts in the folder and no shell commands in SKILL.md (its code samples are yaml and python).

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Memory Schema loads about 2k tokens when it runs. Until then it costs about 74 tokens; SKILL.md has 638 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~74
When it runs · the whole SKILL.md, loaded when a task matches
~2k

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.

Safety

Auto-check passed

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.

SKILL.md

The full file from basicmachines-co/basic-memory at commit 6982cfc, republished under its AGPL-3.0 licence (© basicmachines-co). 638 words, ~2,028 tokens.

Download SKILL.mdSave it as .claude/skills/memory-schema/SKILL.md (or your agent's skills folder).
name
memory-schema
description
Schema lifecycle management for Basic Memory: discover unschemaed notes, infer schemas, create and edit schema definitions, validate notes, and detect drift. Use when working with structured note types (Task, Person, Meeting, etc.) to maintain consistency across the knowledge graph.

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.

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:

yaml
schema:
  priority?(enum, task priority): [low, medium, high, critical]
Arrays

Use (array) for list fields:

yaml
schema:
  tags(array): string, categorization labels
  steps?(array): string, ordered steps to complete
Relations

Reference other entity types directly:

yaml
schema:
  parent_task?: Task, parent task if this is a subtask
  attendees?(array): Person, people who attended

Relations create edges in the knowledge graph, linking notes together.

Validation Settings
yaml
settings:
  validation: warn    # warn (log issues) or strict (errors)

Use strict as the canonical enforcing mode. error is accepted only as a compatibility alias.

Complete Example
yaml
---
title: Meeting
type: schema
entity: Meeting
version: 1
schema:
  topic: string, what was discussed
  date: string, when it happened (YYYY-MM-DD)
  attendees?(array): Person, who attended
  decisions?(array): string, decisions made
  action_items?(array): string, follow-up tasks
  status?(enum, meeting state): [scheduled, completed, cancelled]
settings:
  validation: warn
---

Discovering Unschemaed Notes

Look for clusters of notes that share structure but have no schema:

  1. Search by type: search_notes(note_types=["meeting"]) — if many notes share a type but no schema/Meeting.md exists, it's a candidate.

  2. Infer a schema: Use schema_infer to analyze existing notes and generate a suggested schema:

    python
    schema_infer(note_type="Meeting")
    schema_infer(note_type="Meeting", threshold=0.5)  # fields in 50%+ of notes

    The threshold (0.0–1.0) controls how common a field must be to be included. Default is usually fine; lower it to catch rarer fields.

  3. Review the suggestion — the inferred schema shows field names, types, and frequency. Decide which fields to keep, make optional, or drop.

Creating a Schema

Write the schema note to schema/<EntityName>:

python
write_note(
  title="Meeting",
  directory="schema",
  note_type="schema",
  metadata={
    "entity": "Meeting",
    "version": 1,
    "schema": {
      "topic": "string, what was discussed",
      "date": "string, when it happened",
      "attendees?(array)": "Person, who attended",
      "decisions?(array)": "string, decisions made"
    },
    "settings": {"validation": "warn"}
  },
  content="""# Meeting

Schema for meeting notes.

## Observations
- [convention] Meeting notes live in memory/meetings/ or as daily entries
- [convention] Always include date and topic
- [convention] Action items should become tasks when complex"""
)
Key Principles
  • Schema notes live in schema/ — one note per entity type
  • note_type="schema" marks it as a schema definition
  • entity: Meeting in metadata names the type it applies to
  • version: 1 in metadata — increment when making breaking changes
  • settings.validation: warn is recommended to start — it logs issues without blocking writes

Validating Notes

Check how well existing notes conform to their schema:

python
# Validate all notes of a type
schema_validate(note_type="Meeting")

# Validate a single note
schema_validate(identifier="meetings/2026-02-10-standup")

Important: schema_validate checks for schema fields as observation categories in the note body — e.g., a status field expects - [status] active as an observation. Fields stored only in frontmatter metadata won't satisfy validation. To pass cleanly, include schema fields as both frontmatter values (for metadata search) and observations (for schema validation).

Validation reports missing required fields (as observation categories, or relations for entity-reference fields) and invalid enum values. Undeclared observation categories and relations are listed as informational "unmatched" items. Scalar values are not type-checked.

Show full SKILL.md (254 more words)Show less
Handling Validation Results
  • warn mode: Review warnings periodically. Fix notes that are clearly wrong; add optional fields to the schema for legitimate new patterns.
  • strict mode: Use where conformance matters (e.g., automated pipelines consuming notes).

Detecting Drift

Over time, notes evolve and schemas lag behind. Use schema_diff to find divergence:

python
schema_diff(note_type="Meeting")

Diff reports:

  • Fields in notes but not in schema — candidates for adding to the schema (as optional)
  • Schema fields rarely used — consider making optional or removing
  • Cardinality changes — a field that moved between single-value and array

Schema Evolution

When note structure changes:

  1. Run diff to see current state: schema_diff(note_type="Meeting")
  2. Update the schema note via edit_note with the metadata parameter. Top-level keys are replaced whole, so pass the complete updated schema map along with the new version:
    python
    edit_note(
      identifier="schema/Meeting",
      operation="append",
      content="",
      metadata={
        "version": 2,
        "schema": {
          "topic": "string, what was discussed",
          "date": "string, when it happened",
          "attendees?(array)": "Person, who attended",
          "decisions?(array)": "string, decisions made",
          "location?": "string, where it happened"
        }
      }
    )
  3. Re-validate to confirm existing notes still pass: schema_validate(note_type="Meeting")
  4. Fix outliers — update notes that don't conform to the new schema
Evolution Guidelines
  • Additive changes (new optional fields) are safe — no version bump needed
  • Breaking changes (new required fields, removed fields, type changes) should bump version
  • Prefer optional over required — most fields should be optional to start
  • Don't over-constrain — schemas should describe common structure, not enforce rigid templates
  • Schema as documentation — even if validation is set to warn, the schema serves as living documentation for what notes of that type should contain

Workflow Summary

1. Notice repeated note structure → infer schema (schema_infer)
2. Review + create schema note   → write to schema/ (write_note)
3. Validate existing notes       → check conformance (schema_validate)
4. Fix outliers                  → edit non-conforming notes (edit_note)
5. Periodically check drift      → detect divergence (schema_diff)
6. Evolve schema as needed       → update schema note (edit_note)

© basicmachines-co, AGPL-3.0. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in skills/memory-schema of basicmachines-co/basic-memory.

Open the folder on GitHubat commit 6982cfc

Used in 1 other repository

We found 1 copy of this SKILL.md (exact, near-identical or edited) in other folders, from 1 other GitHub owner. This page covers the copy in basicmachines-co/basic-memory, which our catalogue first saw on October 7, 2026.

Compare with similar skills

Memory Schema 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.

Memory Schema compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Memory Schema this skillbasicmachines-co/basic-memory4.1k1 repos~2kAutomated safety check: PassAGPL-3.0
LLM Wiki Knowledge GraphEgonex-AI/Understand-Anything85k1 repos~1.5kAutomated safety check: PassMIT
Obsidian Canvas BoardsAgriciDaniel/claude-obsidian15k—~1.4kAutomated safety check: PassMIT
Ontology1mancompany/OneManCompany4382 repos~1.5kAutomated safety check: PassApache-2.0
Graphagenticnotetaking/arscontexta3.5k1 repos~4.9kAutomated safety check: NotesMIT
Knowledge Graphgnomeria/usbtree688—~1.5kAutomated safety check: PassMIT

Similar skills

  • LLM Wiki Knowledge Graph

    Egonex-AI/Understand-Anything

    Detects a Karpathy-pattern LLM wiki and builds an interactive knowledge graph with entities, implicit relationships and topic clusters.

    85k GitHub starsUsed in 1 repo~1.5k tokens
    Knowledge ManagementAuto-check passed
  • Obsidian Canvas Boards

    AgriciDaniel/claude-obsidian

    Creates, inspects and updates Obsidian JSON Canvas boards in a vault, with text, file, link, group and edge nodes, using safe recoverable edits.

    15k GitHub stars~1.4k tokensUpdated 26 days ago
    Knowledge ManagementAuto-check passed
  • Ontology

    1mancompany/OneManCompany

    Typed knowledge graph for structured agent memory and composable skills.

    438 GitHub starsUsed in 2 repos~1.5k tokens
    Knowledge ManagementAuto-check passed
  • Graph

    agenticnotetaking/arscontexta

    Interactive knowledge graph analysis. An agent skill from agenticnotetaking/arscontexta.

    3.5k GitHub starsUsed in 1 repo~4.9k tokens
    Knowledge ManagementAuto-check: notes
  • Knowledge Graph

    gnomeria/usbtree

    Set up and maintain a lightweight, file-based knowledge graph of the repo — entities, typed relations, decisions, gotchas — so agents load context fast instead of re-exploring the codebase every…

    688 GitHub stars~1.5k tokensUpdated 1 mo ago
    Knowledge ManagementAuto-check passed
  • Knowledge Graph

    nimbalyst/nimbalyst

    Write a project's knowledge pages in Nimbalyst Pages -- record what people said and decided in the page it affects, keep typed pages for the things the team tracks (its own types, such as modules…

    1.8k GitHub stars~3.5k tokensUpdated yesterday
    Knowledge ManagementAuto-check passed

More from basicmachines-co/basic-memory

All 49 skills in this repo
  • cmux Settings Editor

    basicmachines-co/basic-memory

    Views, sets, unsets and validates cmux settings in ~/.config/cmux/cmux.json with a helper script that checks keys against the schema.

    4.1k GitHub starsUsed in 1 repo~1.3k tokens
    Auto-check passed
  • cmux Window and Pane Control

    basicmachines-co/basic-memory

    End-user control of cmux topology and routing (windows, workspaces, panes/surfaces, focus, moves, reorder, identify, trigger flash). Use when automation needs…

    4.1k GitHub starsUsed in 2 repos~842 tokens
    Auto-check passed
  • Cmux Markdown Viewer Panel

    basicmachines-co/basic-memory

    Opens markdown files in a formatted cmux panel beside the terminal that re-renders on every change, handy for plans and task lists.

    4.1k GitHub starsUsed in 2 repos~527 tokens
    Auto-check passed
  • cmux Workspace Scoping

    basicmachines-co/basic-memory

    Keeps agent actions scoped to the cmux workspace and terminal that invoked it, and lays out pane and surface commands that avoid disrupting the user's own focus.

    4.1k GitHub starsUsed in 2 repos~1.7k tokens
    Auto-check passed
  • Basic Memory Repo Images

    basicmachines-co/basic-memory

    Produces PR, changelog and two-week retro images for the Basic Memory repository from evidence in PR bodies, saved to fixed paths under docs/assets/infographics.

    4.1k GitHub stars~2.7k tokensUpdated today
    Auto-check passed
  • Logfire Instrumentation

    basicmachines-co/basic-memory

    Adds Pydantic Logfire tracing, logging and metrics to Python, JavaScript or TypeScript and Rust projects, with the correct setup order and library extras.

    4.1k GitHub stars~2.3k tokensUpdated today
    Auto-check passed

Questions about Memory Schema

What does Memory Schema do?

Schema lifecycle management for Basic Memory: discover unschemaed notes, infer schemas, create and edit schema definitions, validate notes, and detect drift. Memory Schema is an agent skill from basicmachines-co/basic-memory. Schema lifecycle management for Basic Memory: discover unschemaed notes, infer schemas, create and edit schema definitions, validate notes, and detect drift.

When should I use Memory Schema?

Memory Schema fits situations like: working with structured note types (Task; etc.) to maintain consistency across the knowledge graph.

How do I install Memory Schema in Claude Code?

Run `npx skills add basicmachines-co/basic-memory --skill memory-schema -a claude-code`. Or copy the skill folder (skills/memory-schema in basicmachines-co/basic-memory) into .claude/skills/memory-schema in your project. Claude Code loads it when a task matches its description.

How do I install Memory Schema in Codex?

Run `npx skills add basicmachines-co/basic-memory --skill memory-schema -a codex`. Or copy the skill folder (skills/memory-schema in basicmachines-co/basic-memory) into .agents/skills/memory-schema in your project. Codex loads it when a task matches its description.

Can I use Memory Schema in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add basicmachines-co/basic-memory --skill memory-schema -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/memory-schema, .gemini/skills/memory-schema, .github/skills/memory-schema and .opencode/skills/memory-schema in your project.

What does Memory Schema need to run?

SKILL.md names no scripts, command-line tools or credentials: Memory Schema is instructions for the agent only. Our summary lists: Python 3.

Does Memory Schema access the network?

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.

Is Memory Schema safe to install?

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.

What licence does Memory Schema use?

Memory Schema is published under the AGPL-3.0 licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Memory Schema use?

About 2k tokens (SKILL.md is roughly 8.1k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Memory Schema?

Skills that share tags, products or a category with Memory Schema: LLM Wiki Knowledge Graph (Egonex-AI/Understand-Anything, 85k stars), Obsidian Canvas Boards (AgriciDaniel/claude-obsidian, 15k stars), Ontology (1mancompany/OneManCompany, 438 stars) and Graph (agenticnotetaking/arscontexta, 3.5k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Memory Schema?

basicmachines-co (a GitHub organization) maintains it in basicmachines-co/basic-memory, which has 4,107 GitHub stars. The repository holds 49 skills in this directory. The repository was last updated on October 7, 2026.

Source: basicmachines-co/basic-memory on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.