Every developer using an AI coding agent has encountered the same wall. You spend hours in a deep session, navigating a complex codebase and making a series of critical architectural decisions. A week later, you return to the project, but the context window has cleared or the session has grown too bloated to be performant. You find yourself scrolling through thousands of lines of session logs, searching for the specific reason why a certain function was refactored or why a particular library was rejected. In this moment, the session log is not a tool but a graveyard of information, where the reasoning behind a decision is buried under a mountain of repetitive dialogue turns.
The architecture of a zero-dependency memory layer
funes transforms these static log archives into a dynamic, real-time memory layer. Rather than treating execution traces as simple text files, funes indexes these local traces so that an agent can autonomously retrieve the rationale behind its own past decisions. This shift allows developers to stop repeating the same mistakes and instead enable their agents to instantly recall the reasoning from previous sessions and apply it to the current task.
From a deployment perspective, funes is designed for maximum portability. It is distributed as a single binary with zero dependencies on an ML runtime. This means developers do not need to configure heavy libraries or manage complex environments to get started. All critical operations, including the embedding process that converts text into numerical vectors and the reranking process that prioritizes search results, happen entirely on the user's local device. The system currently provides native support for prominent coding agents including Claude Code, Codex, pi, and Hermes. While it operates locally by default, users can choose to migrate their memory to Hugging Face datasets, which are set to private by default to ensure data sovereignty.
Integrating this memory capability into an existing agent workflow requires only a single command:
funes addOnce executed, the system builds its first index and equips the agent with two specialized tools: `recall` and `get`. The `recall` tool is used to recover specific fragments of text generated in the past, while `get` allows the agent to examine the full content of a conversation turn along with its surrounding context. To ensure the memory remains current, funes implements an automated indexing mechanism that triggers at the end of every task turn, weaving the memory update directly into the agent's standard operational flow.
To prevent performance degradation as logs grow, funes utilizes an incremental indexing strategy. Instead of reprocessing the entire history, it only adds new execution results. This prevents embedding costs from increasing linearly with the size of the archive. For older records or deeper layers of content, the system employs a sequential backfill process. This append-only structure ensures that even the earliest rehearsal records are preserved, maintaining a continuous chain of reasoning. The project is available as open source at github.com/huggingface/funes.
Why raw recall beats session compaction
The technical core of funes relies on a hybrid pipeline that balances speed and precision. For local storage, it uses the Lance dataset, a columnar data store that minimizes write costs. Every trace is parsed through a deterministic pipeline into consistent turns and blocks, which are then split into smaller units through a chunking process. These chunks are vectorized using a local embedding model and stored in an append-only structure, allowing for efficient writes even when dealing with tens of thousands of session logs.
Retrieval is handled through a combination of vector search and BM25 keyword search to ensure no critical information is missed. The results from these two methods are merged and then passed through a cross-encoder, which directly calculates the relevance between the query and the document to refine the ranking. A recency weight is then applied, ensuring that the most recent decisions take precedence over outdated context. Finally, the system extracts not just the target passage but also the adjacent chunks, providing the agent with enough surrounding context to avoid fragmented understanding.
For those needing to synchronize memory across machines, funes leverages Hugging Face datasets. Users can publish and synchronize their local memory to a remote repository using the following command:
funes bind [HF_DATASET_NAME]This command triggers the automatic publication of indexed content at every session boundary. To maintain speed, remote memory files are stored locally using Hugging Face's caching and content-deduplication features, eliminating network latency during queries. Security is handled by an automated detection layer that identifies and strips credentials and API keys during both the indexing and publication phases. This transforms the memory from a private log into an open working memory where the logic behind failed attempts and successful pivots is preserved and traceable.
The most significant insight provided by funes is the failure of session compaction. Most coding agents currently rely on compaction, where the agent summarizes the conversation to save space. However, the handoff-vs-recall benchmark reveals a critical flaw: compaction often flattens essential technical details, leading to failure in complex tasks. In tests consisting of two interdependent tasks, session compaction failed to solve the second task because the necessary technical discoveries were lost during summarization. In contrast, the recall mechanism returns the original, raw text passages. By bypassing the summarization filter, the agent retains access to the exact details required to complete the work.
This architectural choice results in massive cost savings. Recall is up to 8 times cheaper than manual handoffs in certain tasks and 4 times cheaper in others. In long-running sessions, the cost of feeding the entire context window into a model often exceeds the cost of the actual computation required to find the answer. By calling only the necessary raw passages and using the `get` command to expand context only when needed, funes eliminates the need for expensive, lossy summaries.
Cross-model memory and the end of context silos
Because funes separates the memory layer from the model and the machine, it enables a level of interoperability previously unavailable in AI development. A decision made by Claude Code on a Monday can be recalled by Codex on a Friday, regardless of the hardware being used. The memory is no longer a property of the model's context window but an independent infrastructure layer. By utilizing the existing Hugging Face Hub for versioning, access control, and deployment, users avoid the need for separate memory service accounts or expensive API leases.
Furthermore, funes allows for ad-hoc memory queries without altering the agent's permanent configuration. The `funes ask` command serves as a read-only interface to the memory layer:
funes ask [question]This tool extracts relevant passages from local or shared memory and presents them to the agent as grounded evidence. If the retrieved information is insufficient to answer the question, the agent is programmed to explicitly state that the information is missing rather than hallucinating a response. This grounding ensures that the agent's output is always tied to a verifiable session record.
This capability extends to collaborative environments. The funes development team has released the shared memory of their own development process, allowing anyone to query the reasoning behind the tool's design. This removes the friction of manually copying and pasting context between sessions or trying to remember the specifics of a design meeting from weeks prior. The agent simply accesses the memory, identifies the correct session, and provides an answer backed by a deterministic trail of evidence.
Moving away from destructive session compression toward a high-precision recall mechanism is the only viable path for scaling autonomous coding agents. By reducing costs by up to 8x while increasing factual accuracy, funes establishes a blueprint for how AI agents can maintain a persistent, professional memory across different models and environments.




