docs: Update Zep Messaging, add links to Zep Cloud Docs (#20848)

Thank you for contributing to LangChain!

- [x] **PR title**: docs: Update Zep Messaging, add links to Zep Cloud
Docs

- [x] **PR message**: 
- **Description:** This PR updates Zep messaging in the docs + links to
Langchain Zep Cloud examples in our documentation
    - **Twitter handle:** @paulpaliychuk51


- [x] **Add tests and docs**: If you're adding a new integration, please
include
1. a test for the integration, preferably unit tests that do not rely on
network access,
2. an example notebook showing its use. It lives in
`docs/docs/integrations` directory.


- [x] **Lint and test**: Run `make format`, `make lint` and `make test`
from the root of the package(s) you've modified. See contribution
guidelines for more: https://python.langchain.com/docs/contributing/

Additional guidelines:
- Make sure optional dependencies are imported within a function.
- Please do not add dependencies to pyproject.toml files (even optional
ones) unless they are required for unit tests.
- Most PRs should not touch more than one package.
- Changes should be backwards compatible.
- If you are adding something to community, do not re-import it in
langchain.

If no one reviews your PR within a few days, please @-mention one of
baskaryan, efriis, eyurtsev, hwchase17.
This commit is contained in:
Pavlo Paliychuk 2024-04-24 15:14:54 -04:00 committed by GitHub
parent 8d1167b32f
commit 70ae59bcfe
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 102 additions and 164 deletions

View File

@ -2,26 +2,21 @@
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# Zep\n",
"> Recall, understand, and extract data from chat histories. Power personalized AI experiences.\n",
"\n",
"## Fast, Scalable Building Blocks for LLM Apps\n",
"Zep is an open source platform for productionizing LLM apps. Go from a prototype\n",
"built in LangChain or LlamaIndex, or a custom app, to production in minutes without\n",
"rewriting code.\n",
">[Zep](http://www.getzep.com) is a long-term memory service for AI Assistant apps.\n",
"> With Zep, you can provide AI assistants with the ability to recall past conversations, no matter how distant,\n",
"> while also reducing hallucinations, latency, and cost.\n",
"\n",
"Key Features:\n",
"> Interested in Zep Cloud? See [Zep Cloud Installation Guide](https://help.getzep.com/sdks) and [Zep Cloud Memory Example](https://help.getzep.com/langchain/examples/vectorstore-example)\n",
"\n",
"- **Fast!** Zep operates independently of the your chat loop, ensuring a snappy user experience.\n",
"- **Chat History Memory, Archival, and Enrichment**, populate your prompts with relevant chat history, sumamries, named entities, intent data, and more.\n",
"- **Vector Search over Chat History and Documents** Automatic embedding of documents, chat histories, and summaries. Use Zep's similarity or native MMR Re-ranked search to find the most relevant.\n",
"- **Manage Users and their Chat Sessions** Users and their Chat Sessions are first-class citizens in Zep, allowing you to manage user interactions with your bots or agents easily.\n",
"- **Records Retention and Privacy Compliance** Comply with corporate and regulatory mandates for records retention while ensuring compliance with privacy regulations such as CCPA and GDPR. Fulfill *Right To Be Forgotten* requests with a single API call\n",
"\n",
"Zep project: [https://github.com/getzep/zep](https://github.com/getzep/zep)\n",
"Docs: [https://docs.getzep.com/](https://docs.getzep.com/)\n",
"## Open Source Installation and Setup\n",
"\n",
"> Zep Open Source project: [https://github.com/getzep/zep](https://github.com/getzep/zep)\n",
">\n",
"> Zep Open Source Docs: [https://docs.getzep.com/](https://docs.getzep.com/)\n",
"\n",
"## Example\n",
"\n",
@ -34,7 +29,10 @@
"2. Running an agent and having message automatically added to the store.\n",
"3. Viewing the enriched messages.\n",
"4. Vector search over the conversation history."
]
],
"metadata": {
"collapsed": false
}
},
{
"cell_type": "code",
@ -259,11 +257,11 @@
"text": [
"\n",
"\n",
"\u001b[1m> Entering new chain...\u001b[0m\n",
"\u001b[32;1m\u001b[1;3mThought: Do I need to use a tool? No\n",
"AI: Parable of the Sower is a prescient novel that speaks to the challenges facing contemporary society, such as climate change, inequality, and violence. It is a cautionary tale that warns of the dangers of unchecked greed and the need for individuals to take responsibility for their own lives and the lives of those around them.\u001b[0m\n",
"\u001B[1m> Entering new chain...\u001B[0m\n",
"\u001B[32;1m\u001B[1;3mThought: Do I need to use a tool? No\n",
"AI: Parable of the Sower is a prescient novel that speaks to the challenges facing contemporary society, such as climate change, inequality, and violence. It is a cautionary tale that warns of the dangers of unchecked greed and the need for individuals to take responsibility for their own lives and the lives of those around them.\u001B[0m\n",
"\n",
"\u001b[1m> Finished chain.\u001b[0m\n"
"\u001B[1m> Finished chain.\u001B[0m\n"
]
},
{
@ -394,10 +392,7 @@
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": false,
"jupyter": {
"outputs_hidden": false
}
"collapsed": false
},
"outputs": [],
"source": []

View File

@ -1,23 +1,40 @@
# Zep
> Recall, understand, and extract data from chat histories. Power personalized AI experiences.
>[Zep](http://www.getzep.com) is an open source platform for productionizing LLM apps. Go from a prototype
built in LangChain or LlamaIndex, or a custom app, to production in minutes without
rewriting code.
>[Zep](http://www.getzep.com) 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.
>Key Features:
## 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:
- 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](http://www.getzep.com) 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.
> Interested in Zep Cloud? See [Zep Cloud Installation Guide](https://help.getzep.com/sdks), [Zep Cloud Message History Example](https://help.getzep.com/langchain/examples/messagehistory-example), [Zep Cloud Vector Store Example](https://help.getzep.com/langchain/examples/vectorstore-example)
## Open Source Installation and Setup
> Zep Open Source project: [https://github.com/getzep/zep](https://github.com/getzep/zep)
>
>- **Fast!** Zep operates independently of the your chat loop, ensuring a snappy user experience.
>- **Chat History Memory, Archival, and Enrichment**, populate your prompts with relevant chat history, sumamries, named entities, intent data, and more.
>- **Vector Search over Chat History and Documents** Automatic embedding of documents, chat histories, and summaries. Use Zep's similarity or native MMR Re-ranked search to find the most relevant.
>- **Manage Users and their Chat Sessions** Users and their Chat Sessions are first-class citizens in Zep, allowing you to manage user interactions with your bots or agents easily.
>- **Records Retention and Privacy Compliance** Comply with corporate and regulatory mandates for records retention while ensuring compliance with privacy regulations such as CCPA and GDPR. Fulfill *Right To Be Forgotten* requests with a single API call
>Zep project: [https://github.com/getzep/zep](https://github.com/getzep/zep)
>
>Docs: [https://docs.getzep.com/](https://docs.getzep.com/)
## Installation and Setup
> Zep Open Source Docs: [https://docs.getzep.com/](https://docs.getzep.com/)
1. Install the Zep service. See the [Zep Quick Start Guide](https://docs.getzep.com/deployment/quickstart/).

View File

@ -1,29 +1,28 @@
{
"cells": [
{
"attachments": {},
"cell_type": "markdown",
"metadata": {},
"source": [
"# Zep\n",
"## Retriever Example for [Zep](https://docs.getzep.com/)\n",
"\n",
"### Fast, Scalable Building Blocks for LLM Apps\n",
"Zep is an open source platform for productionizing LLM apps. Go from a prototype\n",
"built in LangChain or LlamaIndex, or a custom app, to production in minutes without\n",
"rewriting code.\n",
"> Recall, understand, and extract data from chat histories. Power personalized AI experiences.\n",
"\n",
"Key Features:\n",
"> [Zep](http://www.getzep.com) is a long-term memory service for AI Assistant apps.\n",
"> With Zep, you can provide AI assistants with the ability to recall past conversations, no matter how distant,\n",
"> while also reducing hallucinations, latency, and cost.\n",
"\n",
"- **Fast!** Zep operates independently of the your chat loop, ensuring a snappy user experience.\n",
"- **Chat History Memory, Archival, and Enrichment**, populate your prompts with relevant chat history, sumamries, named entities, intent data, and more.\n",
"- **Vector Search over Chat History and Documents** Automatic embedding of documents, chat histories, and summaries. Use Zep's similarity or native MMR Re-ranked search to find the most relevant.\n",
"- **Manage Users and their Chat Sessions** Users and their Chat Sessions are first-class citizens in Zep, allowing you to manage user interactions with your bots or agents easily.\n",
"- **Records Retention and Privacy Compliance** Comply with corporate and regulatory mandates for records retention while ensuring compliance with privacy regulations such as CCPA and GDPR. Fulfill *Right To Be Forgotten* requests with a single API call\n",
"> Interested in Zep Cloud? See [Zep Cloud Installation Guide](https://help.getzep.com/sdks) and [Zep Cloud Retriever Example](https://help.getzep.com/langchain/examples/rag-message-history-example)\n",
"\n",
"Zep project: [https://github.com/getzep/zep](https://github.com/getzep/zep)\n",
"Docs: [https://docs.getzep.com/](https://docs.getzep.com/)\n"
]
"## Open Source Installation and Setup\n",
"\n",
"> Zep Open Source project: [https://github.com/getzep/zep](https://github.com/getzep/zep)\n",
">\n",
"> Zep Open Source Docs: [https://docs.getzep.com/](https://docs.getzep.com/)"
],
"metadata": {
"collapsed": false
}
},
{
"attachments": {},
@ -54,10 +53,7 @@
"end_time": "2023-08-11T20:31:12.231459Z",
"start_time": "2023-08-11T20:31:11.211176Z"
},
"collapsed": false,
"jupyter": {
"outputs_hidden": false
}
"collapsed": false
},
"outputs": [],
"source": [
@ -109,10 +105,7 @@
"end_time": "2023-08-11T20:31:12.342790Z",
"start_time": "2023-08-11T20:31:12.235291Z"
},
"collapsed": false,
"jupyter": {
"outputs_hidden": false
}
"collapsed": false
},
"outputs": [],
"source": [
@ -130,10 +123,7 @@
"end_time": "2023-08-11T20:31:14.455269Z",
"start_time": "2023-08-11T20:31:12.345635Z"
},
"collapsed": false,
"jupyter": {
"outputs_hidden": false
}
"collapsed": false
},
"outputs": [],
"source": [
@ -283,10 +273,7 @@
"end_time": "2023-08-11T20:31:14.758738Z",
"start_time": "2023-08-11T20:31:14.458850Z"
},
"collapsed": false,
"jupyter": {
"outputs_hidden": false
}
"collapsed": false
},
"outputs": [
{
@ -333,10 +320,7 @@
"end_time": "2023-08-11T20:31:14.922838Z",
"start_time": "2023-08-11T20:31:14.751737Z"
},
"collapsed": false,
"jupyter": {
"outputs_hidden": false
}
"collapsed": false
},
"outputs": [
{
@ -376,10 +360,7 @@
"end_time": "2023-08-11T20:31:14.923032Z",
"start_time": "2023-08-11T20:31:14.918181Z"
},
"collapsed": false,
"jupyter": {
"outputs_hidden": false
}
"collapsed": false
},
"outputs": [
{

View File

@ -2,37 +2,21 @@
"cells": [
{
"cell_type": "markdown",
"id": "9eb8dfa6fdb71ef5",
"metadata": {
"collapsed": false,
"jupyter": {
"outputs_hidden": false
}
},
"source": [
"# Zep\n",
"> Recall, understand, and extract data from chat histories. Power personalized AI experiences.\n",
"\n",
">[Zep](https://docs.getzep.com/) is an open-source platform for LLM apps. Go from a prototype\n",
">built in LangChain or LlamaIndex, or a custom app, to production in minutes without rewriting code.\n",
">[Zep](http://www.getzep.com) is a long-term memory service for AI Assistant apps.\n",
"> With Zep, you can provide AI assistants with the ability to recall past conversations, no matter how distant,\n",
"> while also reducing hallucinations, latency, and cost.\n",
"\n",
"## Key Features:\n",
"> Interested in Zep Cloud? See [Zep Cloud Installation Guide](https://help.getzep.com/sdks) and [Zep Cloud Vector Store example](https://help.getzep.com/langchain/examples/messagehistory-example)\n",
"\n",
"- **Fast!** `Zep` operates independently of your chat loop, ensuring a snappy user experience.\n",
"- **Chat History Memory, Archival, and Enrichment**, populate your prompts with relevant chat history, summaries, named entities, intent data, and more.\n",
"- **Vector Search over Chat History and Documents** Automatic embedding of documents, chat histories, and summaries. Use Zep's similarity or native MMR Re-ranked search to find the most relevant.\n",
"- **Manage Users and their Chat Sessions** Users and their Chat Sessions are first-class citizens in Zep, allowing you to manage user interactions with your bots or agents easily.\n",
"- **Records Retention and Privacy Compliance** Comply with corporate and regulatory mandates for records retention while ensuring compliance with privacy regulations such as CCPA and GDPR. Fulfill *Right To Be Forgotten* requests with a single API call\n",
"## Open Source Installation and Setup\n",
"\n",
"**Note:** The `ZepVectorStore` works with `Documents` and is intended to be used as a `Retriever`.\n",
"It offers separate functionality to Zep's `ZepMemory` class, which is designed for persisting, enriching\n",
"and searching your user's chat history.\n",
"\n",
"## Installation\n",
"\n",
"Follow the [Zep Quickstart Guide](https://docs.getzep.com/deployment/quickstart/) to install and get started with Zep.\n",
"\n",
"You'll need your Zep API URL and optionally an API key to use the Zep VectorStore. \n",
"See the [Zep docs](https://docs.getzep.com) for more information.\n",
"> Zep Open Source project: [https://github.com/getzep/zep](https://github.com/getzep/zep)\n",
">\n",
"> Zep Open Source Docs: [https://docs.getzep.com/](https://docs.getzep.com/)\n",
"\n",
"## Usage\n",
"\n",
@ -44,16 +28,17 @@
"- If you pass in an `Embeddings` instance Zep will use this to embed documents rather than auto-embed them.\n",
"You must also set your document collection to `isAutoEmbedded === false`. \n",
"- If you set your collection to `isAutoEmbedded === false`, you must pass in an `Embeddings` instance."
]
],
"metadata": {
"collapsed": false
},
"id": "182f1b4f6cc28385"
},
{
"cell_type": "markdown",
"id": "9a3a11aab1412d98",
"metadata": {
"collapsed": false,
"jupyter": {
"outputs_hidden": false
}
"collapsed": false
},
"source": [
"## Load or create a Collection from documents"
@ -68,10 +53,7 @@
"end_time": "2023-08-13T01:07:50.672390Z",
"start_time": "2023-08-13T01:07:48.777799Z"
},
"collapsed": false,
"jupyter": {
"outputs_hidden": false
}
"collapsed": false
},
"outputs": [],
"source": [
@ -125,10 +107,7 @@
"end_time": "2023-08-13T01:07:53.807663Z",
"start_time": "2023-08-13T01:07:50.671241Z"
},
"collapsed": false,
"jupyter": {
"outputs_hidden": false
}
"collapsed": false
},
"outputs": [
{
@ -174,10 +153,7 @@
"cell_type": "markdown",
"id": "94ca9dfa7d0ecaa5",
"metadata": {
"collapsed": false,
"jupyter": {
"outputs_hidden": false
}
"collapsed": false
},
"source": [
"## Simarility Search Query over the Collection"
@ -192,10 +168,7 @@
"end_time": "2023-08-13T01:07:54.195988Z",
"start_time": "2023-08-13T01:07:53.808550Z"
},
"collapsed": false,
"jupyter": {
"outputs_hidden": false
}
"collapsed": false
},
"outputs": [
{
@ -228,8 +201,7 @@
"mechanical connexion of the solid members of the bodies of men and\n",
"animals, but likewise the structure and operation of the softer parts,\n",
"including the muscles, integuments, membranes, &c. the nature, motion, -> 0.8899750214770481 \n",
"====\n",
"\n"
"====\n"
]
}
],
@ -247,10 +219,7 @@
"cell_type": "markdown",
"id": "e02b61a9af0b2c80",
"metadata": {
"collapsed": false,
"jupyter": {
"outputs_hidden": false
}
"collapsed": false
},
"source": [
"## Search over Collection Re-ranked by MMR\n",
@ -267,10 +236,7 @@
"end_time": "2023-08-13T01:07:54.394873Z",
"start_time": "2023-08-13T01:07:54.180901Z"
},
"collapsed": false,
"jupyter": {
"outputs_hidden": false
}
"collapsed": false
},
"outputs": [
{
@ -303,8 +269,7 @@
"expedients adopted in this machinery;--although such is the perfection\n",
"of their action, that in any ordinary case they would be regarded as\n",
"having attained the ends in view with an almost superfluous degree of \n",
"====\n",
"\n"
"====\n"
]
}
],
@ -320,10 +285,7 @@
"cell_type": "markdown",
"id": "42455e31d4ab0d68",
"metadata": {
"collapsed": false,
"jupyter": {
"outputs_hidden": false
}
"collapsed": false
},
"source": [
"# Filter by Metadata\n",
@ -340,10 +302,7 @@
"end_time": "2023-08-13T01:08:06.323569Z",
"start_time": "2023-08-13T01:07:54.381822Z"
},
"collapsed": false,
"jupyter": {
"outputs_hidden": false
}
"collapsed": false
},
"outputs": [
{
@ -389,10 +348,7 @@
"cell_type": "markdown",
"id": "5b225f3ae1e61de8",
"metadata": {
"collapsed": false,
"jupyter": {
"outputs_hidden": false
}
"collapsed": false
},
"source": [
"We see results from both books. Note the `source` metadata"
@ -407,10 +363,7 @@
"end_time": "2023-08-13T01:08:06.504769Z",
"start_time": "2023-08-13T01:08:06.325435Z"
},
"collapsed": false,
"jupyter": {
"outputs_hidden": false
}
"collapsed": false
},
"outputs": [
{
@ -442,8 +395,7 @@
"astronomer is interrupted in his pursuit, and diverted from his task of\n",
"observation by the irksome labours of computation, or his diligence in\n",
"observing becomes ineffectual for want of yet greater industry of -> {'source': 'https://www.gutenberg.org/cache/epub/71292/pg71292.txt'} \n",
"====\n",
"\n"
"====\n"
]
}
],
@ -459,10 +411,7 @@
"cell_type": "markdown",
"id": "7b81d7cae351a1ec",
"metadata": {
"collapsed": false,
"jupyter": {
"outputs_hidden": false
}
"collapsed": false
},
"source": [
"Now, we set up a filter"
@ -477,10 +426,7 @@
"end_time": "2023-08-13T01:08:06.672836Z",
"start_time": "2023-08-13T01:08:06.505944Z"
},
"collapsed": false,
"jupyter": {
"outputs_hidden": false
}
"collapsed": false
},
"outputs": [
{
@ -518,8 +464,7 @@
"shutter, heavily barred, was folded across it. It was a wonderfully\n",
"silent house. There was an old clock ticking loudly somewhere in the\n",
"passage, but otherwise everything was deadly still. A vague feeling of -> {'source': 'https://www.gutenberg.org/files/48320/48320-0.txt'} \n",
"====\n",
"\n"
"====\n"
]
}
],