我在多台机器上工作,会根据任务切换不同的编码智能体。它们每一个面对我的项目时都形同陌路。“上周二”的推理过程在会话结束时便消失无踪。每个新智能体,在每台新主机上,都从零开始。今年早些时候,《软件会遗忘:智能体轨迹才是记忆》一文指出,编码智能体其实早已产出了我们一直在丢失的那份记录。当它们搜索代码库、尝试各种方案、遭遇错误、阅读文档、改变方向时,会留下详尽的轨迹,不仅记录了改了什么,更记录了为什么这么改。
虽然诊断是正确的,但轨迹只是潜在的记忆。智能体的会话日志仍然只是一份存档。你无法靠 grep 在上万轮对话中检索出“我们为什么放弃了流式解析器?”这个问题。要让智能体在工作时利用这些轨迹,就需要对它们进行索引、检索、排序,并确保精确的来源追溯。
这正是 funes 所提供的。它是为你的智能体(Claude Code、Codex、pi 和 Hermes)打造的持久记忆层。它基于你机器上已有的会话构建。它在本地运行,只需一条命令即可成为智能体日常工作流程的一部分。当你需要时,它还可以将数据传送到你拥有的 Hugging Face 数据集上,默认设为私有。
为你正在使用的智能体添加记忆
funes 是一个单一二进制文件。其默认推理后端不依赖任何 ML 运行时,嵌入向量和重排序都在你的机器上本地完成。安装它:
curl -fsSL https://huggingface.co/buckets/huggingface/funes/resolve/install.sh | sh
然后将其添加到某个智能体:
funes add claude # or: codex, pi, hermes
这一条 add 命令会构建首个索引,让智能体具备 recall 和 get 工具,并安装自动化流程,对每一轮已完成的对话进行索引。索引是增量式的,新的运行只会新增对话轮次,而不会重新嵌入整个历史记录。较旧且更深层的内容可以在有界步骤中回填。
从那里开始,你只需正常工作。当某个任务涉及过去的决策、理由或发现时,智能体可以自行调用 recall。你无需记住旧的会话,也无需将其上下文粘贴到新会话中。
加入 funes 之后,回忆发生在对话内部。智能体会自行调用其记忆,并在其回答背后标明对应的会话。
recall 返回的是原始文本而非摘要,并精确显示其来源(智能体、时间戳、会话和轮次)。每个结果都包含一个 get 命令,可打开完整的对话轮次及其上下文。
在底层,一条确定性的流水线将每种受支持的 trace 解析为统一的轮次与块结构,对其进行分块,用固定的本地模型嵌入,并写入本地 Lance 数据集。查询时结合向量搜索和 BM25 搜索,融合两者的排序结果,用 cross-encoder 对候选进行重排,按时间远近重新加权,并附上相邻的块。
这种设计赋予了 funes 三个重要特性:
- 跨智能体的统一记忆:Claude Code、Codex、pi 和 Hermes 都写入相同的数据结构。recall 可跨越它们的历史记录,每条命中结果都会标明是由哪个智能体产生的。
- 原始证据保持完整:写入时不会将任何内容蒸馏成一条事实。任何结果都可以回溯到产生它的那一轮对话。
- 默认情况下,召回是本地化的:不需要任何账户或 Hub 仓库。托管模型不会处理你的会话用于索引;嵌入向量和重排序都在你的机器上运行,而你的编码智能体负责推理。
“智能体是陌生人”的问题在一台机器上已经解决了。但当下一个智能体在别处运行时,记忆会变得更加有用。
记忆是一个数据集,而不是一项服务
要让记忆跟随你的工作流转,在向智能体添加 funes 时绑定一个即可:
funes add codex acme/funes-memory
绑定操作会将你当前的记忆发布到该处。随后 funes 会持续保持其更新,在本地为每一轮交互建立索引,并在会话边界处进行发布。智能体在整个过程中都从该记忆中进行回忆。在另一台机器上运行同样的命令,记忆便会跟随你到那里。
在底层,本地记忆是一个 Lance 数据集,而共享记忆则是一个归你所有的 Hugging Face 数据集(默认设为私有)。
在内容到达 Hub 之前,凭据已在索引过程中被移除。发布时则会再次扫描每一个分块,并扣留任何看起来仍像机密的内容。这背后的扫描机制已在 SECURITY.md 中说明,包括其覆盖范围与不覆盖的内容。
当智能体读取远程记忆时,funes 会在本地缓存数据集文件,因此热查询可恢复到本地速度。Hub 提供它已为其他数据集提供的所有权、访问控制、版本管理和分发能力。你的记忆不会成为某个独立记忆服务中的账户,也不需要通过 API 付费租回自己的记忆。
先提问,后接线
recall 是为智能体而设计的。当你想亲自向记忆提问时,请使用 ask。它默认读取你的本地记忆:
funes ask claude "what did we decide about the streaming parser"
也可以指向共享记忆。我们发布了一份 funes 开发过程的记忆,因此你可以询问 funes 为何如此运作,而无需自行创建记忆:
funes ask claude "why is funes append-only" --memory huggingface/funes-memory
funes ask 是 funes add 的只读、单次提问的姊妹功能。它会检索相关段落,将其交给编码智能体,并返回一个注明来源的有据可依的答案。它不会安装集成,也不会改变智能体的持久化配置。
检索未命中不会被掩盖。如果段落不足以支撑答案,智能体会如实说明。你可以重新表述问题,或将 funes 添加到智能体中,以便它在正常工作期间迭代式地搜索记忆。
切换智能体而不丢失上下文线索
共享记忆不绑定于创建它的智能体或模型。在 Claude Code 中开始一项任务,下周在 Codex 中继续,第二个智能体可以回忆起第一个智能体的推理过程。使用 pi 搭配本地模型或通过 Hugging Face 路由器提供的模型,然后再回到 Claude。
Claude 做出决定;一个 hook 将其索引;Codex 在另一个会话中回忆起它。演示中较早的命中记录是同一实验的早期录音:一个仅追加的记忆也记住了排练过程。
这在几个不同的层面都很重要:
- 跨你的机器:将每个智能体绑定到一个记忆,无论你使用哪台主机,都能回忆起历史记录。
- 跨团队:新队友的智能体可以在第一天就检索到数月的决策记录,包括从未进入 pull request 的死胡同和决策理由。
- 伴随开源项目:维护者可以发布某个版本背后的会话,并在推送时为其命名。可以把它看作一个可搜索的 CLAUDE.md,保存着项目为何成为如今这般模样的历史,而不是一个需要有人不断重写的页面。任何人都可以通过 --memory 读取公共记忆。
已发布的记忆带有数据集卡片和 funes 标签,使其在 Hub 上易于识别和发现。Hub 已经托管开放权重和数据集。funes 增加了开放的工作记忆。它保存着项目背后的决策、失败的方法和理由,可被其他智能体查询,并可追溯到产生它们的会话。
长会话最省钱的出路
长时间的调查会让会话不断膨胀,直到每一轮携带上下文的成本超过实际完成工作的成本。通常的解决办法是让智能体压缩上下文后继续,或者写一份交接文档然后重新开始。Recall 是第三种方案,因此我们在“交接 vs. Recall”基准上对它们进行了对比测试:两个任务,其答案在缺少会话先前知识的情况下无法重建。
压缩(Compaction)是大多数智能体默认采用的方式,也是三种方案中唯一一个结果出现分歧的:它在一个任务上成功到达,在另一个任务上却始终未能到达。在失败的地方,它的摘要把关键发现给抹平了。Recall 返回的是原文段落本身,因此发现不必经受摘要这一关的考验。
Recall 在两个任务上都是三者中最便宜的方案,在一个任务上比书面交接便宜 8 倍,在另一个任务上便宜 4 倍。
每个条形图中较浅的部分是准备通道、交接或压缩的一次性开销,在提出第一个问题之前就已支付,且只计一次。叉号标记表示该通道始终未能到达,因此没有每次成功的成本。
别再从头开始
“思考就是遗忘差异、进行概括、做出抽象。” —— 豪尔赫·路易斯·博尔赫斯,《博闻强记的富内斯》
你的智能体已经写下了记录。funes 托管在 github.com/huggingface/funes,只需一条命令,就能把那条记录变成下一个智能体可以读取的记忆——无论你此刻在哪台机器上。
基于开源构建
funes 几乎没有自创什么。它依托于足以在本地运行的开源嵌入模型、Lance 支持低成本增量写入的追加式数据集,以及 Hub 针对数据集提供的缓存与内容去重能力。真正的工作在于把这些能力整合成智能体真正可用的记忆。
funes 同样是开源的。无论是安装问题、记忆召回遗漏,还是你希望支持的智能体,都可以提交 issue。
I work across several machines, and I switch coding agents depending on the task. Every one of them meets my projects as a stranger. The reasoning from “last Tuesday” disappears when the session ends. Each new agent, on each new host, starts from zero. Earlier this year, Software Forgets: Agent Traces Are the Memory made the case that coding agents already produce the record we keep losing. As they search a codebase, try approaches, hit errors, read documentation, and change direction, they leave behind a dense account of not just what changed, but why.
While the diagnosis is correct, traces are only potential memory. The session logs of an agent are still just an archive. You cannot grep your way to “why did we move off the streaming parser?” across ten thousand turns. For an agent to use those traces while it works, they need indexing, retrieval, ranking, and exact provenance.
That is what funes provides. It is a durable memory layer for your agents (Claude Code, Codex, pi, and Hermes). It is built from the sessions already on your machine. It works locally and becomes part of your agent's normal workflow with one command. When you want it to, it can also travel to a Hugging Face dataset you own, private by default.
Add memory to the agent you already use
funes is a single binary. Its default inference backend has no ML runtime dependency, and embedding and reranking happen on your machine. Install it:
curl -fsSL https://huggingface.co/buckets/huggingface/funes/resolve/install.sh | sh
Then add it to an agent:
funes add claude # or: codex, pi, hermes
That one add command builds the first index, gives the agent recall and get tools, and installs the automation that indexes each completed turn. Indexing is incremental, with new runs adding new turns rather than embedding the whole history again. The older and deeper content can backfill in bounded steps.
From there, you just work. When a task touches a past decision, rationale, or finding, the agent can reach for recall itself. You do not need to remember the old session or paste its context into the new one.
With funes added, recall happens inside the conversation. The agent reaches for its memory on its own and names the session behind its answer.
recall returns the original text, not a summary, and shows exactly where it came from (the agent, timestamp, session, and turn). Each result includes a get command that opens the full turn and its surrounding context.
Underneath, one deterministic pipeline parses every supported trace into the same turn-and-block shape, chunks it, embeds it with a pinned local model, and writes it to a local Lance dataset. A query combines vector and BM25 search, fuses their rankings, reranks the candidates with a cross-encoder, reweights them by recency, and attaches neighboring chunks.
That design gives funes three important properties:
- One memory across agents: Claude Code, Codex, pi, and Hermes all write to the same shape.
recallspans their histories, and every hit says which agent produced it. - Raw evidence stays intact: Nothing is distilled into a fact at write time. A result can always lead back to the turn that produced it.
recallis local by default: No account or Hub repository is required. A hosted model does not process your sessions for indexing; embedding and reranking run on your machine, and your coding agent does the reasoning.
The agent as a stranger problem is already solved on one machine. But memory gets more useful when the next agent is running somewhere else.
A memory is a dataset, not a service
To make a memory follow your work, bind one when you add funes to an agent:
funes add codex acme/funes-memory
The bind publishes your current memory there. funes then keeps it current, indexing each turn locally and publishing at session boundaries. The agent recalls from it throughout. Run the same command on another machine and the memory follows you there.
Underneath, the local memory is a Lance dataset, and the shared memory is a Hugging Face dataset (private by default) you own.
Before anything reaches the Hub, credentials have already been redacted during indexing. Publishing then scans every chunk again and withholds anything that still looks like a secret. The scanner behind this is documented in SECURITY.md, including what it does and doesn't cover.
When an agent reads a remote memory, funes caches the dataset files locally, so warm queries return to local speed. The Hub supplies the ownership, access control, versioning, and distribution it already supplies for other datasets. Your memory does not become an account in a separate memory service, and you do not rent it back through an API.
Ask first, wire later
recall is shaped for agents. When you want to put a question to a memory yourself, use ask. It reads your local memory by default:
funes ask claude "what did we decide about the streaming parser"
Or point it at a shared memory. We published a memory of funes development, so you can ask why funes works the way it does without creating a memory of your own:
funes ask claude "why is funes append-only" --memory huggingface/funes-memory
funes askis the read-only, one-question sibling offunes add. It recalls the passages, hands them to a coding agent, and returns a grounded answer that names its sources. It does not install an integration or change the agent's persistent setup.
A retrieval miss is not papered over. If the passages do not support an answer, the agent says so. You can rephrase the question or add funes to the agent so it can search the memory iteratively during normal work.
Switching agents without losing the thread
A shared memory is not tied to the agent or model that created it. Start a task in Claude Code, continue it in Codex next week, and the second agent can recall the first agent's reasoning. Use pi with a local model or one served through the Hugging Face router, then return to Claude.
Claude makes a decision; a hook indexes it; Codex recalls it in another session. The older hits in the demo are earlier recordings of the same experiment: an append-only memory remembered the rehearsals too.
This matters in a few different scopes:
- Across your machines: Bind each agent to one memory and recall the history from whichever host you are using.
- Across a team: A new teammate's agent can retrieve months of decisions on day one, including dead ends and rationale that never made it into a pull request.
- Alongside an open-source project: A maintainer can publish the sessions behind a release, naming them on the push. Think of it as a searchable
CLAUDE.mdthat holds the history of why the project is the way it is, instead of a page someone must keep rewriting. Anyone can read a public memory with--memory.
Published memories carry a dataset card and the funes tag, making them recognizable and discoverable on the Hub. The Hub already hosts open weights and datasets. funes adds open working memory. It holds the decisions, failed approaches, and rationale behind a project, queryable by another agent and traceable to the sessions that produced them.
The cheapest way out of a long session
A long investigation bloats a session until each turn costs more to carry the context than to do the work. The usual answers are to let the agent compact and carry on, or to write a handoff and start fresh. Recall is a third, so we measured them against each other on the handoff-vs-recall benchmark: two tasks whose answer cannot be reconstructed without the session prior knowledge.
Compaction is what most agents do by default, and it was the only one of the three whose result divided: it arrived on one task and never arrived on the other. Where it failed, its summary had flattened the findings that mattered. Recall returns the passages themselves, so a finding does not have to survive summarization.
Recall was the cheapest of the three on both tasks, 8x cheaper than a written handoff on one and 4x on the other.
The lighter segment of each bar is the one-time charge for preparing the channel, the handoff or the compaction, paid before the first question is asked and counted once. A cross marks a channel that never arrives, and so has no cost per success.
Stop starting from zero
“To think is to forget differences, generalize, make abstractions.” — Jorge Luis Borges, Funes the Memorious
Your agents already wrote the record. funes lives at github.com/huggingface/funes, one command away from turning that record into a memory the next agent can read, on whichever machine you happen to be on.
Built on open source
funes invents little of this. It leans on open-source embedding models good enough to run locally, on Lance's append-only datasets with cheap incremental writes, and on the Hub's caching and content-dedup for datasets. The work is in fitting them into a memory an agent can actually use.
funes is open source too. Open an issue for anything from an install snag to a recall that missed, or an agent you'd like supported.



