Long-Term Memory for AI Assistants. This is the Python client for the Zep service.
Project description
Zep: Long-Term Memory for AI Assistants.
Recall, understand, and extract data from chat histories. Power personalized AI experiences.
Quick Start |
Documentation |
LangChain and
LlamaIndex Support |
Discord
www.getzep.com
What is Zep? 💬
Zep is a long-term memory service for AI Assistant apps. With Zep, you can provide AI assistants with the ability to recall past conversations, no matter how distant, while also reducing hallucinations, latency, and cost.
How Zep works
Zep does all of this asynchronously, ensuring these operations don't impact your user's chat experience. Data is persisted to database, allowing you to scale out when growth demands.
Zep also provides a simple, easy to use abstraction for document vector search called Document Collections. This is designed to complement Zep's core memory features, but is not designed to be a general purpose vector database.
Zep allows you to be more intentional about constructing your prompt:
- automatically adding a few recent messages, with the number customized for your app;
- a summary of recent conversations prior to the messages above;
- and/or contextually relevant summaries or messages surfaced from the entire chat session.
- and/or relevant Business data from Zep Document Collections.
What is Zep Cloud? ⚡️
Zep Cloud is a managed service with Zep Open Source at its core. In addition to Zep Open Source's memory management features, Zep Cloud offers:
- Fact Extraction: Automatically build fact tables from conversations, without having to define a data schema upfront.
- Dialog Classification: Instantly and accurately classify chat dialog. Understand user intent and emotion, segment users, and more. Route chains based on semantic context, and trigger events.
- Structured Data Extraction: Quickly extract business data from chat conversations using a schema you define. Understand what your Assistant should ask for next in order to complete its task.
Zep Python Client
This is the Python client package for the Zep service. For more information about Zep, see https://github.com/getzep/zep.
Zep QuickStart Guide: https://docs.getzep.com/deployment/quickstart
Zep Documentation: https://docs.getzep.com
Installation
pip install zep-python
-- OR --
poetry add zep-python
Zep Cloud Installation
In order to install Zep Python SDK with Zep Cloud support, you will need to install a release candidate version.
pip install --pre zep-python
-- OR --
poetry add zep-python@^2.0.0rc
You will also need to provide a Zep Project API key to your zep client for cloud support. You can find out about Zep Projects in our cloud docs
Using LangChain Zep Classes with zep-python
(Currently only available on release candidate versions)
In the pre-release version zep-python
sdk comes with ZepChatMessageHistory
and ZepVectorStore
classes that are compatible with LangChain's Python expression language
In order to use these classes in your application, you need to make sure that you have
langchain_core
package installed, please refer to Langchain's docs installation section.
We support langchain_core@>=0.1.3<0.2.0
You can import these classes in the following way:
from zep_python.langchain import ZepChatMessageHistory, ZepVectorStore
Running Examples
You will need to set the following environment variables to run examples in the examples
directory:
# Please use examples/.env.example as a template for .env file
# Required
ZEP_API_KEY=<zep-project-api-key># Your Zep Project API Key
ZEP_COLLECTION=<zep-collection-name># used in ingestion script and in vector store examples
OPENAI_API_KEY=<openai-api-key># Your OpenAI API Key
# Optional (If you want to use langsmith with LangServe Sample App)
LANGCHAIN_TRACING_V2=true
LANGCHAIN_API_KEY=<your-langchain-api-key>
LANGCHAIN_PROJECT=<your-langchain-project-name># If not specified, defaults to "default"
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file zep_python-2.0.0rc6.tar.gz
.
File metadata
- Download URL: zep_python-2.0.0rc6.tar.gz
- Upload date:
- Size: 28.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.0.0 CPython/3.12.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 27a6632068c5ae6bac30d0626d49f8f5e5bc2a3922557ce11bf8df006ca071f4 |
|
MD5 | 07feb60e3c5f2f82ad55692111518004 |
|
BLAKE2b-256 | 4ac8509bd2228d434bd4c8a81d9ba8c91d61b9bd1bf98ef735e18436b623a4ae |
File details
Details for the file zep_python-2.0.0rc6-py3-none-any.whl
.
File metadata
- Download URL: zep_python-2.0.0rc6-py3-none-any.whl
- Upload date:
- Size: 34.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.0.0 CPython/3.12.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2719e06897957facd4e5edbf89706c01d3c68b0c0543bbe24da56a57bff99d68 |
|
MD5 | 675b39ede0cbf8a0b4153cd3e1c61f17 |
|
BLAKE2b-256 | 469c9049b99d8b28d44bccd289708f4099e02012ae82b5b870dee3ab606b7753 |