Skip to main content
Back to Blog
AI/MLProgramming LanguagesCloud Computing
1 September 20268 min readUpdated 3 September 2026

Give Coding Agents Persistent Memory You Control

Give Coding Agents Persistent Memory You Control Published September 3, 2026 Coding agents often begin every session without knowledge of previous work. This becomes especially...

By Software Development Team

Give Coding Agents Persistent Memory You Control

Published September 3, 2026

Coding agents often begin every session without knowledge of previous work. This becomes especially inconvenient when projects span multiple machines or when different agents are used for different tasks. Decisions made in one session, along with the reasoning behind them, can disappear when that session ends.

Agent traces contain much of the information needed to address this problem. As agents search codebases, test approaches, encounter errors, consult documentation, and change direction, their sessions record not only what changed but also why. However, raw traces are archives rather than usable memory. Searching thousands of turns for a question such as “why did we move off the streaming parser?” requires indexing, retrieval, ranking, and reliable provenance.

funes provides that memory layer for Claude Code, Codex, pi, and Hermes. It builds on sessions already stored on a computer, operates locally, and integrates with an agent through a single command. It can also publish memory to a Hugging Face dataset that the user owns, private by default.

Add memory to an existing agent

funes is distributed as a single binary. Its default inference backend has no ML runtime dependency, while embedding and reranking run on the local machine. Installation uses:

curl -fsSL https://huggingface.co/buckets/huggingface/funes/resolve/install.sh | sh

To add it to an agent, run:

funes add claude    # or: codex, pi, hermes

The add command creates the initial index, gives the agent recall and get tools, and installs automation that indexes each completed turn. Indexing is incremental: new sessions add new turns without embedding the entire history again. Older material can be backfilled in bounded steps.

After setup, the agent can call recall when a task depends on a previous decision, rationale, or finding. There is no need to remember the earlier session or manually paste its context into a new one.

recall returns the original text rather than a summary and identifies its source with the agent, timestamp, session, and turn. Each result also includes a get command that opens the complete turn and its surrounding context.

Under the hood, funes uses a deterministic pipeline. It parses supported traces into a common turn-and-block structure, chunks the content, embeds it with a pinned local model, and stores it in a local Lance dataset. Queries combine vector and BM25 search, fuse the rankings, rerank candidates with a cross-encoder, apply recency weighting, and attach neighboring chunks.

This design provides three main properties:

  • One memory across agents: Claude Code, Codex, pi, and Hermes use the same data shape. recall searches across their histories, and each result identifies the agent that produced it.
  • Raw evidence remains available: Information is not distilled into a fact at write time. Results can always lead back to the original turn.
  • Local operation by default: No account or Hub repository is required. Hosted models do not process sessions for indexing. Embedding and reranking run locally, while the coding agent performs the reasoning.

This addresses the problem of an agent starting as a stranger on a single machine. A shared memory can extend that continuity to other machines.

A memory is a dataset, not a service

To associate an agent with shared memory, specify a dataset when adding funes:

funes add codex acme/funes-memory

The command publishes the current memory to that dataset. funes then indexes each turn locally and publishes updates at session boundaries. The agent can recall from the memory throughout its work. Running the same command on another machine makes the memory available there as well.

The local memory is a Lance dataset, while the shared memory is a Hugging Face dataset owned by the user and private by default.

Credentials are redacted during indexing before content is sent to the Hub. Publishing scans every chunk again and withholds anything that still appears to be a secret. The scanner is documented in SECURITY.md, including its coverage and limitations.

When an agent reads remote memory, funes caches the dataset files locally, allowing subsequent queries to run at local speed. The Hub provides ownership, access control, versioning, and distribution for the dataset. The memory does not become an account in a separate memory service or require access through a dedicated memory API.

Ask questions before adding an integration

The recall command is intended for agents. To ask a question directly, use ask, which reads the local memory by default:

funes ask claude "what did we decide about the streaming parser"

A question can also target a shared memory. The published funes development memory can be queried without creating a personal memory:

funes ask claude "why is funes append-only" --memory huggingface/funes-memory

funes ask is the read-only, single-question counterpart to funes add. It retrieves relevant passages, sends them to a coding agent, and returns a grounded answer that names its sources. It does not install an integration or alter the agent's persistent configuration.

If retrieval does not provide enough evidence, the answer is not filled in with unsupported information. The agent indicates that the passages are insufficient. The question can be rephrased, or funes can be added to the agent so it can search iteratively during normal work.

Switch agents without losing context

Shared memory is not tied to the agent or model that created it. A task can begin in Claude Code and continue in Codex the following week, with Codex able to retrieve the earlier reasoning. Work can also move to pi using a local model or a model served through the Hugging Face router, and then return to Claude.

This applies at several levels:

  • Across machines: Each agent can use the same memory, allowing its history to be recalled from any host.
  • Across a team: A new teammate's agent can retrieve months of decisions, including rejected approaches and rationale that may never have appeared in a pull request.
  • Alongside an open-source project: A maintainer can publish the sessions behind a release and name them when pushing the dataset. The result is a searchable form of CLAUDE.md that preserves why a project works the way it does, rather than requiring someone to continually rewrite that history. Anyone can read a public memory with --memory.

Published memories include a dataset card and the funes tag, making them identifiable and discoverable on the Hub. The Hub already hosts open weights and datasets. funes adds open working memory containing project decisions, failed approaches, and rationale that another agent can query and trace back to the sessions that produced them.

A lower-cost alternative to carrying a long session

Long investigations can make a session increasingly expensive because every new turn must carry more context. Common approaches are to let the agent compact the session or write a handoff before starting a new one. Recall provides a third option.

These approaches were compared using the handoff-vs-recall benchmark, which contains two tasks whose answers cannot be reconstructed without prior session knowledge.

Compaction is the default behavior for many agents and was the only one of the three approaches with inconsistent results. It completed one task but failed to complete the other because its summary flattened important findings. Recall returns the passages themselves, so a finding does not need to survive summarization.

Recall was the least expensive approach on both tasks. It was 8x cheaper than a written handoff on one task and 4x cheaper on the other.

Stop starting from zero

“To think is to forget differences, generalize, make abstractions.” - Jorge Luis Borges, Funes the Memorious

Coding agents already produce a detailed record of their work. funes, available at github.com/huggingface/funes, turns that record into memory that another agent can read, including on a different machine.

Built on open source

funes combines existing open-source components. It uses embedding models that can run locally, Lance append-only datasets for inexpensive incremental writes, and the Hub's caching and content deduplication for datasets. The main implementation work is connecting these components to a memory layer that agents can query during normal operation.

funes is open source and supports issue reports ranging from installation problems to missed recalls and requests for additional agents.