memory-literary-analysis

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Memory Literary Analysis

基于Basic Memory的文学分析

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)
  • 对小说、戏剧、诗歌或纪实作品进行全面分析
  • 为文学文本构建教学或学习资源
  • 创建读书俱乐部配套知识库
  • 需要结构化细读的研究项目
  • 大规模测试Basic Memory的性能(约200+条笔记、1000+条关系)

Pipeline Overview

流程概览

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: Visualize     → canvas files for character webs, timelines
阶段0:准备工作         → 项目、schema、目录结构
阶段1:实体初始化       → 已知主要实体的占位笔记
阶段2:逐章处理         → 批量处理章节笔记
阶段3:交叉引用         → 丰富关系、添加关联、撰写分析
阶段4:验证             → schema检查、偏差检测、一致性校验
阶段5:可视化           → 生成人物关系网、时间线等画布文件

Phase 0: Setup

阶段0:准备工作

Create the Project

创建项目

python
create_memory_project(name="<work-name>", path="~/basic-memory/<work-name>")
Use a kebab-case slug of the work's title (e.g.,
great-gatsby
,
hamlet
,
beloved
).
python
create_memory_project(name="<work-name>", path="~/basic-memory/<work-name>")
使用作品标题的短横线分隔格式(例如
great-gatsby
hamlet
beloved
)。

Define Schemas

定义Schema

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.
schema/
目录下编写6个schema笔记。每个schema定义了实体类型的字段、观察类别和关系类型。可根据作品调整字段——以下schema是起点,而非严格模板。

Character Schema

人物Schema

python
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.
python
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

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.
  • [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""" )

可根据作品添加特定字段——例如,军事小说添加`rank`,家族传奇添加`house`,奇幻作品添加`species`。

Theme Schema

主题Schema

python
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.
python
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

Observations

  • [convention] Observation categories: definition, manifestation, evolution, counterpoint, quote, interpretation
  • [convention] Relations: embodied_by, contrasts_with, reinforced_by, explored_in, expressed_through""" )
undefined
  • [convention] Observation categories: definition, manifestation, evolution, counterpoint, quote, interpretation
  • [convention] Relations: embodied_by, contrasts_with, reinforced_by, explored_in, expressed_through""" )
undefined

Chapter Schema

章节Schema

python
write_note(
  title="Chapter",
  directory="schema",
  note_type="schema",
  metadata={
    "entity": "Chapter",
    "version": 1,
    "schema": {
      "chapter_number": "integer, sequential chapter number",
      "pov?": "string, point-of-view character or narrator mode",
      "setting?": "string, primary location",
      "narrative_mode?(enum)": "[dramatic, expository, reflective, epistolary, mixed], chapter's primary mode"
    },
    "settings": {"validation": "warn"}
  },
  content="""# Chapter

Schema for chapter-level analysis notes.
python
write_note(
  title="Chapter",
  directory="schema",
  note_type="schema",
  metadata={
    "entity": "Chapter",
    "version": 1,
    "schema": {
      "chapter_number": "integer, sequential chapter number",
      "pov?": "string, point-of-view character or narrator mode",
      "setting?": "string, primary location",
      "narrative_mode?(enum)": "[dramatic, expository, reflective, epistolary, mixed], chapter's primary mode"
    },
    "settings": {"validation": "warn"}
  },
  content="""# Chapter

Schema for chapter-level analysis notes.

Observations

Observations

  • [convention] Chapters stored in chapters/ directory
  • [convention] Observation categories: summary, event, tone, technique, quote, significance, foreshadowing
  • [convention] Relations: features, set_in, explores, contains, employs, follows, precedes, parallels""" )
undefined
  • [convention] Chapters stored in chapters/ directory
  • [convention] Observation categories: summary, event, tone, technique, quote, significance, foreshadowing
  • [convention] Relations: features, set_in, explores, contains, employs, follows, precedes, parallels""" )
undefined

Location Schema

地点Schema

python
write_note(
  title="Location",
  directory="schema",
  note_type="schema",
  metadata={
    "entity": "Location",
    "version": 1,
    "schema": {
      "description": "string, what this place is",
      "location_type(enum)": "[city, building, landscape, body_of_water, region, fictional, vehicle], type of place",
      "real_or_fictional(enum)": "[real, fictional, both], whether the place exists"
    },
    "settings": {"validation": "warn"}
  },
  content="""# Location

Schema for location and setting notes.
python
write_note(
  title="Location",
  directory="schema",
  note_type="schema",
  metadata={
    "entity": "Location",
    "version": 1,
    "schema": {
      "description": "string, what this place is",
      "location_type(enum)": "[city, building, landscape, body_of_water, region, fictional, vehicle], type of place",
      "real_or_fictional(enum)": "[real, fictional, both], whether the place exists"
    },
    "settings": {"validation": "warn"}
  },
  content="""# Location

Schema for location and setting notes.

Observations

Observations

  • [convention] Observation categories: description, atmosphere, symbolism, significance, geography
  • [convention] Relations: setting_for, associated_with, symbolizes, contains, part_of""" )
undefined
  • [convention] Observation categories: description, atmosphere, symbolism, significance, geography
  • [convention] Relations: setting_for, associated_with, symbolizes, contains, part_of""" )
undefined

Symbol Schema

象征符号Schema

python
write_note(
  title="Symbol",
  directory="schema",
  note_type="schema",
  metadata={
    "entity": "Symbol",
    "version": 1,
    "schema": {
      "description": "string, what the symbol is literally",
      "symbol_type(enum)": "[object, animal, color, action, natural_phenomenon, body_part], category of symbol",
      "primary_meaning": "string, most common interpretation"
    },
    "settings": {"validation": "warn"}
  },
  content="""# Symbol

Schema for symbolic element notes.
python
write_note(
  title="Symbol",
  directory="schema",
  note_type="schema",
  metadata={
    "entity": "Symbol",
    "version": 1,
    "schema": {
      "description": "string, what the symbol is literally",
      "symbol_type(enum)": "[object, animal, color, action, natural_phenomenon, body_part], category of symbol",
      "primary_meaning": "string, most common interpretation"
    },
    "settings": {"validation": "warn"}
  },
  content="""# Symbol

Schema for symbolic element notes.

Observations

Observations

  • [convention] Observation categories: meaning, appearance, ambiguity, interpretation, quote, evolution
  • [convention] Relations: represents, associated_with, appears_in, contrasts_with, located_at""" )
undefined
  • [convention] Observation categories: meaning, appearance, ambiguity, interpretation, quote, evolution
  • [convention] Relations: represents, associated_with, appears_in, contrasts_with, located_at""" )
undefined

LiteraryDevice Schema

文学手法Schema

python
write_note(
  title="LiteraryDevice",
  directory="schema",
  note_type="schema",
  metadata={
    "entity": "LiteraryDevice",
    "version": 1,
    "schema": {
      "description": "string, what the device is",
      "device_type(enum)": "[rhetorical, structural, figurative, narrative, dramatic], category",
      "frequency(enum)": "[pervasive, frequent, occasional, rare], how often used"
    },
    "settings": {"validation": "warn"}
  },
  content="""# LiteraryDevice

Schema for literary technique and device notes.
python
write_note(
  title="LiteraryDevice",
  directory="schema",
  note_type="schema",
  metadata={
    "entity": "LiteraryDevice",
    "version": 1,
    "schema": {
      "description": "string, what the device is",
      "device_type(enum)": "[rhetorical, structural, figurative, narrative, dramatic], category",
      "frequency(enum)": "[pervasive, frequent, occasional, rare], how often used"
    },
    "settings": {"validation": "warn"}
  },
  content="""# LiteraryDevice

Schema for literary technique and device notes.

Observations

Observations

  • [convention] Observation categories: definition, usage, effect, example, significance
  • [convention] Relations: used_in, characterizes, expresses, related_to""" )
undefined
  • [convention] Observation categories: definition, usage, effect, example, significance
  • [convention] Relations: used_in, characterizes, expresses, related_to""" )
undefined

Directory Structure

目录结构

<project>/
  schema/            # 6 schema definitions
  chapters/          # one note per chapter/section + prologue/epilogue
  characters/
    major/           # protagonist, antagonist, key supporting
    minor/           # named characters with limited roles
  themes/            # thematic analysis notes
  locations/         # settings and places
  symbols/           # symbolic elements
  literary-devices/  # techniques and devices
  analysis/          # cross-cutting synthesis
  tasks/             # processing tracker
<project>/
  schema/            # 6个schema定义
  chapters/          # 每个章节/部分对应一个笔记,含序章和终章
  characters/
    major/           # 主角、反派、关键配角
    minor/           # 有名字但戏份有限的角色
  themes/            # 主题分析笔记
  locations/         # 场景和地点
  symbols/           # 象征元素
  literary-devices/  # 文学手法和技巧
  analysis/          # 跨维度综合分析
  tasks/             # 进度跟踪

Phase 1: Seed Entities

阶段1:实体初始化

Before processing chapters, create stub notes for major entities so
[[wiki-links]]
resolve from the start.
在处理章节之前,先为主要实体创建占位笔记,确保
[[wiki-links]]
从一开始就能正常解析。

Characters (major)

主要人物

For each major character, create a stub with known metadata:
python
write_note(
  title="<Character Name>",
  directory="characters/major",
  note_type="Character",
  tags=["character", "major", "<role>"],
  metadata={"role": "<role>", "description": "<brief description>"},
  content="""# <Character Name>
为每个主要人物创建包含已知元数据的占位笔记:
python
write_note(
  title="<Character Name>",
  directory="characters/major",
  note_type="Character",
  tags=["character", "major", "<role>"],
  metadata={"role": "<role>", "description": "<brief description>"},
  content="""# <Character Name>

Observations

Observations

  • [role] <Character's role in the work>
  • [appearance] <Key physical description>
  • [role] <Character's role in the work>
  • [appearance] <Key physical description>

Relations

Relations

  • associated_with [[<Related Character>]]
  • appears_in [[<Key Location>]]""" )
undefined
  • associated_with [[<Related Character>]]
  • appears_in [[<Key Location>]]""" )
undefined

Seed Checklist

初始化检查清单

Identify the work's major entities before you start reading. A good starting inventory:
TypeTypical CountWhat to Include
Characters (major)8-20Protagonist, antagonist, key supporting cast
Themes5-12Central concerns the work explores
Locations4-10Primary settings, symbolically significant places
Symbols4-10Recurring objects, images, or motifs with layered meaning
Stubs don't need to be complete — they give
[[wiki-link]]
targets and will be enriched during chapter processing.
在开始阅读前确定作品的主要实体。以下是初始参考数量:
类型典型数量包含内容
主要人物8-20主角、反派、核心配角
主题5-12作品探讨的核心议题
地点4-10主要场景、具有象征意义的地点
象征符号4-10反复出现的物体、图像或具有多层含义的母题
占位笔记无需完整——它们为
[[wiki-link]]
提供目标,并会在章节处理过程中逐步丰富。

Phase 2: Chapter Processing

阶段2:逐章处理

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.
获取完整文本并确定章节/部分边界。公共领域作品可从Project Gutenberg获取;受版权保护的作品请使用实体书或授权数字版本。

Batching Strategy

批量处理策略

Process ~10 chapters per batch to balance depth with progress. Group by narrative arc or thematic focus:
BatchTypical Content
1Opening: setting, character introductions, world-building
2-3Rising action: conflicts established, relationships develop
4-6Middle: complications, turning points, thematic deepening
7-8Climax approach: escalation, revelations, crises
FinalClimax, resolution, epilogue
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.
每次处理约10章,平衡深度与进度。可按叙事弧或主题聚焦分组:
批次典型内容
1开篇:场景设定、人物介绍、世界观构建
2-3上升情节:冲突确立、关系发展
4-6中期:矛盾复杂化、转折点、主题深化
7-8临近高潮:冲突升级、真相揭露、危机爆发
最终批次高潮、结局、尾声
可根据章节长度和密度调整批次大小。短而动作密集的章节可批量处理更多;长而哲学性强的章节可能需要更小的批次。

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:
python
write_note(
  title="Chapter <N> - <Title>",
  directory="chapters",
  note_type="Chapter",
  tags=["chapter", "<arc-phase>"],
  metadata={
    "chapter_number": <N>,
    "pov": "<narrator or POV character>",
    "setting": "<primary location>",
    "narrative_mode": "<mode>"
  },
  content="""# Chapter <N> - <Title>
对每个章节执行以下步骤:
1. 仔细阅读章节。如果使用源文本文件,请阅读对应部分。
2. 创建章节笔记:
python
write_note(
  title="Chapter <N> - <Title>",
  directory="chapters",
  note_type="Chapter",
  tags=["chapter", "<arc-phase>"],
  metadata={
    "chapter_number": <N>,
    "pov": "<narrator or POV character>",
    "setting": "<primary location>",
    "narrative_mode": "<mode>"
  },
  content="""# Chapter <N> - <Title>

Observations

Observations

  • [summary] <1-2 sentence synopsis>
  • [event] <Key plot events>
  • [tone] <Emotional and stylistic atmosphere>
  • [technique] <Notable narrative techniques>
  • [quote] "<Significant passage>"
  • [significance] <Why this chapter matters to the whole>
  • [foreshadowing] <Hints at future events>
  • [summary] <1-2 sentence synopsis>
  • [event] <Key plot events>
  • [tone] <Emotional and stylistic atmosphere>
  • [technique] <Notable narrative techniques>
  • [quote] "<Significant passage>"
  • [significance] <Why this chapter matters to the whole>
  • [foreshadowing] <Hints at future events>

Relations

Relations

  • features [[<Character>]]
  • set_in [[<Location>]]
  • explores [[<Theme>]]
  • contains [[<Symbol>]]
  • employs [[<Literary Device>]]
  • follows [[Chapter <N-1> - <Previous Title>]]
  • precedes [[Chapter <N+1> - <Next Title>]]""" )

**3. Enrich related entities:**

```python
edit_note(
  identifier="characters/major/<character-slug>",
  operation="append",
  heading="Observations",
  content="""- [arc] Ch.<N>: <What happens to this character>
- [quote] "<Attributed quote>" (Ch.<N>)"""
)
4. Track progress using the memory-tasks skill to create a processing task that survives context compaction.
  • features [[<Character>]]
  • set_in [[<Location>]]
  • explores [[<Theme>]]
  • contains [[<Symbol>]]
  • employs [[<Literary Device>]]
  • follows [[Chapter <N-1> - <Previous Title>]]
  • precedes [[Chapter <N+1> - <Next Title>]]""" )

**3. 丰富相关实体:**

```python
edit_note(
  identifier="characters/major/<character-slug>",
  operation="append",
  heading="Observations",
  content="""- [arc] Ch.<N>: <What happens to this character>
- [quote] "<Attributed quote>" (Ch.<N>)"""
)
4. 跟踪进度:使用memory-tasks技能创建处理任务,确保进度在上下文压缩后仍能保留。

What to Capture Per Chapter

单章需捕获的内容

CategoryWhat to Look For
[summary]
1-2 sentence chapter synopsis
[event]
Key plot events (actions, revelations, arrivals)
[tone]
Emotional and stylistic atmosphere
[technique]
Narrative innovations (POV shifts, structural experiments, genre blending)
[quote]
Memorable or thematically significant passages
[significance]
Why this chapter matters to the whole
[foreshadowing]
Hints at future events
类别关注要点
[summary]
1-2句章节概要
[event]
关键情节事件(动作、真相揭露、人物登场)
[tone]
情感与文体氛围
[technique]
叙事创新(视角转换、结构实验、类型融合)
[quote]
难忘或具有主题意义的段落
[significance]
该章节对整体作品的重要性
[foreshadowing]
对未来事件的暗示

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
处理每个章节时,将观察内容追加到相关实体:
  • 人物
    [arc]
    时刻、新发现的
    [trait]
    [quote]
    归属
  • 主题:该章节中的
    [manifestation]
    [evolution]
    变化
  • 象征符号:带上下文的
    [appearance]
    、新的
    [interpretation]
    角度
  • 地点:描述中的
    [atmosphere]
    、场景中的
    [significance]
  • 文学手法:该章节中的
    [example]

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.
完成结构化观察后,可考虑为主要实体笔记添加解读性散文。使用
edit_note(operation="prepend")
在Observations部分前添加2-4段评论性文章。这些散文应:
  • 对人物、主题或象征符号提出独特解读,而非仅描述
  • 将实体与作品的核心议题及文学传统联系起来
  • 明确标记主观观点(例如“在我看来……”、“我认为……”)
  • 引用章节编号作为文本证据
散文能捕捉结构化观察无法涵盖的内容:论点、细微差别、观点和个人风格。

Phase 3: Cross-Referencing

阶段3:交叉引用

After all chapters are processed:
完成所有章节处理后:

Character Arcs

人物弧光

For each major character, write a full
[arc]
summary observation covering their trajectory across the work.
为每个主要人物撰写完整的
[arc]
总结观察,涵盖其在作品中的完整轨迹。

Theme Evolution

主题演变

For each theme, add
[evolution]
observations tracing how it develops from introduction to resolution.
为每个主题添加
[evolution]
观察,追踪其从出现到结局的发展过程。

Chapter Parallels

章节关联

Add
parallels
and
contrasts_with
relations between structurally similar chapters (e.g., mirrored scenes, repeated settings, thematic echoes).
在结构相似的章节之间添加
parallels
contrasts_with
关系(例如,镜像场景、重复设定、主题呼应)。

Analysis Notes

分析笔记

Create synthesis notes in
analysis/
:
python
write_note(
  title="Narrative Structure",
  directory="analysis",
  note_type="note",
  tags=["analysis", "structure"],
  content="""# Narrative Structure

Analysis of the work's narrative architecture.
analysis/
目录下创建综合分析笔记:
python
write_note(
  title="Narrative Structure",
  directory="analysis",
  note_type="note",
  tags=["analysis", "structure"],
  content="""# Narrative Structure

Analysis of the work's narrative architecture.

Observations

Observations

  • [structure] <Overall arc description>
  • [technique] <Key narrative strategies> ...
  • [structure] <Overall arc description>
  • [technique] <Key narrative strategies> ...

Relations

Relations

  • analyzes [[<Protagonist>]]
  • analyzes [[<Key Character>]]
  • explores [[<Central Theme>]] ...""" )

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
  • analyzes [[<Protagonist>]]
  • analyzes [[<Key Character>]]
  • explores [[<Central Theme>]] ...""" )

推荐创建的分析笔记:
- **叙事结构**——整体架构与节奏
- **作品概述**——完整作品的综合总结(概要、核心论点、影响力)
- **评论反响**——历史与当代解读

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.
在章节处理过程中,会出现新的次要人物、地点和象征符号。为出现3次以上或具有主题意义的实体创建笔记。

Phase 4: Validation

阶段4:验证

Schema Validation

Schema验证

python
undefined
python
undefined

Validate each entity type

验证每个实体类型

schema_validate(noteType="Character") schema_validate(noteType="Theme") schema_validate(noteType="Chapter") schema_validate(noteType="Location") schema_validate(noteType="Symbol") schema_validate(noteType="LiteraryDevice")
undefined
schema_validate(noteType="Character") schema_validate(noteType="Theme") schema_validate(noteType="Chapter") schema_validate(noteType="Location") schema_validate(noteType="Symbol") schema_validate(noteType="LiteraryDevice")
undefined

Drift Detection

偏差检测

python
schema_diff(noteType="Character")
python
schema_diff(noteType="Character")

... for each type

... 对每个类型执行


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

修复发现的问题——常见修复:
- 缺失必填观察类别→通过`edit_note`添加
- 枚举值超出允许范围→修正元数据
- 笔记中存在但schema中没有的字段→如果合理,添加为schema的可选字段

Relation Consistency

关系一致性

Spot-check bidirectional relations: if Chapter X
features [[Character]]
, does Character have observations referencing Chapter X? Fix gaps.
抽查双向关系:如果章节X
features [[Character]]
,人物笔记中是否有引用章节X的观察?修复缺失的关联。

Phase 5: Visualization

阶段5:可视化

Generate canvas files for visual exploration:
python
undefined
生成画布文件以进行可视化探索:
python
undefined

Character relationship web

人物关系网

canvas(query="type:Character AND role:protagonist OR role:antagonist OR role:supporting")
canvas(query="type:Character AND role:protagonist OR role:antagonist OR role:supporting")

Theme connections

主题关联

canvas(query="type:Theme")
canvas(query="type:Theme")

Chapter timeline with key events

带关键事件的章节时间线

canvas(query="type:Chapter", layout="timeline")
undefined
canvas(query="type:Chapter", layout="timeline")
undefined

Adapting to Other Genres

适配其他体裁

This pipeline works for any literary text. Adjust schemas for genre:
GenreSchema Adjustments
NovelBase schemas work as-is; add genre-specific Character fields as needed
PlayAdd
Act
and
Scene
schemas; Character gets
speaking_lines
field
Poetry collectionReplace Chapter with
Poem
; add
form
,
meter
,
rhyme_scheme
fields
Non-fictionReplace Chapter with
Section
; add
Argument
,
Evidence
schemas
Short story collectionAdd
Story
schema with
narrator
,
setting
,
word_count
Epic/mythAdd
Deity
,
Prophecy
schemas; Location gets
mythological_significance
MemoirCharacter schema gets
relationship_to_narrator
; add
Memory
schema
该流程适用于任何文学文本。可根据体裁调整schema:
体裁Schema调整
小说基础schema可直接使用;按需添加体裁特定的人物字段
戏剧添加
Act
Scene
schema;人物添加
speaking_lines
字段
诗歌集
Poem
替代Chapter;添加
form
meter
rhyme_scheme
字段
纪实作品
Section
替代Chapter;添加
Argument
Evidence
schema
短篇小说集添加
Story
schema,包含
narrator
setting
word_count
字段
史诗/神话添加
Deity
Prophecy
schema;地点添加
mythological_significance
字段
回忆录人物schema添加
relationship_to_narrator
字段;添加
Memory
schema

Scaling Guidance

规模指导

Work LengthBatch SizeEstimated Notes
Novella (~40K words)5-10 chapters~50-80
Novel (~80K words)8-12 chapters~100-150
Long novel (~200K+ words)10-15 chapters~200-300
Series (multiple volumes)1 volume at a time~200+ per volume
作品长度批次大小预计笔记数量
中篇小说(约4万字)5-10章~50-80
长篇小说(约8万字)8-12章~100-150
超长篇小说(20万字以上)10-15章~200-300
系列作品(多卷)每次处理1卷每卷~200+

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
  • memory-schema — schema创建、验证和偏差检测
  • memory-tasks — 跨上下文压缩跟踪章节处理进度
  • memory-notes — 笔记撰写模式、观察类别、wiki-links
  • memory-ingest — 将外部输入处理为结构化实体
  • memory-metadata-search — 按前置元数据字段查询笔记
  • memory-lifecycle — 归档已完成的分析阶段

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_validate
    after 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.
  • 先初始化再处理。先创建实体占位笔记,确保章节处理过程中wiki-links能立即解析。
  • 批量处理提高效率。每次处理约10章,平衡深度与进度。使用任务笔记跟踪进度。
  • 阅读源文本。不要依赖记忆或摘要。处理每个批次前仔细阅读(或重读)对应文本。文本证据是核心。
  • 观察是索引。知识图谱的价值来自分类清晰的观察。多添加类别,内容要具体。
  • 关系是网络。每个章节应链接到人物、主题、地点和手法。每个实体应链接回出现的章节。
  • 逐步丰富实体。实体笔记会随每个章节逐步完善。不要一开始就试图写出完美的人物笔记——逐步追加内容。
  • 添加散文增加深度。完成结构化数据后,为主要笔记添加解读性散文。散文能捕捉观察无法涵盖的内容:论点、细微差别、观点和风格。
  • 定期验证。每完成一个批次就运行
    schema_validate
    ,不要等到最后。及早发现偏差。
  • 大量引用原文。文学分析依赖文本证据。将重要引用作为
    [quote]
    观察,并标注章节编号。
  • 回顾与修订。完成所有章节后,从外部视角回顾整个图谱。查找内容单薄的笔记、缺失的关联和覆盖空白。第一遍永远不是最终版本。
  • 最后再做综合分析
    analysis/
    目录下的综合笔记应在所有章节处理完成后撰写,此时你已掌握完整的作品全貌。