Skip to content

feat: add Honcho conversational memory integration example#1055

Open
alogotron wants to merge 1 commit intoagent0ai:developmentfrom
alogotron:feat/honcho-memory-integration
Open

feat: add Honcho conversational memory integration example#1055
alogotron wants to merge 1 commit intoagent0ai:developmentfrom
alogotron:feat/honcho-memory-integration

Conversation

@alogotron
Copy link

Summary

Adds a complete Honcho conversational memory integration as an example user extension, demonstrating persistent user context across Agent Zero sessions.

Closes #1054

What is Honcho?

Honcho is a conversational memory platform by Plastic Labs that provides persistent user context across sessions — enabling agents to remember user preferences, past interactions, and build ongoing relationships.

Changes

All files are added under agents/_example/extensions/ as a reference implementation:

File Extension Hook Purpose
honcho_helper.py Core module Client management, message sync, context retrieval, caching
agent_init/_20_honcho_init.py agent_init Lazy session initialization on agent start
hist_add_before/_20_honcho_sync.py hist_add_before Real-time message sync to Honcho
system_prompt/_30_honcho_context.py system_prompt Inject persistent user context into prompts
README_HONCHO.md Documentation Setup instructions, architecture, usage guide

Key Features

  • Lazy initialization — no restart needed; activates when API key is set in Secrets
  • Automatic message sync — every message flows to Honcho via hist_add_before hook
  • Context injection — user memory from past sessions injected into system prompt
  • TTL-based context caching (120s) — prevents excessive API calls
  • Graceful degradation — silently skips if unconfigured or SDK missing
  • Zero config — only requires HONCHO_API_KEY in A0 Secrets

Data Flow

User message  → hist_add_before hook → sync to Honcho
Agent response → hist_add_before hook → sync to Honcho
New session   → system_prompt hook   → fetch & inject user context

Requirements

  • honcho-ai>=2.0 (pip install honcho-ai)
  • Honcho API key from app.honcho.dev

Relation to #998 (Unified Plugin System)

This integration is designed to work with the current extension system and is ready to be adapted to the plugin architecture proposed in #998 once it lands.

Testing

  • All Python files compile without errors
  • Tested on Agent Zero v0.9.8 with Honcho SDK v2.0.1
  • Uses standard A0 extension hooks (agent_init, hist_add_before, system_prompt)
  • No modifications to core A0 code

Add a complete integration with Honcho (honcho.dev) as an example
user extension demonstrating persistent conversational memory.

Extension files:
- honcho_helper.py: Core client management, caching, message sync
- agent_init/_20_honcho_init.py: Lazy session initialization
- hist_add_before/_20_honcho_sync.py: Real-time message sync
- system_prompt/_30_honcho_context.py: User context injection
- README_HONCHO.md: Setup and usage documentation

Features:
- Automatic message sync to Honcho on every history entry
- Persistent user context injected into system prompt
- Lazy init (no restart needed after adding API key)
- TTL-based context caching
- Graceful degradation when unconfigured

Requires: honcho-ai>=2.0 (pip install honcho-ai)

Closes agent0ai#1054
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant