Skip to content

Tuning & Evals

HEBBS doesn’t just store memories. It retrieves them using four strategies, each with configurable weights. The difference between a mediocre agent and a great one is tuning: measuring recall quality against your actual data and adjusting parameters until the agent finds the right information every time.

Out of the box, HEBBS uses default weights (0.5:0.2:0.2:0.1 for relevance, recency, importance, reinforcement) and defaults to similarity search. This works for general queries. But your domain has specific retrieval patterns:

  • A sales agent needs recency-biased recall (recent calls matter more than old ones)
  • A legal agent needs importance-biased recall (high-stakes clauses matter more than meeting notes)
  • A support agent needs reinforcement-biased recall (frequently referenced solutions should surface first)

Tuning makes the agent’s memory match your domain.

We evaluate recall quality using curated datasets where correct answers are known. The key metric is precision@5: how many of the top 5 results are genuinely relevant.

Query TypeSimilarity OnlyHEBBS (Right Strategy)Improvement
Temporal (“what happened before X?“)42%71%+68%
Causal (“what caused X?“)38%62%+63%
Analogical (“have we seen this pattern?“)35%50%+43%
Similarity (“find docs about X”)78%79%baseline
Overall (optimal strategy per query)48%66%+37%

The biggest gains come from using the right strategy for the right question. Similarity search is the wrong tool for 60% of real-world agent queries.

After running the reflection pipeline:

MetricBeforeAfterChange
Precision@5 (similarity)78%82%+5%
Precision@5 (analogical)50%58%+16%
Insights generated0142new knowledge

Reflection consolidates raw memories into higher-level insights that match a broader range of queries.

What does your agent search for? Different domains weight strategies differently:

DomainPrimary StrategyWeights (R:T:I:F)Why
Sales/CRMTemporal + Similarity0.3:0.4:0.2:0.1Recent interactions matter most
LegalSimilarity + Causal0.4:0.1:0.4:0.1Importance of clauses, precedent chains
SupportSimilarity + Reinforcement0.3:0.2:0.2:0.3Frequently used solutions surface first
EngineeringCausal + Temporal0.3:0.3:0.2:0.2What happened and why
ResearchAnalogical + Similarity0.5:0.1:0.2:0.2Cross-domain pattern matching

An eval is a query with a known correct answer. Write 10-20 evals that represent your real search patterns:

Terminal window
# Factual lookup
hebbs recall "What is our data retention policy?" --format json | jq '.results[0].content'
# Expected: content from policies/data-retention-v2.md
# Entity-scoped temporal
hebbs recall "What happened with Acme Corp last month?" --entity-id acme-corp --strategy temporal --format json
# Expected: recent call notes in chronological order
# Cross-entity analogical
hebbs recall "Which deals had similar budget pushback?" --strategy analogical --format json
# Expected: deals from other entities with budget reduction patterns
# Contradiction check
hebbs recall "What is Acme's budget?" --entity-id acme-corp --format json
# Expected: should surface both $100K and $50K with contradiction flag

Run your evals with default weights and record the results:

Terminal window
# Default weights
hebbs recall "your eval query" --weights 0.5:0.2:0.2:0.1 --format json
# Check: did the right answer appear in top 5?

Adjust weights based on what your domain needs:

Terminal window
# Recency-biased (for sales, support)
hebbs recall "your eval query" --weights 0.3:0.4:0.2:0.1
# Importance-biased (for legal, compliance)
hebbs recall "your eval query" --weights 0.3:0.1:0.5:0.1
# Reinforcement-biased (for support, repeated patterns)
hebbs recall "your eval query" --weights 0.2:0.2:0.2:0.4

Re-run your evals after each change. Compare precision@5 against the baseline.

Different queries need different strategies. Teach your agent (or your integration code) to select the right one:

async def smart_recall(hb, query, entity_id=None):
"""Select strategy based on query intent."""
query_lower = query.lower()
if any(w in query_lower for w in ["when", "timeline", "history", "happened"]):
strategy = "temporal"
elif any(w in query_lower for w in ["caused", "led to", "why did", "root cause"]):
strategy = "causal"
elif any(w in query_lower for w in ["similar", "pattern", "like this", "analogous"]):
strategy = "analogical"
else:
strategy = "similarity"
return await hb.recall(query, strategy=strategy, entity_id=entity_id)

After your knowledge base is populated, run reflection to generate insights:

Terminal window
hebbs reflect --entity-id acme-corp
hebbs insights --entity-id acme-corp --min-confidence 0.7

Insights improve recall quality by +5-16% because they provide higher-level summaries that match a broader range of queries. Run reflection weekly or after significant new content is uploaded.

If your agent uses the HEBBS skill (Claude Code, OpenClaw), it can tune itself. Say:

tune my recall for this workspace

The skill will:

  1. Profile your domain (asks you questions)
  2. Generate evals from your actual content
  3. Run baseline measurements
  4. Test different weight configurations
  5. Store the optimal weights as compiled rules

The compiled rules load automatically in every future conversation.

You: tune recall for our sales workspace
Agent: I'll profile your workspace. What do your reps typically search for?
You: call history for specific accounts, competitive intel, case studies
Agent: Running baseline evals...
- "Acme Corp call history" (temporal): baseline 3/5, tuned 5/5
- "competitive comparison with Vendor X" (similarity): baseline 4/5, tuned 4/5
- "deals with similar budget dynamics" (analogical): baseline 2/5, tuned 4/5
Recommended weights: 0.3:0.4:0.2:0.1 (recency-biased)
Overall precision: 48% → 72% (+50% improvement)
Saving tuned parameters...

Default HEBBS is 37% better than similarity-only search. Tuned HEBBS, with the right weights and strategy selection for your domain, can improve recall precision by 50-70% over baseline. The difference compounds: better recall means better agent decisions, which means better outcomes for your business.