Back to News Feed
Hugging Face Blog1d ago

Give Your Coding Agents a Memory You Own

For developers who operate across multiple machines and juggle various AI coding assistants, the current state of AI workflows is fundamentally fragmented. Every time you switch environments or start a new session, your coding agent greets the project as a total stranger. The nuanced reasoning, the trial-and-error process, and the "why" behind a specific architectural choice from last Tuesday vanish the moment the session terminates. Each new agent, on each new host, is forced to start from zero.

Earlier this year, the industry began to recognize that coding agents are already generating the very records we are currently losing. As these models navigate a codebase, experiment with different approaches, encounter errors, consult documentation, and pivot strategies, they leave behind a dense, rich account of their work. However, while this diagnosis is accurate, these traces are merely potential memory. Raw session logs are essentially a digital graveyard; you cannot simply "grep" your way through ten thousand turns to uncover the rationale behind a specific decision, such as why a team moved away from a streaming parser.

For an agent to effectively leverage these traces during active development, it requires a sophisticated layer of indexing, retrieval, ranking, and exact provenance. This is the void that funes fills.

Introducing Funes: A Durable Memory Layer

funes is designed as a durable, persistent memory layer for your existing coding agents, including Claude Code, Codex, pi, and Hermes. Rather than requiring a new platform, it is built directly from the sessions already residing on your machine. It functions locally and integrates into your existing agent workflow with a single command. Furthermore, when you choose to scale, it can synchronize with a Hugging Face dataset that you own and control, remaining private by default.

Key Features of the Funes Architecture

  • Local-First Design: funes is a single binary. Its default inference backend operates without any ML runtime dependencies, ensuring that embedding and reranking occur entirely on your local hardware.
  • Seamless Integration: A simple funes add [agent] command builds your initial index, provides the agent with recall and retrieval tools, and installs the automation necessary to index every completed turn.
  • Incremental Indexing: The system is designed for efficiency; it indexes new runs by adding new turns rather than re-embedding your entire history. Older, deeper content is backfilled in bounded, manageable steps.
  • Grounded Recall: When a task touches on a past decision or finding, the agent can autonomously reach for its memory. It does not require you to manually remember old sessions or paste context into new ones. The agent retrieves the original text—not a summary—and provides exact provenance, including the agent name, timestamp, session ID, and specific turn.

The Technical Mechanics of Recall

Under the hood, funes employs a deterministic pipeline that parses every supported trace into a standardized "turn-and-block" shape. This data is then chunked, embedded using a pinned local model, and written to a local Lance dataset.

The retrieval process is equally robust. A query combines vector search with BM25 (Best Matching 25) search, fuses the rankings, reranks the candidates using a cross-encoder, reweights them based on recency, and attaches neighboring chunks for context. This architecture provides three critical advantages:

1. Unified Memory Across Agents: Whether you use Claude Code, Codex, pi, or Hermes, all write to the same format. Recall spans the history of all these agents, and every result explicitly identifies which agent produced the insight. 2. Raw Evidence Preservation: Nothing is distilled into a "fact" at write time. Because the raw evidence remains intact, a result can always be traced back to the exact turn that generated it. 3. Privacy by Default: No account or external repository is required for local use. Because embedding and reranking happen on your machine, your coding agent handles the reasoning without your sessions being processed by a third-party hosted model.

Memory as a Portable Dataset

The "agent as a stranger" problem is easily solved on a single machine, but memory becomes exponentially more valuable when your work follows you to different environments. funes treats memory as a dataset rather than a service.

By binding a memory during the addition process—funes add codex acme/funes-memory—you publish your current memory to a private Hugging Face dataset. funes keeps this dataset current, indexing turns locally and publishing at session boundaries. If you run the same command on a different machine, your memory follows you.

"Your memory does not become an account in a separate memory service, and you do not rent it back through an API. The Hub supplies the ownership, access control, versioning, and distribution it already supplies for other datasets."

Before any data reaches the Hub, funes performs a security scan to redact credentials during the indexing phase. The system is designed to withhold any information that appears to be a secret, with the scanning logic documented in the project’s SECURITY.md. When an agent reads a remote memory, funes caches the dataset files locally, ensuring that warm queries maintain local-speed performance.

Beyond Automation: The 'Ask' Command

While funes is designed to work autonomously, it also provides an ask command for direct human-to-memory interaction. If you want to query your memory without installing an integration or altering your agent’s persistent setup, you can simply run:

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

This command recalls the relevant passages, hands them to a coding agent, and returns a grounded answer that cites its sources. Importantly, funes does not paper over retrieval misses. If the retrieved passages do not support an answer, the agent is instructed to state that clearly, allowing you to rephrase the query or integrate funes more deeply into the agent for iterative searching.

Breaking the Cycle of Starting from Zero

One of the most significant benefits of funes is the ability to switch agents without losing the thread of development. You can start a task in Claude Code, continue it in Codex the following week, and the second agent will be able to recall the reasoning of the first. This capability has profound implications across different scopes:

  • Across Machines: Bind each agent to a single memory and recall history from whichever host you are currently using.
  • Across Teams: A new developer’s agent can retrieve months of project decisions on their first day, including the dead ends and rationale that never made it into a formal pull request.
  • Open-Source Maintenance: A maintainer can publish the sessions behind a release, effectively creating a "searchable CLAUDE.md" that holds the history of why a project is structured the way it is, rather than relying on a static document that is rarely updated.

Efficiency: The Handoff vs. Recall Benchmark

Long investigations often lead to session bloat, where the cost of carrying context becomes prohibitive. Developers typically choose between letting the agent compact its history or manually writing a handoff to start fresh. funes introduces "Recall" as a superior third option.

In benchmark testing, compaction often failed because the summarization process flattened the critical findings. In contrast, funes returns the original passages, ensuring that findings are not lost to distillation. Furthermore, funes proved to be the most cost-effective solution, performing up to 8x cheaper than a written handoff in specific tasks.

Conclusion: A New Standard for Coding Agents

As Jorge Luis Borges once wrote, "To think is to forget differences, generalize, make abstractions." However, in the context of software engineering, forgetting is often the enemy of progress.

funes is built on the foundation of open-source tools—leveraging local embedding models, Lance’s append-only datasets, and the Hugging Face Hub’s caching mechanisms. By fitting these pieces into a cohesive memory layer, it allows your agents to stop acting like strangers and start acting like long-term collaborators.

The record of your work already exists; funes simply provides the tools to turn that record into a functional, queryable memory. The project is available now at github.com/huggingface/funes, ready to be integrated into your workflow with a single command.

#agents