【文章标题】:Agent Memory as a File Format
智能体记忆作为一种文件格式

【文章正文】:
Agent memory as a file format
智能体记忆作为一种文件格式

Memoryfields - a vastly simpler way to do agent memory
记忆场(Memoryfields)——一种更简单的智能体记忆实现方式

Many model benchmarks start from a blank context window. The tabula rasa of AI. To some extent, this makes sense, to keep the benchmarks fair.
许多模型基准测试都从空白上下文窗口开始。这种AI的”白板状态”在某种程度上是合理的,以保证基准测试的公平性。

But real agents should never start from a blank context window. They should start with as much relevant information available to the agent as possible. Your AI agents should start with memories.
但真正的智能体绝不应该从空白上下文开始。它们应该尽可能多地获取相关信息。你的AI智能体应该带着记忆开始工作。

Why existing agent memory systems don’t seem to work
为何现有智能体记忆系统效果不佳

The trouble is, a lot of agent memory systems are actually pretty rubbish. I think there are roughly three popular kinds of memory system at the moment, each of them not working in their own way.
问题在于,许多智能体记忆系统实际上相当糟糕。我认为目前主要有三种流行的记忆系统,每种都有其自身的问题。

The first are ones that deliberately tie you into a specific harness - usually written by the lab that rents you that harness. Said lab desperately wants to transition out of the (highly competitive) “API business” and into the (much more lucrative) “platform business”. This form of system usually works by mining information out of your conversation history, with the result that most of their memories are all about you, even though information about the world is generally much more useful.
第一种是那些故意将你绑定到特定框架的系统——通常由出租该框架的实验室编写。这些实验室迫切希望从(竞争激烈的)“API业务”转向(利润更高的)“平台业务”。这类系统通常通过挖掘你的对话历史来工作,结果它们的大部分记忆都是关于你的,尽管关于世界的信息通常更有用。

Another kind is ludicrously complicated. I know of one prominent system that needs pgvector, a Neo4j graph database and an LLM of its own just to decide what’s worth remembering. This complexity is not only difficult to administer, but, for reasons I will explain: these Big Systems confuse the models too. They also fail to scale with the model frontier as it moves forward.
另一种则复杂得可笑。我知道一个著名的系统需要pgvector、Neo4j图数据库和它自己的LLM,仅仅是为了决定什么值得记住。这种复杂性不仅难以管理,而且正如我将解释的:这些大型系统也会让模型感到困惑。它们也无法随着模型前沿的发展而扩展。

The final kind is the “High Modernist” variety, which imagine an idealised, rationalist form of memory. Inevitably, this involves a graph, and sometimes logical propositions as well. This kind systematically strips information from its context and leaves it isolated and senseless to the agent (and you). How useful, after all, is a simple list of “distilled facts”?
最后一种是”高度现代主义”类型,它设想了一种理想化的理性主义记忆形式。这不可避免地涉及到图,有时还包括逻辑命题。这种类型系统地从信息中剥离上下文,使其对智能体(和你)来说孤立无意义。毕竟,一个简单的”提炼事实”列表有多大用处?

What they have in common is that they treat memory as a process. But memory - especially to a model - is much better represented as data.
它们的共同点是将记忆视为一个过程。但记忆——尤其对模型而言——更适合表示为数据。

Memory should be a data format, not a multi-stage pipeline
记忆应该是一种数据格式,而非多阶段流水线

Brooks said:
Brooks说过:

Show me your flowcharts and conceal your tables, and I shall continue to be mystified. Show me your tables, and I won’t usually need your flowcharts; they’ll be obvious.
”给我看你的流程图而隐藏你的表格,我仍然会感到困惑。给我看你的表格,通常我就不需要你的流程图了;它们会变得显而易见。”

So, here is the “memoryfield” portable memory file format:
因此,这就是”记忆场”可移植记忆文件格式:

my-memories.memoryfield.zip
âââ carbon-fibre-woks.md
âââ finnish-bureaucracy-tips.md
âââ [… many more md files…]
âââ wec-2026-season-notes.md
âââ nomic-embed-text-v1.5.sqlite3

A memoryfield is:
记忆场包含:

  • Markdown “pages”, with
    Markdown”页面”,包含
  • (optional) YAML frontmatter and
    (可选的)YAML前言和
  • (optional) SQLite vector index for semantic search
    (可选的)用于语义搜索的SQLite向量索引

Agents work best with files. Allow me to explain.
智能体最适合处理文件。请允许我解释。

Design decision 1: use prose, not chunks or “facts”
设计决策1:使用散文,而非分块或”事实”

The main reason why RAG pipelines can be very complicated is that they are trying to make a mass of existing, human-authored documents legible to an AI agent. Often these documents are very hard for the agent to read directly, eg: because they are big PDFs.
RAG流水线非常复杂的主要原因是它们试图让大量现有的人类撰写文档对AI智能体可读。通常这些文档对智能体来说很难直接阅读,例如:因为它们是大PDF文件。

But agent memories are not complicated legacy documents. A memory, at the time it is being formed, is occurring directly to an AI agent which is fully able to write prose. That prose does not need to be chunked, enriched, double-summarised or otherwise mechanically processed: just have the agent write the memory directly in its favourite format (which is Markdown).
但智能体记忆不是复杂的遗留文档。记忆在形成时直接发生在完全能够写散文的AI智能体中。这些散文不需要被分块、丰富、双重总结或以其他方式机械处理:只需让智能体直接以其喜欢的格式(即Markdown)编写记忆。

A memoryfield page looks like this:
记忆场页面如下所示:


title: Carbon Fibre Woks
created: ‘2026-03-01T09:00:00Z’
updated: ‘2026-08-22T14:30:00Z’
uuid: 6aa615f0-486f-48a7-a210-ba4f5ff18c8b
summary: Thermal properties of carbon fibre cookware

Carbon fibre woks conduct heat evenly, but…

The one limitation, admittedly, is that the page has to be short enough to fit into a vector embedding: so there is a soft limit of about 8kb (~2000 tokens).
诚然,一个限制是页面必须足够短以适合向量嵌入:因此有一个大约8kb(约2000个token)的软限制。

But this is a highly beneficial restriction in practice: 8,000 characters is about 1,300 words, or the length of a medium-length magazine article. That is, in fact, a restriction it would make sense to impose anyway. To add more detail, add more pages - agents do not struggle to do this.
但这在实践中是非常有益的限制:8,000个字符大约是1,300个单词,或一篇中等长度杂志文章的长度。事实上,这本来就是一个合理的限制。要添加更多细节,只需添加更多页面——智能体不难做到这一点。

Design decision 2: semantic jump, not graph walking
设计决策2:语义跳跃,而非图遍历

A key piece of prior art was Karpathy wikis. Karpathy wikis are oriented around hyperlinked Markdown files: modelled on those used by Roam or Obsidian. The idea was that the agent would walk the “knowledge graph” to find relevant pages.
一个关键的现有技术是Karpathy维基。Karpathy维基以超链接Markdown文件为中心:模仿Roam或Obsidian使用的那些。其理念是智能体会遍历”知识图谱”以找到相关页面。

But in practice, having an AI agent traverse a knowledge graph is slow and unreliable - as well as being confusing for the agent.
但在实践中,让AI智能体遍历知识图谱既缓慢又不可靠——而且会让智能体感到困惑。

Traversal is slow because the model needs to frequently stop to make serial tool calls to read successive pages.
遍历速度慢是因为模型需要频繁停下来进行串行工具调用来读取连续页面。

The rough algorithm for an agent to walk a knowledge graph:
智能体遍历知识图谱的粗略算法:

  • Read wiki front page [tool call]
    阅读维基首页[工具调用]
    • find relevant links
      找到相关链接
  • Read linked page(s) [tool call]
    阅读链接页面[工具调用]
    • find relevant links
      找到相关链接
  • Decide if enough relevant information has been found
    决定是否找到足够相关信息
    • If not, go to #2
      如果没有,转到#2

If the relevant information is N steps deep in the knowledge
如果相关信息位于知识图谱的N层深处