Concepts & guides

How dig works under the hood — hybrid retrieval, the content-addressed store, drift, reversibility — and how to drive it from your stack.

What is agent memory? Capture and recall, explained

Agent memory is the loop that lets an AI agent remember across sessions — capture what happened, recall the relevant slice later. Here is how dig implements it locally and reversibly.

Content-addressed store — BLAKE3 blobs, manifests, and free dedupe

dig stores file content as BLAKE3-keyed blobs and snapshots the tree as immutable manifests. The search index is a derived view rebuilt by scan, and deduplication falls out of content-hashing for free.

Drift detection — reconstructing the human changeset from disk

dig diffs the live disk against its last manifest to reconstruct what a human did between runs. dig drift reports misfiled, misnamed, duplicated, and unsorted files; reconcile converges desired state with actual.

Hybrid retrieval — FTS + vector search, fused with RRF

dig combines deterministic full-text search with semantic vector search using Reciprocal Rank Fusion. The result beats the published memory-benchmark bar — 98% hit@5 on LongMemEval, fully local on CPU.

Local-first AI — sovereign retrieval that never phones home

dig runs fully on your machine. With no configured endpoint it makes zero network calls, your data never leaves the device, it is self-hostable, and there is no vendor lock-in.

dig Python SDK — dig-client

Search, recall, retain, organize, and export a local dig knowledge base from Python over the dig serve daemon. Standard-library only, local-first, reversible.

recall@k and hit@k — the IR metrics dig reports

recall@k, hit@k, and hit@5 are standard information-retrieval metrics for ranked search. dig scores 98.0% hit@5 on the full LongMemEval set, fully local on CPU, beating the published 96.6% bar.

Reversible changesets — the journaled spine of dig

Every dig mutation is a journaled changeset — preview as a dry run, apply atomically, then dig undo restores byte-identical prior state. Reversibility is the spine, including AI- and auto-applied changes.

dig TypeScript SDK — @vllnt/dig

Search, recall, retain, organize, and export a local dig knowledge base from TypeScript over the dig serve daemon. Dependency-free (native fetch), typed, local-first, reversible.

Use dig as agent memory in the Vercel AI SDK

Wire dig into the Vercel AI SDK as tools — your agent searches a local knowledge base, recalls budgeted memory, and remembers across sessions, all over a local dig serve daemon. Reversible, no vector service.

What is MCP (Model Context Protocol)? And how dig uses it

MCP is the open protocol that lets AI agents talk to tools and data over a standard interface. dig ships an MCP server so any compatible agent can drive a knowledge base.