basic-memory-pi-setup
Set up Basic Memory for a Pi workspace. Use when Basic Memory is not configured, /bm-status…
Analyze a complete literary work into a structured Basic Memory knowledge graph. Covers schema design, entity seeding, chapter-by-chapter processing, cross-referencing, validation, and graph exploration.
$ npx -y skills add basicmachines-co/basic-memory --skill memory-literary-analysis --agent claude-codeHow it fires
How this skill gets triggered: by you, by Claude, or both.
/memory-literary-analysisContext preview
The summary Claude sees to decide when to auto-load this skill.
Analyze a complete literary work into a structured Basic Memory knowledge graph. Covers schema design, entity seeding, chapter-by-chapter processing, cross-referencing, validation, and graph exploration.
name: memory-literary-analysis description: "Analyze a complete literary work into a structured Basic Memory knowledge graph. Covers schema design, entity seeding, chapter-by-chapter processing, cross-referencing, validation, and graph exploration."
Transform a complete literary work into a structured knowledge graph. Characters, themes, chapters, locations, symbols, and literary devices become interconnected notes — searchable, validatable, and traversable.
Phase 0: Setup → project, schemas, directory structure Phase 1: Seed → stub notes for known major entities Phase 2: Process → chapter-by-chapter notes in batches Phase 3: Cross-ref → enrich arcs, add parallels, write analysis Phase 4: Validate → schema checks, drift detection, consistency Phase 5: Explore → traverse the graph, write synthesis notes
Writing always goes through `write_note` and `edit_note`. For *reading* — which is most of the work in a long analysis — prefer the POSIX read verbs where they are available (`enable_posix_tools` for the MCP tools; the `bm` CLI verbs are always available):
| Need | Use | Instead of | |------|-----|-----------| | A section of a long note | `cat <note> --section Observations` | reading the whole note | | A line range of the source text | `cat <source>.txt --lines 4200-4890` | pulling the whole book into context | | Notes matching frontmatter | `find --meta status=active` | reading notes to check fields | | Fields across many notes | `find --meta ... --fields pov,setting` | one read per note | | Where something lives | `ls`, `tree`, `find --name '*.md'` | listing everything |
The two rules that matter across a 100+ chapter run:
projection are for — one call answers what a read-per-note loop would cost.
slice the *output*: the full note is still fetched, then cut down before it is returned. What they save is context, not I/O — a long chapter or a full source text costs you the tokens of the relevant part, not of the whole file.
Two sharp edges to know before you write a query. The first fails *quietly* — a short answer, exit 0, no warning — so learn it here rather than from a graph you thought you had audited:
needs `--page-size 200` (the maximum) — see [Coverage Checks](#coverage-checks).
`--meta` query with the positional path instead: `find /characters --meta 'note_type=character'`. That path is matched on a directory boundary against the *file path* a note is indexed under — where the note actually lives, not its permalink, which stops mirroring the file path once a note pins `permalink:` in frontmatter or is moved. So `/characters` reaches everything filed under `characters/` (including `characters/major/`), and never `characters-cut/`.
If the POSIX verbs are unavailable, every step below still works with `search_notes`, `read_note`, and `list_directory` — it just costs more.
create_memory_project(project_name="<work-name>", project_path="~/basic-memory/<work-name>")
Use a kebab-case slug of the work's title (e.g., `great-gatsby`, `hamlet`, `beloved`).
Write 6 schema notes to `schema/`. Each schema defines the entity type's fields, observation categories, and relation types. Adapt fields to fit the work — the schemas below are starting points, not rigid templates.
write_note(
title="Character",
directory="schema",
note_type="schema",
metadata={
"entity": "Character",
"version": 1,
"schema": {
"role(enum)": "[protagonist, antagonist, supporting, minor], character's narrative role",
"description": "string, brief character description",
"first_appearance?": "string, chapter or scene of first appearance",
"status?(enum)": "[alive, dead, unknown, transformed], character status at end of work"
},
"settings": {"validation": "warn"}
},
content="""# Character
Schema for character entity notes.
## Observations
- [convention] Major characters in characters/major/, minor in characters/minor/
- [convention] Observation categories: trait, motivation, arc, quote, appearance, relationship, symbolism, fate
- [convention] Relations: appears_in, contrasts_with, allied_with, commands, symbolizes, associated_with"""
)Add work-specific fields as needed — e.g., `rank` for military fiction, `house` for family sagas, `species` for fantasy.
write_note(
title="Theme",
directory="schema",
note_type="schema",
metadata={
"entity": "Theme",
"version": 1,
"schema": {
"description": "string, what this theme explores",
"prevalence(enum)": "[major, minor], how central to the work",
"first_introduced?": "string, where theme first appears"
},
"settings": {"validation": "warn"}
},
content="""# Theme
Schema for thematic analysis notes.
## Observations
- [convention] Observation categories: definition, manifestation, evolution, counterpoint, quote, interpretation
- [convention] Relations: embodied_by, contrasts_with, reinforced_by, explored_in, expressed_through"""
)write_note( title="Chapter", directory="schema", note
AI conversations that actually remember. Never re-explain your project to your AI again. Join our Discord: https://discord.gg/tyvKNccgqN
Repo: basicmachines-co/basic-memory
Set up Basic Memory for a Pi workspace. Use when Basic Memory is not configured, /bm-status…
Use Basic Memory from Pi for durable continuity. Capture checkpoints with bm_capture, recall…
Guide Basic Memory setup in Tau. Use when a user wants to install or configure the Tau memory…
Save a deliberate work checkpoint to Basic Memory with the story, changed files,…
Capture a durable engineering decision in Basic Memory with rationale, alternatives,…
Orient Claude from Basic Memory before substantial repo work by reading active tasks, open…