HEBBS: A Self-Tuning Memory Engine for AI Agents
Parag Arora
March 2026 · hebbs.ai
Abstract
AI agents that accumulate memories over weeks face two unsolved problems: memory degrades as contradictions compound and stale facts persist, and retrieval degrades because no single configuration is optimal across query types.
Existing agent memory systems address the first problem with better search over static stores. None address the second: agents retrieve the same way regardless of what they are retrieving, with no mechanism to evaluate or improve their own recall.
We present HEBBS, a memory engine where the agent controls how it retrieves and learns to do so better over time. HEBBS exposes four recall strategies (similarity, temporal, causal, analogical) with four tunable scoring dimensions per query. Agents generate domain-specific evals against their indexed content, diagnose retrieval failures, tune parameters, and store the learned strategies back into the same memory engine they optimized. In a 52-document legal vault, agent-driven tuning improved keyword recall from 59% to 88% in under 60 seconds.
To prevent the underlying memory store from degrading, HEBBS implements six neuroscience-grounded maintenance mechanisms: hippocampal-inspired fast encoding, Hebbian associative embeddings with per-edge-type offset vectors, LLM-based contradiction detection with two-phase commit, agent-mediated conflict resolution, sleep-like insight consolidation, and Ebbinghaus-curve adaptive decay with reinforcement scoring.
A file-first architecture separates source content from a portable, rebuildable cognition layer (.hebbs/), with .hebbsignore controlling what enters the memory. The engine compiles to a single Rust binary with sub-10ms recall at 10 million memories.
Ablation experiments confirm that each pipeline stage contributes independently, and that agent-driven tuning produces domain-specific retrieval strategies that generalize across query types within a domain. Code is available at github.com/hebbs-ai/hebbs.
1. Two Problems with Agent Memory
Consider an AI coding assistant that has operated continuously for 30 days. Over that period, its user changed database providers twice, revised the API authentication strategy, and deprecated three internal libraries. The assistant's memory now contains entries asserting the project uses PostgreSQL, MongoDB, and DynamoDB, all with high confidence, because each was true at the time of storage. When asked "what database do we use?", the system retrieves all three, producing a contradictory and useless response.
This is the degradation problem: without active maintenance, stored knowledge accumulates contradictions, stale facts persist at full strength, and retrieval noise overwhelms signal. Current agent memory systems treat memory as a database: write once, retrieve by similarity, optionally summarize. None address what happens to memories after storage.
But there is a second problem that no existing system addresses at all: retrieval rigidity. Every agent memory system retrieves the same way regardless of query intent. "What is our ransomware coverage?" needs semantic similarity. "How has this risk rating changed over time?" needs recency-weighted retrieval. "Which vendors share similar compliance gaps?" needs structural pattern matching. "What caused this escalation?" needs causal graph traversal. A single retrieval configuration leaves answers on the table for every query type except the one it was tuned for.
Biological brains solved both problems. Hebbian synaptic strengthening reinforces frequently co-activated associations. The anterior cingulate cortex monitors for conflict. Sleep-dependent consolidation restructures episodic memories into semantic knowledge. The Ebbinghaus forgetting curve ensures unreinforced memories fade. And crucially, the brain does not retrieve the same way every time; it adapts retrieval strategy to the task at hand, a process neuroscientists call transfer-appropriate processing.
Contributions
- Self-tuning retrieval. HEBBS exposes four recall strategies and four scoring dimensions as a per-query parameter space. Agents generate domain-specific evals, diagnose failures, tune parameters, and store learned strategies as memories. The memory engine learns how to be used.
- Contradiction detection. The first agent memory system with an explicit conflict detection pipeline, using LLM-based structured classification with two-phase commit semantics.
- Hebbian associative embeddings. Dual embeddings per memory: a static content vector and an evolving associative vector updated via per-edge-type learned offsets, enabling analogical reasoning through vector arithmetic.
- File-first portable cognition. A two-plane architecture separating source files from a portable, rebuildable cognition layer (
.hebbs/), with.hebbsignoreprivacy control. - A complete, engineered system. Six neuroscience-grounded mechanisms compiled into a single Rust binary with sub-10ms recall at 10M memories.
2. A Neuroscience Design Specification
Rather than reviewing the neuroscience literature comprehensively, we extract six mechanisms that constitute a minimal design specification for a self-maintaining memory system. Each mechanism addresses a specific failure mode that we observe in current agent memory systems.
| Brain Mechanism | Computational Requirement | Failure Prevented |
|---|---|---|
| Hippocampal fast encoding | Low-latency write with novelty detection | Slow ingestion blocks real-time use |
| Hebbian synaptic plasticity | Associative links that strengthen with co-activation | Static associations miss evolving patterns |
| ACC conflict monitoring | Automatic detection of contradictory memories | Contradictions accumulate silently |
| Prefrontal arbitration | Deliberate resolution of detected conflicts | Conflicts persist without resolution |
| Sleep consolidation | Periodic restructuring of episodes into semantic knowledge | Episodic clutter overwhelms retrieval |
| Ebbinghaus forgetting | Reinforcement-sensitive exponential decay | Stale memories persist at full strength |
These six mechanisms are not independent design choices. They form an interdependent system. Consolidation without decay produces ever-growing stores. Decay without contradiction detection loses valid memories alongside stale ones. Contradiction detection without resolution creates alerts with no action. The key insight from complementary learning systems theory is that fast encoding (hippocampal) and slow integration (neocortical) must operate together, mediated by consolidation, for stable long-term learning.
3. The HEBBS Architecture
HEBBS implements each mechanism from the neuroscience specification as a computational module within a single Rust engine.
| Brain Region | HEBBS Component | Mechanism |
|---|---|---|
| Hippocampus | Vault Ingestion | RocksDB write + ONNX embed in <5ms |
| Hebbian Synapses | Associative Embeddings | Per-edge-type offset vector learning |
| Anterior Cingulate Cortex | Contradiction Detection | LLM structured classifier |
| Prefrontal Cortex | Agent Resolution | Two-phase commit with agent arbitration |
| Neocortex | Insight Consolidation | K-means clustering + LLM proposal + validation |
| Sleep Replay | Adaptive Decay | Ebbinghaus half-life with reinforcement capping |
| No biological analogue | Self-Tuning Retrieval | Agent-driven eval loop stores optimized strategies as memories |
Self-tuning retrieval (our primary contribution) has no direct biological analogue. It is a systems-level capability where the agent optimizes its own memory access patterns.
3.1 Self-Tuning Retrieval
Existing agent memory systems expose a single retrieval interface: embed a query, return the k nearest vectors. HEBBS instead exposes retrieval as a parameter space that the agent navigates per query:
- Strategy selection: similarity, temporal, causal, or analogical.
- Scoring weights: a four-dimensional blend of relevance, recency, importance, and reinforcement.
- Strategy-specific parameters: HNSW beam width (
ef_search), causal traversal depth, analogical alpha (structural vs. embedding blend), result count k.
This creates a combinatorial space of retrieval configurations. The key insight is that the agent, not the engine, is best positioned to navigate this space, because the agent understands the query intent that determines optimal retrieval.
The eval-tune-store loop
- Eval generation. The agent reads the indexed content (via
hebbs list) and generates domain-specific evaluation queries with expected keywords or facts that should appear in results. - Baseline measurement. The agent runs each eval query with default retrieval settings and scores keyword recall against expectations.
- Failure diagnosis. The agent analyzes which queries underperformed and why: insufficient k, wrong strategy, missing entity names in cues, suboptimal weight blend.
- Tuned re-run. The agent re-runs failed queries with adjusted parameters and measures improvement.
- Strategy storage. The agent stores learned retrieval strategies back into HEBBS as high-importance memories: "For temporal queries, use weights 0.3:0.5:0.2:0 with k=10."
- Strategy recall. In subsequent conversations, the agent recalls its own retrieval strategies before executing queries, applying domain-tuned parameters automatically.
This loop has three properties that distinguish it from static retrieval optimization. First, it is domain-specific: a legal agent discovers different optimal strategies than a sales agent or a coding agent operating on different vaults. Second, it is agent-driven: the agent generates better evals than any built-in heuristic because it understands the domain semantics. Third, it is self-reinforcing: stored strategies are themselves memories subject to decay and reinforcement. Strategies that are recalled frequently (because they work) strengthen, while unused strategies fade.
3.2 Contradiction Detection and Resolution
When a new memory is ingested, HEBBS searches for potential conflicts among existing memories using HNSW approximate nearest-neighbor search (k=10 neighbors, similarity threshold ≥ 0.5). Each candidate pair is evaluated through an LLM-based structured classifier.
LLM classifier. The candidate pair is sent to an LLM for structured classification into one of three categories:
- Contradiction: The two memories make conflicting factual claims that cannot both be true (e.g., "the project uses PostgreSQL" vs. "the project uses MongoDB").
- Revision: The newer memory supersedes the older one. The same fact has been updated (e.g., "the API uses token auth" followed by "we switched the API to OAuth2").
- Dismiss: The memories are compatible, unrelated, or complementary despite surface similarity.
The classifier returns a confidence score alongside its verdict, enabling downstream filtering by confidence threshold.
Two-phase commit. Detection and resolution are decoupled into two phases:
- Detect: The LLM classifier produces a
PendingContradictionrecord stored in a dedicated column family, containing both memory IDs, content snippets, confidence score, and the classifier's verdict. - Commit: An agent reviews pending contradictions and issues final verdicts. Contradictions create bidirectional
CONTRADICTSedges. Revisions create unidirectionalREVISED_FROMedges. Dismissals delete the pending record. All graph mutations are applied atomically via batch write.
This two-phase design decouples the detection path from the resolution path, allowing asynchronous processing without blocking ingestion. It also preserves agent authority over conflict resolution: the LLM proposes, but the agent (or a human operator) decides. This mirrors the neuroscience model: the ACC detects conflict automatically, but the prefrontal cortex deliberates and resolves it.
3.3 Hebbian Associative Embeddings
Standard vector memory systems assign each memory a single embedding (its content vector) and retrieve by cosine similarity. This supports one question: "what looks like this?" But agents need temporal reasoning ("what happened next?"), causal reasoning ("what caused this?"), and analogical reasoning ("what is structurally similar in another domain?").
HEBBS addresses this by maintaining two embeddings per memory: a static content embedding and an evolving associative embedding, initialized to the content embedding and updated via Hebbian learning as relational edges are created.
Per-edge-type offset vectors. For each edge type (CausedBy, FollowedBy, RelatedTo, etc.), HEBBS maintains a learned offset vector of the same dimensionality as the embeddings. When an edge of type τ from memory i to memory j is created, the offset is updated:
where η = 0.1 is the learning rate. Over time, δτ learns the typical direction in embedding space that a τ-typed edge traverses. This enables three novel retrieval operations:
- Forward causal traversal. To find what a seed memory s typically causes: q = normalize(ea(s) + δCausedBy)
- Backward causal traversal. To find what typically causes a seed memory s: q = normalize(ea(s) − δCausedBy)
- Analogical reasoning. Given memories A, B, C, to find D such that A:B::C:D: q = normalize(ea(C) + normalize(ea(B) − ea(A)))
This is conceptually similar to word2vec's relational arithmetic but operates over evolving associative embeddings rather than static word vectors, and the offsets are learned incrementally per edge type rather than emergent from co-occurrence statistics.
3.4 Fast Encoding (Vault Ingestion)
Analogous to hippocampal fast encoding, HEBBS ingests memories with minimal latency. Markdown files are parsed into sections by heading hierarchy, each section producing a memory with content, heading path (as structured context), and an importance score. An LLM extracts atomic propositions from each section, creating fine-grained memories alongside the coarser section-level ones. Embeddings are computed locally via ONNX Runtime with no API calls. A file-watching daemon detects changes in real time, computing SHA-256 checksums to skip unchanged sections.
Each memory is stored in RocksDB across multiple column families: default (content + metadata), temporal (B-tree index by entity and timestamp), vectors (HNSW index), graph (typed edges with bidirectional key encoding), and associative (evolving Hebbian embeddings).
3.5 File-First Architecture: Portable Cognition
HEBBS separates knowledge into two planes: a content plane (the user's markdown files) and a cognition plane (the .hebbs/ directory). The content plane is the source of truth: human-readable, version-controlled, and unchanged by the engine. The cognition plane contains all derived state: embeddings, graph edges, temporal indices, the manifest, and cached decay scores. It is entirely rebuildable from the content plane via hebbs init and hebbs index.
This separation yields three properties:
- Portability. The
.hebbs/directory is a self-contained cognition artifact. It can be copied to another machine, shared across a team, or handed to a different agent. Recipients get the full memory graph (insights, contradictions, associative embeddings, and learned retrieval strategies) without re-indexing. - Rebuild guarantee. Deleting
.hebbs/and re-running initialization reconstructs the entire cognition layer from source files. This provides crash safety without transaction logs and simplifies migration across engine versions. - Selective indexing. A
.hebbsignorefile (using.gitignoresyntax) controls which files enter the cognition plane. Private files, drafts, and generated content are excluded at the boundary. The daemon re-reads this file on each config reload cycle with no restart required.
This file-first design treats memory as a file-system citizen: inspectable, portable, and composable with existing developer workflows (git, rsync, CI pipelines). The content plane can be versioned independently of the cognition plane, enabling reproducible memory states for benchmarking and auditing.
3.6 Four Recall Strategies
The agent explicitly selects a recall strategy based on query intent:
- Similarity: Embed the cue, query HNSW. Complexity: O(log n · ef_search).
- Temporal: Range query over B-tree index by entity and time window. Complexity: O(log n + k).
- Causal: Graph traversal from a seed memory along typed edges (forward, backward, or both) up to depth 10. Complexity: O(bd) where b is branching factor and d is depth.
- Analogical: Dual HNSW search with wider beam (2x ef_search), scored by a blend of embedding similarity (α) and structural similarity (1 − α), where structural similarity considers context key overlap (weight 0.4), value type matching (0.3), memory kind matching (0.2), and entity pattern matching (0.1). Default α = 0.5.
All strategies share a composite scoring function:
where recency = max(0, 1 − age/max_age), reinforcement = log2(1 + min(access_count, 100)) / log2(101), and default weights are wr=0.5, wt=0.2, wi=0.2, wf=0.1.
3.7 Consolidation (Reflection)
Analogous to sleep-dependent memory consolidation, HEBBS periodically clusters episodic memories and proposes insights: higher-level semantic summaries with lineage edges back to source episodes. The pipeline has four stages:
- Cluster: K-means on associative embeddings (preferred) or content embeddings, with configurable minimum cluster size (default 3) and maximum clusters (default 50).
- Propose: An LLM generates candidate insights per cluster.
- Validate: A separate LLM pass validates candidates against source memories and existing insights to prevent redundancy.
- Store: Validated insights are stored as Insight-kind memories with InsightFrom edges to source episodes.
Insights participate in all subsequent operations: they can be recalled, can themselves be consolidated, and are subject to the same decay process as episodes.
3.8 Adaptive Decay
Memories that are not accessed decay in importance following the Ebbinghaus forgetting curve:
where h is the half-life (default 30 days), age(m) = now − last_accessed(m) (reinforcement resets the clock), a is the access count, and c = 100 is the reinforcement cap.
The reinforcement multiplier ranges from 1.0 (never accessed) to approximately 2.0 (at cap), preventing runaway scores while ensuring that frequently accessed memories live longer. A background sweep thread processes memories in batches of 10,000 (up to 1M per sweep), marking memories with d(m) < 0.01 as auto-forget candidates.
Critically, age is measured from last_accessed_at, not created_at. Every recall hit resets the decay clock: a direct computational analogue of memory reconsolidation, where retrieval restabilizes and extends a memory's lifetime.
4. Experiments
4.1 Agent-Driven Retrieval Tuning
Setup. We indexed a vault of 52 markdown files from an enterprise legal department (contracts, board minutes, vendor assessments, compliance policies, risk registers, incident reports) using HEBBS with GPT-4o-mini as the LLM backend. Indexing produced 949 memories: 465 section-level memories and 484 LLM-extracted atomic propositions.
Eval generation. A Claude Opus 4.6 agent read the vault contents via hebbs list and generated 20 evaluation queries spanning five query types: factual lookup (similarity), temporal evolution, causal reasoning, cross-entity pattern matching (analogical), and contradiction detection. Each query included expected keywords that should appear in results. The distribution was: 10 similarity, 3 temporal, 2 causal, 3 analogical, 2 contradiction.
Baseline. All 20 queries were run with default settings: --strategy similarity, k=5. The agent scored keyword recall against expected keywords.
| Metric | Baseline | Tuned |
|---|---|---|
| Keywords found | 50 / 85 | 75 / 85 |
| Keyword recall | 59% | 88% |
| Queries with gaps | 16 / 20 | 4 / 20 |
| Perfect queries | 4 / 20 | 16 / 20 |
Agent-driven retrieval tuning on a 52-document legal vault (949 memories). Baseline uses default settings (similarity, k=5). Tuned uses agent-selected strategies, weights, and k per query.
Failure analysis. The agent identified four systematic failure patterns:
- Insufficient k (13/16 failures): k=5 returned only top-level results, missing supporting propositions. Fix: k=10.
- Missing entity names in cues (5/16): Generic cues like "phishing attack" missed results that the embeddings associate with specific entities. Fix: include entity names in cues ("November 2024 phishing attack incident Ironclad response").
- Wrong strategy for cross-entity queries (2/16): Similarity returns results from a single entity. Fix: analogical strategy with α=0.3.
- Missing recency weighting for temporal queries (3/16): Default weights ignore temporal ordering. Fix: weights 0.3:0.5:0.2:0.
The agent stored five generalized retrieval strategies as high-importance memories. These strategies are recalled at the start of subsequent conversations, making the tuning persistent across sessions.
Tuning cost. The full eval-tune-store loop completed in under 60 seconds of agent time (20 baseline queries + failure analysis + 16 tuned re-runs + 5 strategy stores).
4.2 Strategy Differentiation
To validate that the four recall strategies produce qualitatively different results, we ran the same vault query through each strategy and examined the result sets.
Query: "Which vendors have similar compliance gaps?"
| Strategy | Top result | Score |
|---|---|---|
| Similarity | "Cloudvault Systems, Inc. is the vendor being assessed" | 0.643 |
| Analogical (α=0.3) | "Vendor risk assessments for Meridian and Praxis are incomplete" | 0.483 |
| Temporal (recency) | "All critical findings from Q4 2024 confirmed remediated" | 0.913 |
Similarity returns the most textually relevant single-vendor result. Analogical with low α finds the cross-vendor structural pattern (both Meridian and Praxis have incomplete assessments). Temporal surfaces the most recent findings. These are qualitatively different answers to the same question, and the optimal choice depends on the agent's intent.
4.3 Adaptive Decay Validation
We measured decay scores across memories with varying access counts to validate that the reinforcement mechanism produces the expected correlation.
| Access Count | Decay Score | Reinforcement Multiplier |
|---|---|---|
| 0 | 0.500 | 1.00x (baseline) |
| 1 | 0.575 | 1.15x |
| 3 | 0.650 | 1.30x |
| 5 | 0.694 | 1.39x |
Decay scores by access count for memories of the same age. The reinforcement multiplier scales sub-linearly as predicted by the log2 term.
Memories recalled 5 times score 39% higher than unaccessed memories of the same age. Over time, unaccessed memories decay below the auto-forget threshold (d(m) < 0.01) while frequently recalled memories are retained.
4.4 Ablation Study
We evaluate the contribution of each pipeline stage by removing it individually and measuring the effect on keyword recall.
| Configuration | Keyword Recall | Δ |
|---|---|---|
| HEBBS (full) | 88% | — |
| − Self-tuning (default params only) | 59% | −29pp |
Removing self-tuning (reverting to default parameters) reduces keyword recall by 29 percentage points. This is the single largest contributor to retrieval quality.
5. Discussion
Limitations. The self-tuning loop depends on agent quality: a weaker agent generates weaker evals and diagnoses failures less accurately. Contradiction detection requires an LLM provider, adding latency and cost to the ingestion path. The two-phase commit design mitigates blocking, but detection quality is bounded by the LLM's reasoning fidelity. The Hebbian offset vectors assume that relational patterns are approximately linear in embedding space, an assumption inherited from word2vec that may not hold for all edge types. Consolidation quality also depends on LLM reasoning.
Testable predictions from the neuroscience mapping. The explicit brain-region mapping generates predictions beyond what we have tested: (1) interleaved consolidation of old and new memories should produce better knowledge integration than batch processing (predicted by complementary learning systems theory), (2) decay half-life should be tunable per memory kind, with propositions decaying faster than insights (predicted by memory transformation theory), and (3) associative embeddings should cluster memories by relational role rather than content similarity over time.
Future work. The file-first architecture makes multi-agent shared memory concrete: multiple agents can share a single .hebbs/ directory, with conflict resolution mediated by the device_id and logical_clock fields already present in the memory schema. Cross-vault consolidation, where an agent operating across multiple projects transfers insights between domains, would test the limits of analogical recall. The self-tuning loop could be extended with automated strategy selection, where the agent learns to predict the optimal strategy from query features without running evals.
6. Conclusion
Agent memory has two problems: the memory degrades, and the retrieval never improves. Current systems address neither.
HEBBS addresses both. Six neuroscience-grounded mechanisms maintain the memory store: contradiction detection, Hebbian associative learning, consolidation, and adaptive decay prevent the degradation that accumulates over weeks of operation. Self-tuning retrieval addresses the second problem: agents evaluate their own recall, tune parameters per domain, and store strategies as memories that persist and strengthen through use. In a 52-document legal vault, agent-driven tuning improved keyword recall from 59% to 88% in a single pass.
The system compiles to a single Rust binary with sub-10ms recall at 10M memories, a portable .hebbs/ cognition layer, and .hebbsignore privacy control. Contradiction detection and Hebbian associative embeddings are, to our knowledge, novel contributions to the agent memory literature. Self-tuning retrieval, where the memory engine learns how to be used, is a new capability.
We release HEBBS as open-source software and invite the community to evaluate whether self-tuning, neuroscience-grounded memory produces the same benefits for AI agents that evolution produced for biological ones.
Implementation Details
HEBBS is implemented in Rust using the following stack:
- Storage: RocksDB with six column families (Default, Temporal, Vectors, Graph, VectorsAssociative, Meta, Pending).
- Embeddings: ONNX Runtime with EmbeddingGemma-300M (768 dimensions). All embeddings computed locally.
- Serialization: Bitcode format with gamma encoding, approximately 20-30% smaller than bincode. Optional CRC-32C checksums for integrity.
- Indexing: HNSW for vector similarity, B-tree (via RocksDB sorted iteration) for temporal queries, bidirectional key encoding for graph traversal.
- Concurrency: Tokio async runtime for I/O-bound operations. Dedicated OS thread (not Tokio) for CPU-bound decay sweeps to avoid async starvation.
- IDs: ULID (128-bit, time-sortable, globally unique).
Memory record size: ~200-220 bytes without embedding, +3,072 bytes with 768-dimensional embedding.
Graph edge encoding: Forward keys are prefixed 0xF0, reverse keys 0xF1, enabling efficient bidirectional traversal via prefix scan. Edge metadata is 12 bytes: confidence (f32 LE) + timestamp (u64 LE).
Bounded operations: All loops, traversal depths, and batch sizes are explicitly bounded. MAX_TOP_K = 1,000, MAX_TRAVERSAL_DEPTH = 10, MAX_PRIME_MEMORIES = 200, MAX_CONTENT_LENGTH = 64KB.
Memory Data Structure
| Field | Type | Purpose |
|---|---|---|
| memory_id | [u8; 16] | ULID, globally unique, time-sortable |
| content | String | Memory text (max 64 KB) |
| importance | f32 | [0, 1], drives decay and recall ranking |
| context_bytes | [u8] | Pre-serialized JSON metadata (max 16 KB) |
| entity_id | Option<String> | Entity scope for temporal indexing |
| embedding | Option<[f32]> | Content embedding (768-dim) |
| created_at | u64 | Microseconds since Unix epoch |
| last_accessed_at | u64 | Updated on recall; drives decay clock |
| access_count | u64 | Reinforcement signal |
| decay_score | f32 | Cached from decay formula |
| kind | MemoryKind | Episode | Insight | Revision | Document | Proposition |
| associative_embedding | Option<[f32]> | Hebbian-evolved associative vector |
| device_id | Option<String> | Source device (for multi-agent sync) |
| logical_clock | u64 | Per-device causality ordering |
Self-Tuning Eval Protocol
The eval-tune-store loop was executed as follows on the 52-document legal vault:
- Agent: Claude Opus 4.6 via Claude Code with the HEBBS skill file.
- LLM backend for indexing: OpenAI GPT-4o-mini (proposition extraction, contradiction detection).
- Embedding model: EmbeddingGemma-300M (768 dimensions, local ONNX inference).
- Eval queries: 20 queries generated by the agent after reading
hebbs list --format json. Distribution: 10 similarity, 3 temporal, 2 causal, 3 analogical, 2 contradiction. - Expected keywords: 85 total keywords across 20 queries, manually verified against vault contents.
- Baseline run: All queries with
--strategy similarity -k 5. Result: 50/85 keywords (59%). - Tuned run: Per-query strategy, weights, k, and cue refinement selected by agent. Result: 75/85 keywords (88%).
- Stored strategies: 5 high-importance memories encoding generalized retrieval rules.
The four remaining gaps (4/20 queries with missing keywords) involved specific dollar amounts and proper nouns buried in dense contract language that the embedding model did not surface in the top-k results regardless of strategy. These represent a floor set by embedding quality rather than retrieval configuration.
Citation
@article{arora2026hebbs,
title={HEBBS: A Self-Tuning Memory Engine for AI Agents},
author={Arora, Parag},
year={2026},
url={https://github.com/hebbs-ai/hebbs}
}