💡 Examples
LlamaIndex ReAct Agent
Create a ReAct Agent with LlamaIndex which uses Mem0 as the memory store.
Overview
A ReAct agent combines reasoning and action capabilities, making it versatile for tasks requiring both thought processes (reasoning) and interaction with tools or APIs (acting). Mem0 as memory enhances these capabilities by allowing the agent to store and retrieve contextual information from past interactions.
Setup
Initialize the LLM.
Initialize the Mem0 client. You can find your API key here. Read about Mem0 Open Source.
Create the tools. These tools will be used by the agent to perform actions.
Initialize the agent with tools and memory.
Start the chat.
The agent will use the Mem0 to store the relavant memories from the chat.
Input
Output
Input
Output
Input
Output
Using the agent WITHOUT memory
Input
Output
The agent is not able to remember the past prefernces that user shared in previous chats.
Using the agent WITH memory
Input
Output
The agent is able to remember the past prefernces that user shared and use them to perform actions.