A0_Hindsight Memory
Augments Agent Zero's memory with Hindsight semantic search and disposition-aware context generation.
README
π§ Hindsight Memory Plugin for Agent Zero
Augments Agent Zero's built-in memory with Hindsight by Vectorize.io. Gives Agent Zero persistent, semantically-rich memory that goes beyond simple vector similarity β with disposition-aware context generation.
What It Does
| Feature | Description |
|---|---|
| Automatic Retain | Conversation memories are extracted and stored in Hindsight banks after each interaction |
| Enhanced Recall | Memory recall is enriched with Hindsight's semantic search alongside the built-in vector memory |
| Reflect Context | Disposition-aware context is generated and injected into the system prompt |
| Project Isolation | Memory banks are automatically scoped by project for clean separation |
| Graceful Degradation | If Hindsight is unavailable, the agent continues normally with built-in memory |
| Settings UI | Configure all settings directly in A0's settings panel |
| Plugin System Conformant | Built for A0's plugin architecture (plugin.yaml, extensions, settings) |
How It Works
βββββββββββββββ retain ββββββββββββββββ reflect ββββββββββββββββ
β Agent Zero β ββββββββββββββββΆ β Hindsight β ββββββββββββββββΆ β Disposition β
β (your chat) β β (memory) β context gen β (insights) β
ββββββββ¬ββββββββ ββββββββ¬ββββββββ ββββββββββββββββ
β β
ββββββ recall + reflect ββββββββββββ
β (system prompt injection)
- Retain β After each conversation turn, key facts and information are extracted and stored in Hindsight via the
monologue_endextension - Recall β On each recall cycle, Hindsight is queried alongside the built-in memory for enriched semantic search results
- Reflect β Hindsight generates disposition-aware context that is injected into the system prompt
Installation
1. Clone into Agent Zero's user plugins directory
cd /a0/usr/plugins
git clone https://github.com/YOUR_USERNAME/a0-plugin-hindsight.git hindsight
Or copy the plugin files directly into /a0/usr/plugins/hindsight/.
2. Install dependencies
pip install hindsight-client>=0.4.0
3. Set up a Hindsight server
Follow the Hindsight installation guide to run a local server:
docker run -p 8888:8888 vectorize/hindsight
Or use the Vectorize.io hosted service.
4. Configure in Agent Zero
Go to Settings β Agents β Hindsight Memory and set:
Hindsight Base URLβ your Hindsight server URL (optional; e.g.http://localhost:8888)HINDSIGHT_API_KEYβ (optional) API key if required by your server (in Settings β Secrets)
Go to Settings β Plugins and enable Hindsight Memory
(Optional) Click Configure on the plugin to adjust:
- Bank ID prefix
- Enable/disable retain, recall, reflect individually
- Recall/reflect budgets and token limits
- Cache TTL
5. Restart Agent Zero
The plugin will be discovered on restart. You'll see [Hindsight] Integration enabled for bank: a0-default in the logs.
Plugin Structure
hindsight/
βββ plugin.yaml # Plugin manifest
βββ default_config.yaml # Settings defaults
βββ requirements.txt # hindsight-client>=0.4.0
βββ hooks.py # Install/update hooks
βββ execute.py # User-triggered setup & health check
βββ helpers/
β βββ __init__.py
β βββ hindsight_helper.py # Core integration logic
βββ extensions/
β βββ python/
β βββ monologue_start/
β β βββ _20_hindsight_init.py # Initialize Hindsight on agent start
β βββ monologue_end/
β β βββ _52_hindsight_retain.py # Retain memories to Hindsight
β βββ message_loop_prompts_after/
β β βββ _51_hindsight_recall.py # Enrich recall with Hindsight
β βββ system_prompt/
β βββ _30_hindsight_reflect.py # Inject reflect context into prompt
βββ prompts/
β βββ hindsight.retain_extract.sys.md # Memory extraction prompt
β βββ hindsight.recall.md # Recall injection template
β βββ hindsight.reflect.md # Reflect injection template
βββ webui/
β βββ config.html # Settings UI
βββ README.md
Configuration
Secrets (Settings β Secrets)
| Key | Required | Default | Description |
|---|---|---|---|
HINDSIGHT_BASE_URL |
No* | β | Hindsight server URL (e.g. http://localhost:8888). Set in plugin settings instead. |
HINDSIGHT_API_KEY |
No | β | API key (optional for local servers) |
*Note: HINDSIGHT_BASE_URL is configured in the plugin settings UI. Setting it in Secrets is deprecated but still supported for backwards compatibility.
Plugin Settings (Settings β Plugins β Hindsight β Configure)
| Setting | Default | Description |
|---|---|---|
| Bank ID Prefix | a0 |
Prefix for memory bank IDs |
| Enable Retain | true |
Store memories to Hindsight |
| Enable Recall | true |
Enrich recall with Hindsight search |
| Enable Reflect | true |
Inject reflect context into prompt |
| Recall Max Tokens | 4096 |
Max tokens for recall results |
| Recall Budget | mid |
Compute budget for recall |
| Reflect Budget | low |
Compute budget for reflect |
| Reflect Max Tokens | 500 |
Max tokens for reflect context |
| Cache TTL | 120 seconds |
How long to cache reflect context |
| Debug Logging | false |
Verbose logging |
Hindsight Companion Skill (Optional CLI Access)
While the Hindsight plugin handles automatic lifecycle operations (retain, recall, reflect), you can also use the Hindsight companion skill for direct, opt-in CLI-style access to memory banks.
Loading the Skill
skills_tool:load hindsight
Once loaded, the skill provides:
| Operation | Purpose |
|---|---|
| Retain | Manually store information to a memory bank |
| Recall | Manually search memories by query |
| Reflect | Manually generate disposition-aware context |
| Inspect | View memory bank contents and metadata |
| List | List all memories in a bank |
| Export | Export memories to file |
| Delete | Remove specific memories |
When to Use the Skill
- Plugin alone: Automatic background operation (good for hands-off memory management)
- Plugin + Skill: Manual intervention when you need to:
- Query specific memories outside normal conversation flow
- Consolidate or reorganize memory banks
- Export memory data for inspection
- Troubleshoot or debug Hindsight service issues
- Trigger memory operations explicitly within agent workflows
Architecture
The plugin and skill form a complementary pair:
βββββββββββββββββββββββββββββββββββββββ
β Plugin (Automatic Lifecycle) β
βββββββββββββββββββββββββββββββββββββββ€
β β’ Retain after each conversation β
β β’ Recall during memory phase β
β β’ Reflect into system prompt β
β β’ Runs invisibly in background β
βββββββββββββββββββββββββββββββββββββββ
β β
Hindsight Server
β β
βββββββββββββββββββββββββββββββββββββββ
β Skill (Manual CLI Access) β
βββββββββββββββββββββββββββββββββββββββ€
β β’ Query memories on demand β
β β’ Manage memory banks explicitly β
β β’ Export and analyze data β
β β’ Requires explicit load command β
βββββββββββββββββββββββββββββββββββββββ
Both use the same Hindsight server and bank infrastructureβthe plugin provides automatic operation, the skill provides manual control.
Hindsight Concepts
| Concept | Description |
|---|---|
| Bank | A memory container scoped by project context |
| Retain | Store information as memories in a bank |
| Recall | Semantic search across stored memories |
| Reflect | Generate disposition-aware responses using stored knowledge |
| Disposition | Personality traits (skepticism, literalism, empathy) that affect how reflect generates context |
Requirements
- Agent Zero (with plugin system)
- Python 3.12+
hindsight-client>= 0.4.0- A running Hindsight server (local Docker or hosted)
Links
License
MIT