memory-literary-analysis
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseMemory 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-gatsbyhamletbelovedpython
create_memory_project(name="<work-name>", path="~/basic-memory/<work-name>")使用作品标题的短横线分隔格式(例如 、、)。
great-gatsbyhamletbelovedDefine Schemas
定义Schema
Write 6 schema notes to . 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是起点,而非严格模板。
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""" )
undefinedChapter 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""" )
undefinedLocation 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""" )
undefinedSymbol 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""" )
undefinedLiteraryDevice 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""" )
undefinedDirectory 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 resolve from the start.
[[wiki-links]]在处理章节之前,先为主要实体创建占位笔记,确保从一开始就能正常解析。
[[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>]]""" )
undefinedSeed Checklist
初始化检查清单
Identify the work's major entities before you start reading. A good starting inventory:
| Type | Typical Count | What to Include |
|---|---|---|
| Characters (major) | 8-20 | Protagonist, antagonist, key supporting cast |
| Themes | 5-12 | Central concerns the work explores |
| Locations | 4-10 | Primary settings, symbolically significant places |
| Symbols | 4-10 | Recurring objects, images, or motifs with layered meaning |
Stubs don't need to be complete — they give targets and will be enriched during chapter processing.
[[wiki-link]]在开始阅读前确定作品的主要实体。以下是初始参考数量:
| 类型 | 典型数量 | 包含内容 |
|---|---|---|
| 主要人物 | 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:
| Batch | Typical Content |
|---|---|
| 1 | Opening: setting, character introductions, world-building |
| 2-3 | Rising action: conflicts established, relationships develop |
| 4-6 | Middle: complications, turning points, thematic deepening |
| 7-8 | Climax approach: escalation, revelations, crises |
| Final | Climax, 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
单章需捕获的内容
| Category | What to Look For |
|---|---|
| 1-2 sentence chapter synopsis |
| Key plot events (actions, revelations, arrivals) |
| Emotional and stylistic atmosphere |
| Narrative innovations (POV shifts, structural experiments, genre blending) |
| Memorable or thematically significant passages |
| Why this chapter matters to the whole |
| Hints at future events |
| 类别 | 关注要点 |
|---|---|
| 1-2句章节概要 |
| 关键情节事件(动作、真相揭露、人物登场) |
| 情感与文体氛围 |
| 叙事创新(视角转换、结构实验、类型融合) |
| 难忘或具有主题意义的段落 |
| 该章节对整体作品的重要性 |
| 对未来事件的暗示 |
Entity Enrichment Per Chapter
单章实体丰富
As each chapter is processed, append observations to relevant entities:
- Characters: moments, new
[arc]revelations,[trait]attributions[quote] - Themes: in this chapter,
[manifestation]shifts[evolution] - Symbols: with context, new
[appearance]angles[interpretation] - Locations: as described,
[atmosphere]in scene[significance] - Literary devices: from this chapter
[example]
处理每个章节时,将观察内容追加到相关实体:
- 人物:时刻、新发现的
[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 . This prose should:
edit_note(operation="prepend")- 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.
完成结构化观察后,可考虑为主要实体笔记添加解读性散文。使用在Observations部分前添加2-4段评论性文章。这些散文应:
edit_note(operation="prepend")- 对人物、主题或象征符号提出独特解读,而非仅描述
- 将实体与作品的核心议题及文学传统联系起来
- 明确标记主观观点(例如“在我看来……”、“我认为……”)
- 引用章节编号作为文本证据
散文能捕捉结构化观察无法涵盖的内容:论点、细微差别、观点和个人风格。
Phase 3: Cross-Referencing
阶段3:交叉引用
After all chapters are processed:
完成所有章节处理后:
Character Arcs
人物弧光
For each major character, write a full summary observation covering their trajectory across the work.
[arc]为每个主要人物撰写完整的总结观察,涵盖其在作品中的完整轨迹。
[arc]Theme Evolution
主题演变
For each theme, add observations tracing how it develops from introduction to resolution.
[evolution]为每个主题添加观察,追踪其从出现到结局的发展过程。
[evolution]Chapter Parallels
章节关联
Add and relations between structurally similar chapters (e.g., mirrored scenes, repeated settings, thematic echoes).
parallelscontrasts_with在结构相似的章节之间添加和关系(例如,镜像场景、重复设定、主题呼应)。
parallelscontrasts_withAnalysis 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
undefinedpython
undefinedValidate 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")
undefinedschema_validate(noteType="Character")
schema_validate(noteType="Theme")
schema_validate(noteType="Chapter")
schema_validate(noteType="Location")
schema_validate(noteType="Symbol")
schema_validate(noteType="LiteraryDevice")
undefinedDrift 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 , does Character have observations referencing Chapter X? Fix gaps.
features [[Character]]抽查双向关系:如果章节X,人物笔记中是否有引用章节X的观察?修复缺失的关联。
features [[Character]]Phase 5: Visualization
阶段5:可视化
Generate canvas files for visual exploration:
python
undefined生成画布文件以进行可视化探索:
python
undefinedCharacter 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")
undefinedcanvas(query="type:Chapter", layout="timeline")
undefinedAdapting to Other Genres
适配其他体裁
This pipeline works for any literary text. Adjust schemas for genre:
| Genre | Schema Adjustments |
|---|---|
| Novel | Base schemas work as-is; add genre-specific Character fields as needed |
| Play | Add |
| Poetry collection | Replace Chapter with |
| Non-fiction | Replace Chapter with |
| Short story collection | Add |
| Epic/myth | Add |
| Memoir | Character schema gets |
该流程适用于任何文学文本。可根据体裁调整schema:
| 体裁 | Schema调整 |
|---|---|
| 小说 | 基础schema可直接使用;按需添加体裁特定的人物字段 |
| 戏剧 | 添加 |
| 诗歌集 | 用 |
| 纪实作品 | 用 |
| 短篇小说集 | 添加 |
| 史诗/神话 | 添加 |
| 回忆录 | 人物schema添加 |
Scaling Guidance
规模指导
| Work Length | Batch Size | Estimated 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 after each batch, not just at the end. Catch drift early.
schema_validate - Quote generously. Literary analysis lives on textual evidence. Include significant quotes as observations with chapter attribution.
[quote] - 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 should be written after all chapters are processed, when you have the full picture.
analysis/
- 先初始化再处理。先创建实体占位笔记,确保章节处理过程中wiki-links能立即解析。
- 批量处理提高效率。每次处理约10章,平衡深度与进度。使用任务笔记跟踪进度。
- 阅读源文本。不要依赖记忆或摘要。处理每个批次前仔细阅读(或重读)对应文本。文本证据是核心。
- 观察是索引。知识图谱的价值来自分类清晰的观察。多添加类别,内容要具体。
- 关系是网络。每个章节应链接到人物、主题、地点和手法。每个实体应链接回出现的章节。
- 逐步丰富实体。实体笔记会随每个章节逐步完善。不要一开始就试图写出完美的人物笔记——逐步追加内容。
- 添加散文增加深度。完成结构化数据后,为主要笔记添加解读性散文。散文能捕捉观察无法涵盖的内容:论点、细微差别、观点和风格。
- 定期验证。每完成一个批次就运行,不要等到最后。及早发现偏差。
schema_validate - 大量引用原文。文学分析依赖文本证据。将重要引用作为观察,并标注章节编号。
[quote] - 回顾与修订。完成所有章节后,从外部视角回顾整个图谱。查找内容单薄的笔记、缺失的关联和覆盖空白。第一遍永远不是最终版本。
- 最后再做综合分析。目录下的综合笔记应在所有章节处理完成后撰写,此时你已掌握完整的作品全貌。
analysis/