If a memory-less AI Agent is deployed in production, every interaction with that Agent will be a blank slate.
It doesn’t matter if the user mentioned their name 5 secs ago…it’s forgotten.
If the Agent solved an issue in the last session, it won’t remember it now.
With Memory, your Agent becomes context-aware and practically applicable.
Today, let us build an AI Agent with human-like memory. We have added a video above if you prefer that.
Here’s our tech stack:
Open-source Graphiti (by Zep) as the memory layer for our AI agent.
AutoGen for agent orchestration
Ollama to locally serve Qwen 3.
Here’s the system overview:
User submits a query.
Agent saves the conversation and extracts facts into memory.
Agent retrieves facts and summarizes.
Uses facts and history for informed responses.
Let’s dive into the code!
Setup LLM
We'll use a locally served Qwen 3 via Ollama.
Initialise Zep Client
We're leveraging Zep’s Foundational Memory Layer to equip our Autogen agent with genuine task-completion capabilities.
Create User Session
Create a Zep client session for the user, which the agent will use to manage memory. A user can have multiple sessions!
Define Zep Conversable Agent
Our Zep Memory Agent builds on Autogen's Conversable Agent, drawing live memory context from Zep Cloud with each user query.
It remains efficient by utilizing the session we just established.
Setting up Agents
We initialize the Conversable Agent and a Stand-in Human Agent to manage chat interactions.
Handle Agentic Chat
The Zep Conversable Agent steps in to create a coherent, personalized response.
It seamlessly integrates memory and conversation.
Streamlit UI
We created a streamlined Streamlit UI to ensure smooth and simple interactions with the Agent.
Visualize Knowledge Graph
We can interactively map users’ conversations across multiple sessions with Zep Cloud's UI. This powerful tool allows us to visualize how knowledge evolves through a graph.
Done!
We have equipped our AI Agent with a SOTA memory layer.
Find the complete code in the GitHub repository →
That said, Agents forget everything after each task.
Open-source memory toolkit Graphiti by Zep lets Agents build and query temporally-aware knowledge graphs!
Check the GitHub repo here → (don’t forget to star)
We recommend watching the video attached at the top for better understanding!
Thanks for reading!
Share this post