Skip to content

Back to the catalog

Give Your Coding Agents a Memory You Own
huggingface.coarticle

Give Your Coding Agents a Memory You Own

funes is an open-source, single-binary memory layer that turns the session traces of coding agents (Claude Code, Codex, Pi, Hermes) into a durable, queryable memory instead of an unsearchable archive. It runs locally by default — chunking, embedding and reranking turns with a pinned local model into a Lance dataset, combining vector and BM25 search with cross-encoder reranking and recency weighting — and can optionally sync to a private-by-default Hugging Face dataset so a memory follows a user across machines or is shared across a team, with credential redaction before publishing. The post also reports a "handoff-vs-recall" benchmark showing recall from raw traces is cheaper and more reliable than context compaction or written handoffs for resuming long investigations.

TL;DR funes gives Claude Code, Codex, Pi and Hermes a local-first, optionally HF-hosted memory built from their own session traces, retrieved via hybrid vector+BM25 search with reranking.
Document

What it claims

funes is a single binary that indexes the session traces of Claude Code, Codex, pi and Hermes into one local memory. It gives the agent recall and get tools. recall returns original turn text, not summaries, and each hit carries its provenance: agent, timestamp, session and turn. On the authors' handoff-vs-recall benchmark, recall was the cheapest way to resume a long investigation. It was 8x cheaper than a written handoff on one task and 4x on the other. Compaction never arrived at the answer on one of the two tasks.

How it works

The default inference backend has no ML runtime dependency. All supported trace formats are parsed into one turn-and-block shape, then chunked and embedded with a pinned local model into an append-only Lance dataset. A hook indexes each completed turn incrementally, and older history backfills in bounded steps. Nothing is distilled into facts at write time.

flowchart LR
  T[Agent traces] --> P[Parse, chunk, embed locally]
  P --> R[Redact credentials]
  R --> L[(Local Lance dataset)]
  L -->|optional bind| S[Re-scan; withhold secrets]
  S --> H[(Private HF dataset)]
  Q[Query] --> V[Vector search]
  Q --> B[BM25]
  V --> F[Fuse rankings]
  B --> F
  F --> X[Cross-encoder rerank] --> W[Recency weight + neighbor chunks]
  L --> V
  L --> B

If a memory is bound to the Hub, funes publishes at session boundaries. Remote reads are cached locally, so warm queries run at local speed.

Evidence

The benchmark had two tasks whose answers require the prior session's knowledge. It compared three ways to continue: compaction, a written handoff, and recall.

  • Compaction succeeded on one task and failed on the other. Its summary had flattened the findings that mattered.
  • Recall was cheapest on both tasks: 8x and 4x cheaper than the handoff.
  • Cost accounting includes the one-time preparation of the handoff or compaction.

The page gives no absolute costs, model names or run counts.

How to use it

curl -fsSL https://huggingface.co/buckets/huggingface/funes/resolve/install.sh | sh
funes add claude    # or: codex, pi, hermes

Bind a shared memory, which is private by default. Running the same command on another machine attaches that machine to the same memory:

funes add codex acme/funes-memory

Ask a one-off question without installing an integration:

funes ask claude "what did we decide about the streaming parser"
funes ask claude "why is funes append-only" --memory huggingface/funes-memory

huggingface/funes-memory is a public memory of funes's own development. Published memories get a dataset card and the funes tag. The source is at github.com/huggingface/funes.

Limits

  • The benchmark covers only two tasks and reports relative cost multiples, not absolute figures.
  • Secret redaction is pattern-based. SECURITY.md documents what it does and does not cover. Read it before binding a team or public memory, since publishing to the Hub exposes session content to anyone with access.
  • The memory is append-only, so stale or superseded decisions remain retrievable. Recency weighting is the only stated mitigation.
  • On a retrieval miss, ask reports that it found no supporting passages rather than answering.
  • Only four agents are supported.
  • The page gives no licence and does not name the embedding or reranker models.

Organisations named here

  • Hugging Face
  • GitHub
  • handoff-vs-recall benchmark
  • Jorge Luis Borges

Technologies named here

  • funes
  • Claude Code
  • Codex
  • pi
  • HERMES
  • Lance
  • Hugging Face Hub
  • Hugging Face
  • BM25

Techniques named here

  • recall
  • ask
  • compaction
  • handoff
  • incremental indexing
  • credential redaction and secret scanning