Attention-native retrieval for AI agents

Attemory indexes long memory, documents, and codebases into reusable KV state, then retrieves evidence through model attention instead of vector similarity.

These SOTA-class results are not marketing slogans: they are locally reproducible, with no benchmark-specific hacks. See details.

Different Retrieval Primitive

Retrieval by attending. Search with reasoning.

Instead of compressing each chunk into a fixed vector before the query is known, Attemory lets the query interact with model-readable memory at retrieval time.

Query-time attention

The local retrieval model attends over the original memory text and the query, so token-level details, relationships, names, dates, and code identifiers stay available.

Reusable local KV

Raw corpora are prefilled once into reusable KV cache. Later searches restore cached attention state locally, so repeated retrieval avoids replaying the corpus from scratch.

Decode-free retrieval

Search does not generate tool calls, reasoning traces, or answers token by token. The query runs as a prefill over restored memory state, and the ranking comes back directly.

Query-context steering

Request-time query context can define what kind of evidence matters, such as definitions, call sites, temporal facts, or table relationships, without changing the indexed corpus.

Interactive Explorer

Table understanding andreasoning, made visible.

Attemory table understanding example Attemory incident root-cause retrieval example Attemory temporal reasoning retrieval example

The explorer visualizes real Attemory search runs over a diary, a table, and an incident timeline. It shows how query context can shift retrieval, how a table cell can be found from row and column context, and how an incident query can trace a symptom back to a root cause.

Interactive Examples

Agent Token Savings

Give Claude Codea better starting point.

On SWE-QA1, Attemory changes only the initial context: the same downstream Claude Code setup receives one semantic-search hint before it starts repository exploration.

System Judge score Total tokens Main-agent tokens Subagent tokens Turns Tool calls Cost estimate2
Baseline 83.39 285.39M 122.60M 162.80M 10,491 26,997 $453.47
Attemory hint 83.17 160.39M 86.60M 73.79M 8,765 17,340 $296.68
Change -0.23 -43.8% -29.4% -54.7% -16.5% -35.8% -34.6%

1 SWE-QA is an end-to-end repository question-answering benchmark; this comparison covers 15 repositories and 720 paired questions. 2 Cost estimate is the total_cost_usd value emitted by Claude Code in the final stream-json result event.

SOTA Retrieval Quality

Benchmark-backed resultsacross memory and code.

High recall is what makes token savings usable. Attemory reaches SOTA-class results across long conversations, million-token memory, and multi-language codebases. LongMemEval-M is notable: its context is long enough that few memory systems evaluate on it, while Attemory reaches SOTA Recall_all.

LongMemEval-S

What It Tests
Memory retrieval, the split most memory systems evaluate.
Context Size
about 40 sessions / 115k tokens
Attemory Result
98.72% session Recall_any@5 92.77% session Recall_all@5 98.94% message-level Recall_all@50

LongMemEval-M

What It Tests
Million-token memory retrieval, a scale few memory systems attempt.
Context Size
about 500 sessions / 1.5M tokens / 5k messages
Attemory Result
94.89% session Recall_any@5 83.62% session Recall_all@5 92.55% message-level Recall_all@50

LoCoMo

What It Tests
End-to-end long-conversation QA.
Context Size
10 long conversations / 1,540 QA items
Attemory Result
94.52% accuracy with GPT-4.1-mini as answer model and GPT-4o-mini as judge

Semble

What It Tests
Code retrieval.
Context Size
63 repos / 19 languages / largest repo about 5M indexed tokens
Attemory Result
0.9055 file-level NDCG@10

The results above come from reproducible local benchmark runs on raw corpora and raw benchmark queries, without query rewriting, summarization-as-storage, agent-driven exploration, BM25/vector hybrid stacks, or cloud retrieval services. See the benchmarks for details.

Use Attemory Your Way

Use the engine directly, orstart with repository search.

Install Attemory

Choose the runtime for your machine. The same targets work with pip; CUDA 12.6 is the default Linux CUDA wheel index.

# macOS Apple Silicon, includes Metal runtime
uv pip install attemory

# Linux CPU
uv pip install "attemory[cpu]"

# Linux CUDA
uv pip install "attemory[cuda]" \
  --extra-index-url https://attemorysystem.github.io/attemory/whl/cu126/
Install docs

Retrieval Engine

Use Python or HTTP APIs for long memory, documents, benchmark adapters, and custom applications.

attemory-server --small --backend gpu --port 9006

python - <<'PY'
from attemory import AttemoryClient
client = AttemoryClient(port=9006)
client.add_memory("The deploy freeze starts at 18:00 UTC.")
print(client.search("When does the deploy freeze start?"))
PY
Docs for details

Repository Search

Index a codebase once, reuse the saved session across many questions, and return file/range evidence from the CLI or Claude Code plugin.

# CLI usage
atcode init
atcode index
atcode search "where is session restore implemented"

# Claude Code plugin
claude plugin marketplace add AttemorySystem/attemory-claude-code
claude plugin install attemory-code@attemory
claude -p "Use attemory-code search to find where session restore is implemented. Explain the control flow and key files in detail."
Docs for details