Memory Literary Analysis
Transform a complete literary work into a structured knowledge graph. Characters, themes, chapters, locations, symbols, and literary devices become interconnected notes — searchable, validatable, and visualizable.
When to Use
- Analyzing a novel, play, poem, or non-fiction book end-to-end
- Building a teaching or study resource for a literary text
- Creating a book club companion knowledge base
- Research projects requiring structured close reading
- Stress-testing Basic Memory at scale (~200+ notes, 1000+ relations)
Pipeline Overview
Phase 0: Setup
Create the Project
Use a kebab-case slug of the work's title (e.g., great-gatsby, hamlet, beloved).
Define Schemas
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.
Character Schema
Add work-specific fields as needed — e.g., rank for military fiction, house for family sagas, species for fantasy.
Theme Schema
Chapter Schema
Location Schema
Symbol Schema
LiteraryDevice Schema
Directory Structure
Phase 1: Seed Entities
Before processing chapters, create stub notes for major entities so [[wiki-links]] resolve from the start.
Characters (major)
For each major character, create a stub with known metadata:
Seed Checklist
Identify the work's major entities before you start reading. A good starting inventory:
Stubs don't need to be complete — they give [[wiki-link]] targets and will be enriched during chapter processing.
Phase 2: Chapter Processing
Source Text Preparation
Obtain the full text and identify chapter/section boundaries. For public domain works, Project Gutenberg is a good source. For copyrighted works, work from a physical or licensed digital copy.
Batching Strategy
Process ~10 chapters per batch to balance depth with progress. Group by narrative arc or thematic focus:
Adjust batch size based on chapter length and density. Short, action-heavy chapters can be batched in larger groups; long, philosophically dense chapters may need smaller batches.
Per-Chapter Workflow
For each chapter:
1. Read the chapter carefully. If working from a source text file, read the relevant section.
2. Create the chapter note:
3. Enrich related entities:
4. Track progress using the memory-tasks skill to create a processing task that survives context compaction.
What to Capture Per Chapter
Entity Enrichment Per Chapter
As each chapter is processed, append observations to relevant entities:
- Characters:
[arc]moments, new[trait]revelations,[quote]attributions - Themes:
[manifestation]in this chapter,[evolution]shifts - Symbols:
[appearance]with context, new[interpretation]angles - Locations:
[atmosphere]as described,[significance]in scene - Literary devices:
[example]from this chapter
Adding Prose and Interpretation
After the structured observations are in place, consider adding interpretive prose to major entity notes. Prepend 2-4 paragraphs of critical essay before the Observations section using edit_note(operation="prepend"). This prose should:
- Argue for a reading of the character, theme, or symbol — not just describe it
- Connect the entity to the work's larger concerns and to literary tradition
- Include subjective opinions clearly marked as such ("In my reading...", "I find...")
- Ground claims in textual evidence cited by chapter number
The prose adds the interpretive texture that structured observations alone cannot capture.
Phase 3: Cross-Referencing
After all chapters are processed:
Character Arcs
For each major character, write a full [arc] summary observation covering their trajectory across the work.
Theme Evolution
For each theme, add [evolution] observations tracing how it develops from introduction to resolution.
Chapter Parallels
Add parallels and contrasts_with relations between structurally similar chapters (e.g., mirrored scenes, repeated settings, thematic echoes).
Analysis Notes
Create synthesis notes in analysis/:
Recommended analysis notes:
- Narrative Structure — overall architecture and pacing
- Work Overview — synthesis of the complete work (summary, thesis, legacy)
- Critical Reception — historical and contemporary interpretations
Discover Emergent Entities
During chapter processing, new minor characters, locations, and symbols will emerge. Create notes for any that appear in 3+ chapters or carry thematic weight.
Phase 4: Validation
Schema Validation
Drift Detection
Fix issues found — common fixes:
- Missing required observation categories → add them via
edit_note - Enum values outside allowed set → correct metadata
- Fields in notes but not schema → add as optional to schema if legitimate
Relation Consistency
Spot-check bidirectional relations: if Chapter X features [[Character]], does Character have observations referencing Chapter X? Fix gaps.
Phase 5: Visualization
Generate canvas files for visual exploration:
Adapting to Other Genres
This pipeline works for any literary text. Adjust schemas for genre:
Scaling Guidance
Related Skills
- memory-schema — Schema creation, validation, and drift detection
- memory-tasks — Track chapter processing progress across context compaction
- memory-notes — Note writing patterns, observation categories, wiki-links
- memory-ingest — Processing external input into structured entities
- memory-metadata-search — Querying notes by frontmatter fields
- memory-lifecycle — Archiving completed analysis phases
Guidelines
- Seed before processing. Create entity stubs first so wiki-links resolve immediately during chapter processing.
- Batch for sanity. Processing ~10 chapters at a time balances depth with momentum. Track progress with a Task note.
- Read the source text. Don't rely on memory or summaries. Read (or re-read) the actual text for each batch before creating notes. Textual evidence is everything.
- Observations are your index. The knowledge graph's value comes from categorized observations. Be generous with categories and specific with content.
- Relations are your web. Every chapter should link to characters, themes, locations, and devices. Every entity should link back to chapters where it appears.
- Enrich iteratively. Entity notes grow richer with each chapter. Don't try to write the perfect character note upfront — append as you go.
- Add prose for depth. After structured data is in place, add interpretive essays to major notes. The prose captures what observations cannot: argument, nuance, opinion, and voice.
- Validate periodically. Run
schema_validateafter each batch, not just at the end. Catch drift early. - Quote generously. Literary analysis lives on textual evidence. Include significant quotes as
[quote]observations with chapter attribution. - Review and revise. After completing all chapters, review the full graph from an external perspective. Look for thin notes, missing connections, and gaps in coverage. The first pass is never the last.
- Analysis comes last. Synthesis notes in
analysis/should be written after all chapters are processed, when you have the full picture.

