A0_Hindsight Memory plugin thumbnail

A0_Hindsight Memory

Augments Agent Zero's memory with Hindsight semantic search and disposition-aware context generation.

Author neurocis 6 stars Version 2.5.7 Updated

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)
  1. Retain β€” After each conversation turn, key facts and information are extracted and stored in Hindsight via the monologue_end extension
  2. Recall β€” On each recall cycle, Hindsight is queried alongside the built-in memory for enriched semantic search results
  3. 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

  1. 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)
  2. Go to Settings β†’ Plugins and enable Hindsight Memory

  3. (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)

License

MIT