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.
Python
TypeScript
Go
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 N
th most recent message. The default value of N
is 6.
![Perpetual Memory](https://fdr-prod-docs-files-public.s3.amazonaws.com/zep.docs.buildwithfern.com/2024-09-03T19:00:11.549Z/images/fact-table.png)
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.
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.