Memory & RAG
~8 min readUpdated: December 2026

TesseraKV: Covariance-Weighted KV Paging via Co-Retrieval for 128K Agents

TesseraKV Covariance-Weighted KV Paging Architecture for Agentic LLMs

TesseraKV (arXiv:2611.38220) unifies KV-cache page construction and page scoring under a single co-retrieval objective—grouping keys whose attention logits co-vary under the head's query covariance—lifting 131K-context Claw-Eval agent success from 42.58% (LouisKV) to 70.32% at B=128 while reaching 3,418 tokens/s on B200 CPU offloading.

Technical Review: Smoke Monkey Core Architecture Team
Tested on Node.js 18+ & BunTypeScript 5.x
Quick Answer & Executive Definition

TesseraKV: Covariance-Weighted KV Paging via Co-Retrieval for 128K Agents: TesseraKV (arXiv:2611.38220) unifies KV-cache page construction and page scoring under a single co-retrieval objective—grouping keys whose attention logits co-vary under the head's query covariance—lifting 131K-context Claw-Eval agent success from 42.58% (LouisKV) to 70.32% at B=128 while reaching 3,418 tokens/s on B200 CPU offloading. Designed as a zero-dependency, open-source TypeScript architecture under the MIT License with native Model Context Protocol (MCP) support and deterministic phase state machines.

Key Architectural Takeaways
Quick Implementation Exampletesserakv-long-horizon-agent.ts
tesserakv-long-horizon-agent.tstypescript
import { createAgent } from '@smoke-monkey/harness';
const memoryDenseAgent = createAgent({
agentId: 'tesserakv-131k-agent',
provider: 'openai-compatible',
model: 'Muse-Glimmer-30B',
baseUrl: 'http://127.0.0.1:8000/v1',
workspacePath: process.cwd(),
permissions: {
read_file: 'allow',
write_file: 'allow',
run_command: 'ask',
},
});
async function executeMultiTurnWorkflow() {
const result = await memoryDenseAgent.run(
'Cross-reference 100K tokens of API traces, database schemas, and test logs to isolate the race condition.'
);
console.log('TesseraKV Agent Result:', result.summary);
}
executeMultiTurnWorkflow().catch(console.error);
Video Guides

Watch: Related Video Guides

PagedAttention: Behind vLLM's Insane Speed

The KV Cache: Memory Usage in Transformers

What Is TesseraKV? Solving the Paging-vs-Scoring Mismatch

TesseraKV (arXiv:2611.38220) is a KV-cache paging and sparse retrieval algorithm that derives both page partitioning and page scoring from one mathematical objective: co-retrieval likelihood. Keys are grouped into the same memory page when their attention logits co-vary under a head's query distribution, measured in covariance-weighted geometry.

Earlier KV paging engines like ArkVale and Quest partition keys by contiguous token order or uncalibrated Euclidean clustering, then score pages with bounding boxes that inflate as unrelated keys sit in the same page. TesseraKV estimates query covariance from opening prefill queries (Sigma_ctx) combined with per-turn instruction queries (Sigma_qst) and applies a spread-aware Gaussian score so every fetched page transfers dense attention mass.

RULER & 131K Claw-Eval Benchmarks Across KV Budgets

On Muse-Glimmer-30B evaluated across 155 agentic tasks in Claw-Eval (131,072-token window, strict 3-of-3 trial pass criterion), TesseraKV outperforms every prior KV retrieval baseline across all budgets B from 64 to 512 tokens per KV head.

Method (Muse-Glimmer-30B)B=64 OverallB=128 OverallB=256 OverallB=512 OverallRULER-16K Avg
FullCache (Upper Bound)76.77%76.77%76.77%76.77%94.52%
ArkVale12.90%33.55%65.16%71.61%31.46%
LouisKV20.65%42.58%66.45%72.26%63.42%
TesseraKV56.13%70.32%72.90%74.84%74.41%

At B=128 (4x smaller than B=512), TesseraKV reaches 70.32% overall success—within 6.45 points of FullCache (76.77%) and +27.74 points ahead of LouisKV (42.58%). On CPU-offloaded B200 decoding over PCIe 5.0 with a 768-key GPU wave buffer, TesseraKV (B=128) hits 3,418 tokens/s at batch size 128 (+15% over LouisKV B=512 at 2,962 tokens/s) and trims per-step latency by 13%.

Include Turn Instructions in Query Covariance Estimation

Estimating query covariance solely from opening context queries is task-dependent. Updating Sigma_qst once per turn from downstream instruction tokens aligns page clustering with actual tool-retrieval queries.

Calculating Agent KV Offload Bandwidth & Page Budget Savings

In a 131K-token agent session, fetching B=128 tokens per KV head instead of B=512 cuts PCIe host-to-GPU KV traffic by 4x per layer while keeping 3-trial Claw-Eval reliability above 70%. Below is a quick Python calculation and reproduction check for sizing wave buffers and page budgets.

python
# Compare PCIe 5.0 KV transfer volume per token step at 131K context
num_layers, kv_heads, head_dim, bytes_per_elem = 48, 4, 128, 2  # BF16
for budget in [512, 256, 128, 64]:
    bytes_per_step = num_layers * kv_heads * budget * head_dim * 2 * bytes_per_elem
    print(f"Budget B={budget:3d} -> {bytes_per_step / (1024**2):6.2f} MiB transferred/step")

Powering Long-Context Tool Memory in Smoke Monkey

Long-horizon agents inside Smoke Monkey Canvas frequently revisit earlier tool outputs, stack traces, and schema definitions scattered across 100K+ tokens. Pairing TesseraKV page retrieval with structured turn prompts ensures that co-referenced tool responses land in the same covariance-aligned KV pages, preserving multi-trial reliability under strict GPU VRAM caps.

Google Search Questions & Answers

Frequently Asked Questions

Q:How does TesseraKV improve over LouisKV and ArkVale on long agent tasks?

Instead of using separate heuristics for page building and scoring, TesseraKV derives both from co-retrieval under query covariance. On 131K Claw-Eval tasks at B=128, it scores 70.32% vs 42.58% for LouisKV and 33.55% for ArkVale.

Q:How fast is TesseraKV with KV CPU offloading on NVIDIA B200?

Comparing matched-accuracy configurations on Claw-Eval (TesseraKV B=128 vs LouisKV B=512) with a 768-key GPU wave buffer over PCIe 5.0, TesseraKV delivers 3,418 tokens/s at batch size 128 (+15% throughput) and 13% lower per-step latency.

Q:Does TesseraKV work on both NoPE and RoPE transformer models?

Yes. While primary benchmarks evaluate NoPE and hybrid architectures like Muse-Glimmer-30B and North-Mini-Code-30B, arXiv:2611.38220 also validates empirical gains on standard RoPE models.

Q:How does TesseraKV estimate query covariance before decoding begins?

It estimates opening-context query covariance (Sigma_ctx) once during prefill and incorporates turn-level instruction query covariance (Sigma_qst) once per turn to capture downstream retrieval geometry.

Related Alternatives & Comparisons

Related Architecture Guides

View all guides

Build with Smoke Monkey Harness

Zero dependencies. 24 built-in tools. Human-in-the-loop safety. 100% open source under the MIT License.

npm install smoke-monkey-harness