Skip to main content

No project description provided

Project description

Release to PyPI GitHub fern shield

Zep Logo

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.

Installation Notes

Main branch contains the latest version of zep-cloud sdk. You can install it by running:

pip install zep-cloud

-- OR --

poetry add zep-cloud

Open Source Compatible SDK is available in the oss branch, where you can also find Open Source compatible examples. You can install it by running:

pip install zep-python

-- OR --

poetry add zep-python

How Zep works

Zep persists and recalls chat histories, and automatically generates summaries and other artifacts from these chat histories. It also embeds messages and summaries, enabling you to search Zep for relevant context from past conversations. 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:

  1. automatically adding a few recent messages, with the number customized for your app;
  2. a summary of recent conversations prior to the messages above;
  3. and/or contextually relevant summaries or messages surfaced from the entire chat session.
  4. and/or relevant Business data from Zep Document Collections.

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.

You will also need to provide a Zep Project API key to your zep client. 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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

zep_python-2.0.2.tar.gz (22.3 kB view details)

Uploaded Source

Built Distribution

zep_python-2.0.2-py3-none-any.whl (40.0 kB view details)

Uploaded Python 3

File details

Details for the file zep_python-2.0.2.tar.gz.

File metadata

  • Download URL: zep_python-2.0.2.tar.gz
  • Upload date:
  • Size: 22.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.1 CPython/3.12.6

File hashes

Hashes for zep_python-2.0.2.tar.gz
Algorithm Hash digest
SHA256 919fd635ad5801f30d9ef6da0bb99e854ed4c3cd1357dc8ada4a39b8171a41bc
MD5 324ebd9f8bee296018aac611ee4f9698
BLAKE2b-256 b5641b0c4afa6d0e8f35e1072eacdfe8ec216871be5f2dfd569942f69232482f

See more details on using hashes here.

File details

Details for the file zep_python-2.0.2-py3-none-any.whl.

File metadata

  • Download URL: zep_python-2.0.2-py3-none-any.whl
  • Upload date:
  • Size: 40.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.1 CPython/3.12.6

File hashes

Hashes for zep_python-2.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 d7b2cadf1eb15007825362cae5ddff9c9d0ada5b4f75cf91e5b87986459f7817
MD5 39841f66418159168a1ec6f61785be2d
BLAKE2b-256 1cd409a6bc0c32f91b7b5b93322513d51299ca9b35bdd6b0560b39104c296f39

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page