ByteRover: Agent-Native Memory Through LLM-Curated Hierarchical Context
Organizations: ByteRover
Abstract
Memory-Augmented Generation (MAG) extends large language models with external memory to support long-context reasoning, but existing approaches universally treat memory as an external service that agents call into, delegating storage to separate pipelines of chunking, embedding, and graph extraction. This architectural separation means the system that stores knowledge does not understand it, leading to semantic drift between what the agent intended to remember and what the pipeline actually captured, loss of coordination context across agents, and fragile recovery after failures. In this paper, we propose ByteRover, an agent-native memory architecture that inverts the memory pipeline: the same LLM that reasons about a task also curates, structures, and retrieves knowledge. ByteRover represents knowledge in a hierarchical Context Tree, a file-based knowledge graph organized as Domain, Topic, Subtopic, and Entry, where each entry carries explicit relations, provenance, and an Adaptive Knowledge Lifecycle (AKL) with importance scoring, maturity tiers, and recency decay. Retrieval uses a 5-tier progressive strategy that resolves most queries at sub-100 ms latency without LLM calls, escalating to agentic reasoning only for novel questions. Experiments on LoCoMo and LongMemEval demonstrate that ByteRover achieves state-of-the-art accuracy on LoCoMo and competitive results on LongMemEval while requiring zero external infrastructure, no vector database, no graph database, no embedding service, with all knowledge stored as human-readable markdown files on the local filesystem.
Figures & tables
| Operation | Behavior |
|---|---|
| ADD | Create new entry; auto-generate context.md at each hierarchy level |
| UPDATE | Replace content of an existing entry |
| UPSERT | Add if new, update if exists (reduces pre-check overhead) |
| MERGE | Combine two entries intelligently; delete the source |
| DELETE | Remove a single entry or an entire subtree |
| Tier | Mechanism | Latency | Condition |
|---|---|---|---|
| 0 | Exact cache hit | 0 ms | Hash match + valid fingerprint |
| 1 | Fuzzy cache (Jaccard) | 50 ms | Jaccard |
| 2 | Direct MiniSearch | 100 ms | BM25 score , sufficient gap |
| 3 | Optimized LLM call | 5 s | BM25 score |
| 4 | Full agentic loop | 8–15 s | All other queries |
| Method | Single-Hop | Multi-Hop | Open-Domain | Temporal | Overall |
|---|---|---|---|---|---|
| HonCho | 93.2 | 84.0 | 77.1 | 88.2 | 89.9 |
| Hindsight | 86.2 | 70.8 | 95.1 | 83.8 | 89.6 |
| Memobase | 70.9 | 46.9 | 77.2 | 85.1 | 75.8 |
| Zep | 74.1 | 66.0 | 67.7 | 79.8 | 75.1 |
| Mem0 | 67.1 | 51.2 | 72.9 | 55.5 | 66.9 |
| OpenAI Memory | 63.8 | 42.9 | 62.3 | 21.7 | 52.9 |
| Method | KU | SSU | SSA | SSP | TR | MS | Overall |
|---|---|---|---|---|---|---|---|
| Chronos † | 96.2 | 94.3 | 100.0 | 80.0 | 90.2 | 91.7 | 92.6 |
| Hindsight | 94.9 | 97.1 | 96.4 | 80.0 | 91.0 | 87.2 | 91.4 |
| HonCho | 94.9 | 94.3 | 96.4 | 90.0 | 88.7 | 85.0 | 90.4 |
| SmartSearch † | 93.6 | 100.0 | 85.7 | 96.7 | 82.7 | 84.2 | 88.4 |
| Memora † | 97.4 | 98.6 | 78.6 | 83.3 | 89.5 | 78.2 | 87.4 |
| TiMem † | 87.7 | 96.3 | 85.7 | 55.3 | 73.4 | 72.8 | 79.0 |
| Metric | LoCoMo | LongMemEval-S |
|---|---|---|
| Context tree size | 272 docs | 23,867 docs |
| Total queries | 1,982 | 500 |
| Cold query latency p50 | 1.2 s | 1.6 s |
| Cold query latency p95 | 1.4 s | 2.3 s |
| Cold query latency p99 | 1.7 s | 2.5 s |
| Configuration | KU | SSU | SSA | SSP | TR | MS | Overall | |
|---|---|---|---|---|---|---|---|---|
| w/o Tiered Retrieval | 69.2 | 71.4 | 76.8 | 83.3 | 61.7 | 47.4 | 63.4 | 29.4 |
| w/o OOD Detection | 98.7 | 98.6 | 98.2 | 96.7 | 89.5 | 85.0 | 92.4 | 0.4 |
| w/o Relation Graph | 98.7 | 98.6 | 98.2 | 96.7 | 89.5 | 85.0 | 92.4 | 0.4 |
| ByteRover (Full) | 98.7 | 98.6 | 98.2 | 96.7 | 91.7 | 84.2 | 92.8 | — |
Appendix figures & tables2 assets
Supplementary material from the paper’s appendix.
Appendix
| Module | Parameter | Value |
| Search Index | MiniSearch version | v7 |
| Fields | title ( ), content ( ), path ( ) | |
| Max retrieval results | 32 | |
| Max content length | 8,000 chars | |
| Search Config | Fuzzy ratio | 0.2 |
| Prefix matching | enabled |
LLM Agent Memory
Large language model agent memory lets agents retain, organize, retrieve, and update information across interactions and long-running tasks.
See all 373 papers