Memory Retrieval

With Zep's Chat History features you can ensure that your assistant's responses are always relevant to the conversation.

The Zep Memory API provides a high-level interface for persisting and retrieving memory artifacts such as Messages, Sessions, and Facts.

The Memory API is an opinionated, Session-specific API.

Looking for more control over what artifacts are returned or retrieval of artifacts from across multiple Sessions? Explore using Zep’s Search API
1memory = await client.memory.get(session_id)

Review the Memory Get API documentation for additional arguments and options.

The Memory API returns Facts relevant to the current conversation, a Summary, and the most recent messages in a conversation.

The number of most recent messages can be configured via the last_n call argument. The Summary returned is the most recent summary created prior to the Nth most recent message. The default value of N is 6.

Artifact+
{Relevant Facts}Facts relevant to the current conversation.
{Prior Summary}The most recent summary created prior to the oldest message below.
Please see Summaries for limitations and considerations for use.
{Messages}The most recent N messages in the chat history.
Perpetual Memory

Summary Retriever Memory

This memory type is deprecated. Please use the Memory API default perpetual memory type instead.

Summary Retriever Memory returns past Summaries relevant to the current conversation. It does this by running a semantic similarity search over past Summaries within a Session, reranking them, and returning the most relevant ones.

Since summaries are generated regularly and may be similar to one another, we rerank the returned summaries using MMR, a technique to increase the diversity of the returned results.

Alongside similar summaries, Zep also returns the most recent N messages in the chat history and the most recent summary created prior to the oldest message returned. These artifacts offer a rich context for your Assistant, particularly where nuance of the past conversation is important.

Summary Retriever Memory+
{Relevant Summaries}The most relevant summaries from the chat history.
{Prior Summary}The most recent summary created prior to the oldest message below.
{Messages}The most recent N messages in the chat history.

Message Window Buffer Memory

This memory type is deprecated. Please use the Memory API default perpetual memory type instead.

Message Window Buffer Memory is Zep’s simplest memory type and it returns the most recent N messages from the current conversation and the Summary generated prior to the oldest message returned.

Message Window Buffer Memory+
{Prior Summary}The most recent summary created prior to the oldest message below.
{Messages}The most recent N messages in the chat history.