Penfield Memory
Persistent memory that compounds. Your agent remembers conversations, learns preferences, connects ideas, and picks up exactly where it left off—across sessions, days, and channels.
Tools
Memory
| Tool | Purpose | When to use |
|---|
| INLINECODE0 | Save a memory | User shares preferences, you make a discovery, a decision is made, you learn something worth keeping |
| INLINECODE1 |
Hybrid search (BM25 + vector + graph) | Need context before responding, resuming a topic, looking up prior decisions |
|
penfield_search | Semantic search (higher vector weight) | Fuzzy concept search when you don't have exact terms |
|
penfield_fetch | Get memory by ID | Following up on a specific memory from recall results |
|
penfield_update_memory | Edit existing memory | Correcting, adding detail, changing importance or tags |
Knowledge Graph
| Tool | Purpose | When to use |
|---|
| INLINECODE5 | Link two memories | New info relates to existing knowledge, building understanding over time |
| INLINECODE6 |
Remove link between memories | Relationship was created in error or is no longer valid |
|
penfield_explore | Traverse graph from a memory | Understanding how ideas connect, finding related context |
Context & Analysis
| Tool | Purpose | When to use |
|---|
| INLINECODE8 | Checkpoint a session | Ending substantive work, preparing for handoff to another agent |
| INLINECODE9 |
Resume from checkpoint | Picking up where you or another agent left off |
|
penfield_list_contexts | List saved checkpoints | Finding previous sessions to resume |
|
penfield_reflect | Analyze memory patterns | Session start orientation, finding themes, spotting gaps |
Artifacts
| Tool | Purpose | When to use |
|---|
| INLINECODE12 | Store a file | Saving diagrams, notes, code, reference docs |
| INLINECODE13 |
Get a file | Loading previously saved work |
|
penfield_list_artifacts | List stored files | Browsing saved artifacts |
|
penfield_delete_artifact | Remove a file | Cleaning up outdated artifacts |
Personality
| Tool | Purpose | When to use |
|---|
| INLINECODE16 | Load personality config | Session start, identity refresh |
Writing Memories That Actually Work
Memory content quality determines whether Penfield is useful or useless. The difference is specificity and context.
Bad — vague, no context, unfindable later:
CODEBLOCK0
Good — specific, contextual, findable:
CODEBLOCK1
What makes a memory findable:
- 1. Context prefix in brackets:
[Preferences], [Project: API Redesign], [Investigation: Payment Bug], INLINECODE20 - The "why" behind the "what" — rationale matters more than the fact itself
- Specific details — names, numbers, dates, versions, not vague summaries
- References to related memories — "This builds on [earlier finding about X]" or "Contradicts previous assumption that Y"
Memory Types
Use the correct type. The system uses these for filtering and analysis.
| Type | Use for | Example |
|---|
| INLINECODE21 | Verified, durable information | "User's company runs Kubernetes on AWS EKS" |
| INLINECODE22 |
Patterns or realizations | "Deployment failures correlate with Friday releases" |
|
correction | Fixing prior understanding | "CORRECTION: The timeout isn't Redis — it's a hardcoded batch limit" |
|
conversation | Session summaries, notable exchanges | "Discussed migration strategy. User leaning toward incremental approach" |
|
reference | Source material, citations | "RFC 8628 defines Device Code Flow for OAuth on input-constrained devices" |
|
task | Work items, action items | "TODO: Benchmark recall latency after index rebuild" |
|
strategy | Approaches, methods, plans | "For user's codebase: always check types.ts first, it's the source of truth" |
|
checkpoint | Milestone states | "Project at 80% — auth complete, UI remaining" |
|
identity_core | Immutable identity facts | Set via personality config, rarely stored manually |
|
personality_trait | Behavioral patterns | Set via personality config, rarely stored manually |
|
relationship | Entity connections | "User works with Chad Schultz on cybersecurity content" |
Importance Scores
Use the full range. Not everything is 0.5.
| Score | Meaning | Example |
|---|
| 0.9–1.0 | Critical — never forget | Architecture decisions, hard-won corrections, core preferences |
| 0.7–0.8 |
Important — reference often | Project context, key facts about user's work |
| 0.5–0.6 | Normal — useful context | General preferences, session summaries |
| 0.3–0.4 | Minor — background detail | Tangential facts, low-stakes observations |
| 0.1–0.2 | Trivial — probably don't store | If you're questioning whether to store it, don't |
Connecting Memories
Connections are what make Penfield powerful. An isolated memory is just a note. A connected memory is understanding.
After storing a memory, always ask: What does this relate to? Then connect it.
Relationship Types (24)
Knowledge Evolution: supersedes · updates · evolution_of
Use when understanding changes. "We thought X, now we know Y."
Evidence: supports · contradicts · disputes
Use when new information validates or challenges existing beliefs.
Hierarchy: parent_of · child_of · sibling_of · composed_of · part_of
Use for structural relationships. Topics containing subtopics, systems containing components.
Causation: causes · influenced_by · prerequisite_for
Use for cause-and-effect chains and dependencies.
Implementation: implements · documents · tests · example_of
Use when something demonstrates, describes, or validates something else.
Conversation: responds_to · references · inspired_by
Use for attribution and dialogue threads.
Sequence: follows · precedes
Use for ordered steps in a process or timeline.
Dependencies: depends_on
Use when one thing requires another.
Recall Strategy
Good queries find things. Bad queries return noise.
Tune search weights for your query type:
| Query type | bm25weight | vectorweight | graph_weight |
|---|
| Exact term lookup ("Twilio auth token") | 0.6 | 0.3 | 0.1 |
| Concept search ("how we handle errors") |
0.2 | 0.6 | 0.2 |
| Connected knowledge ("everything about payments") | 0.2 | 0.3 | 0.5 |
| Default (balanced) | 0.4 | 0.4 | 0.2 |
Filter aggressively:
- -
memory_types: ["correction", "insight"] to find discoveries and corrections - INLINECODE57 to skip noise
- INLINECODE58 to follow connections (default, usually leave on)
Workflows
User shares a preference
CODEBLOCK2
Investigation tracking
CODEBLOCK3
Session handoff
CODEBLOCK4
Next session or different agent:
CODEBLOCK5
What NOT to Store
- - Verbatim conversation transcripts (too verbose, low signal)
- Easily googled facts (use web search instead)
- Ephemeral task state (use working memory)
- Anything the user hasn't consented to store about themselves
- Every minor exchange (be selective — quality over quantity)
Tags
Keep them short, consistent, lowercase. 2–5 per memory.
Good: preferences, architecture, investigation, correction, project-name
Bad: 2026-02-02, important-memory-about-deployment, INLINECODE66
Also Available Outside OpenClaw
The native OpenClaw plugin is the fastest path, but Penfield works with any AI tool anywhere:
Claude Connectors
CODEBLOCK6
Claude Code
CODEBLOCK7
MCP Server — for Gemini CLI, Cursor, Windsurf, Intent, Perplexity Desktop or any MCP-compatible tool:
CODEBLOCK8
API — direct HTTP access at api.penfield.app for custom integrations.
Same memory, same knowledge graph, same account. The plugin is 4-5x faster (no MCP proxy layer), but everything stays in sync regardless of how you connect.
Links
Penfield 记忆
持续累积的持久化记忆。你的智能体能够记住对话内容、学习用户偏好、关联不同想法,并在跨会话、跨天、跨渠道的场景中,精确地从上次中断的地方继续工作。
工具
记忆
| 工具 | 用途 | 使用时机 |
|---|
| penfieldstore | 保存一条记忆 | 用户分享偏好、你有了新发现、做出决策、学到了值得保留的信息 |
| penfieldrecall |
混合搜索(BM25 + 向量 + 图) | 回复前需要上下文、恢复某个话题、查找之前的决策 |
| penfield_search | 语义搜索(向量权重更高) | 没有确切关键词时的模糊概念搜索 |
| penfield_fetch | 根据ID获取记忆 | 跟进召回结果中的某条具体记忆 |
| penfield
updatememory | 编辑已有记忆 | 修正、补充细节、更改重要性或标签 |
知识图谱
| 工具 | 用途 | 使用时机 |
|---|
| penfieldconnect | 关联两条记忆 | 新信息与已有知识相关,逐步构建理解 |
| penfielddisconnect |
移除记忆之间的关联 | 关联关系创建错误或不再有效 |
| penfield_explore | 从一条记忆出发遍历图谱 | 理解想法如何关联,查找相关上下文 |
上下文与分析
| 工具 | 用途 | 使用时机 |
|---|
| penfieldsavecontext | 保存会话检查点 | 结束实质性工作,准备交接给其他智能体 |
| penfieldrestorecontext |
从检查点恢复 | 从你或其他智能体中断的地方继续工作 |
| penfield
listcontexts | 列出已保存的检查点 | 查找之前的会话以恢复 |
| penfield_reflect | 分析记忆模式 | 会话开始时定位方向、发现主题、找出空白 |
工件
| 工具 | 用途 | 使用时机 |
|---|
| penfieldsaveartifact | 存储文件 | 保存图表、笔记、代码、参考文档 |
| penfieldretrieveartifact |
获取文件 | 加载之前保存的工作成果 |
| penfield
listartifacts | 列出已存储的文件 | 浏览已保存的工件 |
| penfield
deleteartifact | 删除文件 | 清理过时的工件 |
个性
| 工具 | 用途 | 使用时机 |
|---|
| penfield_awaken | 加载个性配置 | 会话开始、身份刷新 |
编写真正有效的记忆
记忆内容的质量决定了Penfield是有用还是无用。关键在于具体性和上下文。
糟糕——模糊、无上下文、日后无法找到:
用户喜欢Python
优秀——具体、有上下文、可查找:
[偏好] 用户更喜欢Python而非JavaScript进行后端开发。
原因:对JS回调模式感到困扰,且缺乏类型安全。重视类型提示和显式错误处理。使用FastAPI构建API。
让记忆可查找的要素:
- 1. 方括号中的上下文前缀:[偏好]、[项目:API重构]、[调查:支付Bug]、[决策]
- 什么背后的为什么——理由比事实本身更重要
- 具体细节——名称、数字、日期、版本,而非模糊的概括
- 对相关记忆的引用——这建立在[关于X的早期发现]之上或与之前关于Y的假设相矛盾
记忆类型
使用正确的类型。系统会利用这些类型进行筛选和分析。
| 类型 | 用途 | 示例 |
|---|
| fact | 已验证的持久信息 | 用户公司在AWS EKS上运行Kubernetes |
| insight |
模式或领悟 | 部署失败与周五发布相关 |
| correction | 修正之前的理解 | 修正:超时问题不是Redis——是硬编码的批次限制 |
| conversation | 会话摘要、重要交流 | 讨论了迁移策略。用户倾向于增量方式 |
| reference | 源材料、引用 | RFC 8628定义了输入受限设备上OAuth的设备码流程 |
| task | 工作项、行动项 | 待办:索引重建后基准测试召回延迟 |
| strategy | 方法、方式、计划 | 对于用户的代码库:始终先检查types.ts,它是事实来源 |
| checkpoint | 里程碑状态 | 项目完成80%——认证已完成,UI待完成 |
| identity_core | 不可变的身份事实 | 通过个性配置设置,很少手动存储 |
| personality_trait | 行为模式 | 通过个性配置设置,很少手动存储 |
| relationship | 实体关联 | 用户与Chad Schultz合作网络安全内容 |
重要性评分
使用完整的评分范围。并非所有内容都是0.5分。
| 分数 | 含义 | 示例 |
|---|
| 0.9–1.0 | 关键——永不遗忘 | 架构决策、来之不易的修正、核心偏好 |
| 0.7–0.8 |
重要——经常参考 | 项目上下文、关于用户工作的关键事实 |
| 0.5–0.6 | 正常——有用的上下文 | 一般偏好、会话摘要 |
| 0.3–0.4 | 次要——背景细节 | 边缘事实、低风险观察 |
| 0.1–0.2 | 琐碎——可能不需要存储 | 如果你在犹豫是否要存储,那就不要存 |
关联记忆
关联是Penfield强大的关键。孤立的记忆只是一条笔记。关联的记忆才是理解。
存储一条记忆后,始终要问: 这与什么相关?然后进行关联。
关系类型(24种)
知识演化: supersedes(取代)· updates(更新)· evolution_of(演化)
当理解发生变化时使用。我们曾以为X,现在我们知道Y。
证据: supports(支持)· contradicts(矛盾)· disputes(质疑)
当新信息验证或挑战已有信念时使用。
层级: parentof(父级)· childof(子级)· siblingof(同级)· composedof(组成)· part_of(部分)
用于结构关系。主题包含子主题,系统包含组件。
因果: causes(导致)· influencedby(受...影响)· prerequisitefor(前提)
用于因果链和依赖关系。
实现: implements(实现)· documents(文档)· tests(测试)· example_of(示例)
当某事物演示、描述或验证另一事物时使用。
对话: respondsto(回复)· references(引用)· inspiredby(启发)
用于归因和对话线索。
顺序: follows(跟随)· precedes(先于)
用于流程或时间线中的有序步骤。
依赖: depends_on(依赖)
当某事物需要另一事物时使用。
召回策略
好的查询能找到东西。糟糕的查询只会返回噪音。
根据查询类型调整搜索权重:
| 查询类型 | bm25weight | vectorweight | graph_weight |
|---|
| 精确术语查找(Twilio认证令牌) | 0.6 | 0.3 | 0.1 |
| 概念搜索(我们如何处理错误) |
0.2 | 0.6 | 0.2 |
| 关联知识(关于支付的一切) | 0.2 | 0.3 | 0.5 |
| 默认(均衡) | 0.4 | 0.4 | 0.2 |
积极筛选:
- - memorytypes: [correction, insight] 查找发现和修正
- importancethreshold: 0.7 跳过噪音
- enablegraphexpansion: true 跟随关联(默认,通常保持开启)
工作流程
用户分享偏好
penfield_store({
content: [偏好] 用户希望回复不超过3段,除非复杂性要求更多。在随意对话中不喜欢项目符号。,
memory_type: fact,
importance: 0.8,
tags: [preferences, communication]
})
调查追踪
// 开始
penfield_store({
content: [调查:部署失败] 每次周五部署后报告500错误。正在检查发布管道、配置漂移和流量模式。,
memory_type: task,
importance: 0.7,
tags: