Loading...
Loading...
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.
npx skill4agent add basicmachines-co/basic-memory-skills memory-schemaschema:
name: string, person's full name
age: integer, age in years
score: number, floating-point rating
active: boolean, whether currently activestringintegernumberboolean?schema:
title: string, required field
subtitle?: string, optional field(enum)schema:
status(enum): [active, blocked, done, abandoned], current stateschema:
priority?(enum): [low, medium, high, critical], task priority(array)schema:
tags(array): string, categorization labels
steps?(array): string, ordered steps to completeschema:
parent_task?: Task, parent task if this is a subtask
attendees?(array): Person, people who attendedsettings:
validation: warn # warn (log issues) or error (strict)---
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): [scheduled, completed, cancelled], meeting state
settings:
validation: warn
---search_notes(query="type:Meeting")typeschema/Meeting.mdschema_inferschema_infer(noteType="Meeting")
schema_infer(noteType="Meeting", threshold=0.5) # fields in 50%+ of notesschema/<EntityName>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"""
)schema/note_type="schema"entity: Meetingversion: 1settings.validation: warn# Validate all notes of a type
schema_validate(noteType="Meeting")
# Validate a single note
schema_validate(identifier="meetings/2026-02-10-standup")schema_validatestatus- [status] activewarnerrorschema_diffschema_diff(noteType="Meeting")schema_diff(noteType="Meeting")edit_noteedit_note(
identifier="schema/Meeting",
operation="find_replace",
find_text="version: 1",
content="version: 2",
expected_replacements=1
)schema:schema_validate(noteType="Meeting")versionwarn1. 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)