Skip to main content
This integration of Mem0 with Agno enables persistent, multimodal memory for Agno-based agents - improving personalization, context awareness, and continuity across conversations.

Overview

  1. Store and retrieve memories from Mem0 within Agno agents
  2. Support for multimodal interactions (text and images)
  3. Semantic search for relevant past conversations
  4. Personalized responses based on user history
  5. One-line memory integration via Mem0Tools

Prerequisites

Before setting up Mem0 with Agno, ensure you have:
  1. Installed the required packages:
  1. Valid API keys:

Quick Integration (Using Mem0Tools)

The simplest way to integrate Mem0 with Agno Agents is to use Mem0 as a tool using built-in Mem0Tools:
This enables memory functionality out of the box:
  • Persistent memory writing: Mem0Tools uses MemoryClient.add(...) to store messages from user-agent interactions, including optional metadata such as user ID or session.
  • Contextual memory search: Compatible queries use MemoryClient.search(...) to retrieve relevant past messages, improving contextual understanding.
  • Multimodal support: Both text and image inputs are supported, allowing richer memory records.
Mem0Tools uses the MemoryClient under the hood and requires no additional setup. You can customize its behavior by modifying your tools list or extending it in code.

Full Manual Example

Note: Mem0 can also be used with Agno Agents as a separate memory layer.
The following example demonstrates how to create an Agno agent with Mem0 memory integration, including support for image processing:

Key Features

1. Multimodal Memory Storage

The integration supports storing both text and image data:
  • Text Storage: Conversation history is saved in a structured format
  • Image Analysis: Agents can analyze images and store visual information
  • Combined Context: Memory retrieval combines both text and visual data

2. Personalized Agent Responses

Improve your agent’s context awareness:
  • Memory Retrieval: Semantic search finds relevant past interactions
  • User Preferences: Personalize responses based on stored user information
  • Continuity: Maintain conversation threads across multiple sessions

3. Flexible Configuration

Customize the integration to your needs:
  • Use Mem0Tools() for drop-in memory support
  • Use MemoryClient directly for advanced control
  • User Identification: Organize memories by user ID
  • Memory Search: Configure search relevance and result count
  • Memory Formatting: Support for various OpenAI message formats

OpenAI Agents SDK

Build agents with OpenAI SDK and Mem0

Mastra Integration

Create intelligent agents with Mastra framework
Enjoying Mem0? Star us on GitHub — it takes two seconds and helps more developers discover open-source memory.