Skip to main content

Zep Reader

pip install llama-index-readers-zep

The Zep Reader returns a set of texts corresponding to a text query or embeddings retrieved from a Zep Collection. The Reader is initialized with a Zep API URL and optionally an API key. The Reader can then be used to load data from a Zep Document Collection.

About Zep

Zep is a long-term memory store for LLM applications. Zep makes it simple to add relevant documents, chat history memory and rich user data to your LLM app's prompts.

For more information about Zep and the Zep Quick Start Guide, see the Zep documentation.

Usage

Here's an end-to-end example usage of the ZepReader. First, we create a Zep Collection, chunk a document, and add it to the collection.

We then wait for Zep's async embedder to embed the document chunks. Finally, we query the collection and print the results.

import time
from uuid import uuid4

from llama_index.core.node_parser import SimpleNodeParser
from llama_index.core import Document
from zep_python import ZepClient
from zep_python.document import Document as ZepDocument


from llama_index.readers.zep import ZepReader

# Create a Zep collection
zep_api_url = "http://localhost:8000"  # replace with your Zep API URL
collection_name = f"babbage{uuid4().hex}"
file = "babbages_calculating_engine.txt"

print(f"Creating collection {collection_name}")

client = ZepClient(base_url=zep_api_url, api_key="optional_api_key")
collection = client.document.add_collection(
    name=collection_name,  # required
    description="Babbage's Calculating Engine",  # optional
    metadata={"foo": "bar"},  # optional metadata
    embedding_dimensions=1536,  # this must match the model you've configured in Zep
    is_auto_embedded=True,  # use Zep's built-in embedder. Defaults to True
)

node_parser = SimpleNodeParser.from_defaults(chunk_size=250, chunk_overlap=20)

with open(file) as f:
    raw_text = f.read()

print("Splitting text into chunks and adding them to the Zep vector store.")
docs = node_parser.get_nodes_from_documents(
    [Document(text=raw_text)], show_progress=True
)

# Convert nodes to ZepDocument
zep_docs = [ZepDocument(content=d.get_content()) for d in docs]
uuids = collection.add_documents(zep_docs)
print(f"Added {len(uuids)} documents to collection {collection_name}")

print("Waiting for documents to be embedded")
while True:
    c = client.document.get_collection(collection_name)
    print(
        "Embedding status: "
        f"{c.document_embedded_count}/{c.document_count} documents embedded"
    )
    time.sleep(1)
    if c.status == "ready":
        break

query = "Was Babbage awarded a medal?"

# Using the ZepReader to load data from Zep
reader = ZepReader(api_url=zep_api_url, api_key="optional_api_key")
results = reader.load_data(
    collection_name=collection_name, query=query, top_k=3
)

print("\n\n".join([r.text for r in results]))

Metadata

Release files for llama-index-readers-zep 0.5.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for llama-index-readers-zep 0.5.1
File Size Uploaded Provenance Actions
llama_index_readers_zep-0.5.1.tar.gz 4.9 kB Without provenance Details for llama_index_readers_zep-0.5.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for llama-index-readers-zep 0.5.1
File Interpreter ABI Platform Actions
llama_index_readers_zep-0.5.1-py3-none-any.whl Python 3 none any Details for llama_index_readers_zep-0.5.1-py3-none-any.whl

Total release size: 9.4 kB

Release files / llama_index_readers_zep-0.5.1.tar.gz

Download URL llama_index_readers_zep-0.5.1.tar.gz
Size 4.9 kB
Tags Source
SHA-256 checksum
How to use checksums
fcd02385e4e30177a95fcca8442bea27848b30940b52a2f3b8b793901ccf4881
BLAKE2b-256 checksum
How to use checksums
740cef99b468883db5706c7f68d81eb06b1088faa9a017aeb381a1c1e4ac59a7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.12.7 {"installer":{"name":"uv","version":"0.12.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / llama_index_readers_zep-0.5.1-py3-none-any.whl

Download URL llama_index_readers_zep-0.5.1-py3-none-any.whl
Size 4.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
7f3800ffd9522785d5496ddfa23d50bf39f37272522d1bba239e95e5cf556ef8
BLAKE2b-256 checksum
How to use checksums
9b27c0d6cfeaf8daff672674b5003c8dea74c4ecd10de4915b53e524f5f9a32e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.12.7 {"installer":{"name":"uv","version":"0.12.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Security for llama-index-readers-zep 0.5.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page