What We’re Building
We’ll create AI agents that remember and reason over past conversations. Here’s how the pieces fit together:- CrewAI orchestrates agent behavior and task execution
- Honcho stores messages and retrieves relevant context
This tutorial demonstrates single-agent setup to show how Honcho integrates with CrewAI. For production applications, you can extend this to multi-agent crews with shared or individual memory using Honcho’s
peer system.Setup
Install required packages:.env file with your API keys:
This tutorial uses the Honcho demo server at https://demo.honcho.dev which runs a small instance of Honcho on the latest version. For production, get your Honcho API key at app.honcho.dev. For local development, use
environment="local".CrewAI Honcho Storage
Thehoncho_crewai package provides HonchoStorage, a storage provider that implements CrewAI’s Storage interface using Honcho’s session-based memory.
Before proceeding, it’s important to understand Honcho’s core concepts (
Peers and Sessions). Review the Honcho Architecture to familiarize yourself with these primitives.HonchoStorage implements CrewAI’s Storage interface using Honcho’s peer and session primitives.
HonchoStorage class implements three key methods:
save()- Stores messages in Honcho’ssession, associating them with the appropriatepeer(user or assistant)search()- Performs semantic vector search usingsession.search()to find messages most relevant to the query. Supports optionalfiltersparameter for fine-grained scoping.reset()- Creates a newsessionto start fresh conversations
Search with Filters
Thesearch() method supports an optional filters parameter for fine-grained scoping of search results:
For comprehensive details about CrewAI’s memory system, see the official CrewAI Memory documentation.
Python
CrewAI Tool Integration
Honcho provides specialized tools that give CrewAI agents explicit control over memory retrieval:HonchoGetContextTool- Retrieves comprehensive conversation history with token limits. Use for tasks needing broad conversation understanding.HonchoDialecticTool- Queries representations aboutpeers. Use for understanding user preferences and characteristics without full message history.HonchoSearchTool- Performs semantic search for specific information. Supports optionalfiltersparameter for fine-grained scoping. Use for targeted queries like “what did the user say about budget?”
Python
Tool-Based vs Automatic Memory
UseHonchoStorage for automatic memory - CrewAI handles everything transparently. Best for simple conversational flows.
Use Honcho Tools for strategic control - agents decide when and how to query memory. Best for multi-step reasoning, when different query types are needed, or multi-agent systems.
You can combine both: automatic memory for baseline context, tools for specific queries. See the hybrid memory example for a complete implementation.
Multi-Agent Memory: Use Honcho tools with different
peer_id values to give each agent distinct memory and identity.Next Steps
Now that you have a working CrewAI integration with Honcho, you can:- Create specialized agents with domain-specific memory and context
- Use CrewAI’s advanced features like hierarchical processes, tool delegation, and conditional task execution
- Leverage logical reasoning via the Dialectic API for deep
peerunderstanding - Implement custom tools to give agents explicit control over memory retrieval
Related Resources
Honcho Architecture
Understand Honcho’s peer-based model and core primitives
Get Context
Learn about retrieving and formatting conversation context
Dialectic API
Query
peer representations for deeper understandingLangGraph Integration
Build stateful agents with LangGraph and Honcho