Back to .md Directory

RETRIEVAL.md — Memory Scan Protocol

Defines a five-step internal memory retrieval protocol that surfaces results only in LiveHud gauges, never as visible logs.

May 2, 2026
0 downloads
1 views
ai llm eval
View source

What this file does

Defines a five-step internal memory retrieval protocol that surfaces results only in LiveHud gauges, never as visible logs.

When to use it

  • Building an AI agent that needs silent memory recall before output
  • Implementing a relevance-scored memory selection with minimum and maximum file counts
  • Adding a LiveHud dashboard that displays memory load and context summary
  • Handling edge cases like empty memory folders or inaccessible storage

RETRIEVAL.md — Memory Scan Protocol

REQUIRED: Memory retrieval is internal. Results surface in LiveHud gauges, not as pre-output logs.


Memory Location

brain/memory/allmemories/

🚨 REQUIRED PROTOCOL STEPS (Internal)

All retrieval steps happen silently before LiveHud is printed.

Step 1: Scan Memory Index

List all files in brain/memory/allmemories/ to build memory index.

(No visible output — this is internal)

Step 2: Relevance Assessment

For each memory file, score relevance (0-100) based on:

FactorWeight
Topic match to current session context40%
Recency (newer = higher)25%
User correction flag20%
Project reference (active project match)15%

Step 3: Selection

Select 5-35+ files for retrieval:

  • Minimum 5 files for baseline context
  • Maximum based on relevance threshold (score > 30)
  • Always include files tagged as [CRITICAL] or [USER_CORRECTION]

Step 4: Retrieval

Read selected files into working memory.

Step 5: Surface in LiveHud

Populate LiveHud gauges with retrieval results:

  • 📂 Memory: X files loaded
  • 🧠 Past: [Key retrieved context summary]

⚠️ IMPORTANT: Do NOT output scan confirmation blocks before LiveHud. The results are reflected via the Memory Protocol section of LiveHud.


Edge Cases

ScenarioHandling
No memory files existSkip retrieval, set 🧠 Past: Fresh session
Too many relevant files (>35)Cap at 35, prioritize by score
Memory folder inaccessibleSet 📂 Memory: Inaccessible in LiveHud, proceed
No tool accessSet 📂 Memory: No tool access in LiveHud

Remember to remember before you begin.

What's inside

5 protocol steps, 4 relevance factors with weights, 4 edge case scenarios

Change this for your project

  • Replace brain/memory/allmemories/ with your own memory directory path
  • Replace LiveHud with your own output dashboard or display mechanism
  • Replace 📂 Memory: X files loaded and 🧠 Past: [Key retrieved context summary] with your own gauge labels

Where it goes

Keep it in your repository where the agent or team that needs it will read it.

Related Documents