Skip to content

Latest commit

 

History

History
5131 lines (3538 loc) · 58.5 KB

File metadata and controls

5131 lines (3538 loc) · 58.5 KB

Reference

Context

client.context.list_context_templates()

📝 Description

Lists all context templates.

🔌 Usage

from zep_cloud import Zep

client = Zep(
    api_key="YOUR_API_KEY",
)
client.context.list_context_templates()

⚙️ Parameters

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.context.create_context_template(...)

📝 Description

Creates a new context template.

🔌 Usage

from zep_cloud import Zep

client = Zep(
    api_key="YOUR_API_KEY",
)
client.context.create_context_template(
    template="template",
    template_id="template_id",
)

⚙️ Parameters

template: str — The template content (max 1200 characters).

template_id: str — Unique identifier for the template (max 100 characters).

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.context.get_context_template(...)

📝 Description

Retrieves a context template by template_id.

🔌 Usage

from zep_cloud import Zep

client = Zep(
    api_key="YOUR_API_KEY",
)
client.context.get_context_template(
    template_id="template_id",
)

⚙️ Parameters

template_id: str — Template ID

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.context.update_context_template(...)

📝 Description

Updates an existing context template by template_id.

🔌 Usage

from zep_cloud import Zep

client = Zep(
    api_key="YOUR_API_KEY",
)
client.context.update_context_template(
    template_id="template_id",
    template="template",
)

⚙️ Parameters

template_id: str — Template ID

template: str — The template content (max 1200 characters).

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.context.delete_context_template(...)

📝 Description

Deletes a context template by template_id.

🔌 Usage

from zep_cloud import Zep

client = Zep(
    api_key="YOUR_API_KEY",
)
client.context.delete_context_template(
    template_id="template_id",
)

⚙️ Parameters

template_id: str — Template ID

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

Graph

client.graph.list_custom_instructions(...)

📝 Description

Lists all custom instructions for a project, user, or graph.

🔌 Usage

from zep_cloud import Zep

client = Zep(
    api_key="YOUR_API_KEY",
)
client.graph.list_custom_instructions(
    user_id="user_id",
    graph_id="graph_id",
)

⚙️ Parameters

user_id: typing.Optional[str] — User ID to get user-specific instructions

graph_id: typing.Optional[str] — Graph ID to get graph-specific instructions

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.graph.add_custom_instructions(...)

📝 Description

Adds new custom instructions for graphs without removing existing ones. If user_ids or graph_ids is empty, adds to project-wide default instructions.

🔌 Usage

from zep_cloud import CustomInstruction, Zep

client = Zep(
    api_key="YOUR_API_KEY",
)
client.graph.add_custom_instructions(
    instructions=[
        CustomInstruction(
            name="name",
            text="text",
        )
    ],
)

⚙️ Parameters

instructions: typing.Sequence[CustomInstruction] — Instructions to add to the graph.

graph_ids: typing.Optional[typing.Sequence[str]] — Graph IDs to add the instructions to. If empty, the instructions are added to the project-wide default.

user_ids: typing.Optional[typing.Sequence[str]] — User IDs to add the instructions to. If empty, the instructions are added to the project-wide default.

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.graph.delete_custom_instructions(...)

📝 Description

Deletes custom instructions for graphs or project wide defaults.

🔌 Usage

from zep_cloud import Zep

client = Zep(
    api_key="YOUR_API_KEY",
)
client.graph.delete_custom_instructions()

⚙️ Parameters

graph_ids: typing.Optional[typing.Sequence[str]] — Determines which group graphs will have their custom instructions deleted. If no graphs are provided, the project-wide custom instructions will be affected.

instruction_names: typing.Optional[typing.Sequence[str]] — Unique identifier for the instructions to be deleted. If empty deletes all instructions.

user_ids: typing.Optional[typing.Sequence[str]] — Determines which user graphs will have their custom instructions deleted. If no users are provided, the project-wide custom instructions will be affected.

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.graph.list_entity_types(...)

📝 Description

Returns all entity types for a project, user, or graph.

🔌 Usage

from zep_cloud import Zep

client = Zep(
    api_key="YOUR_API_KEY",
)
client.graph.list_entity_types(
    user_id="user_id",
    graph_id="graph_id",
)

⚙️ Parameters

user_id: typing.Optional[str] — User ID to get user-specific entity types

graph_id: typing.Optional[str] — Graph ID to get graph-specific entity types

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.graph.set_entity_types_internal(...)

📝 Description

Sets the entity types for multiple users and graphs, replacing any existing ones.

🔌 Usage

from zep_cloud import Zep

client = Zep(
    api_key="YOUR_API_KEY",
)
client.graph.set_entity_types_internal()

⚙️ Parameters

edge_types: typing.Optional[typing.Sequence[EdgeType]]

entity_types: typing.Optional[typing.Sequence[EntityType]]

graph_ids: typing.Optional[typing.Sequence[str]]

user_ids: typing.Optional[typing.Sequence[str]]

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.graph.add(...)

📝 Description

Add data to the graph.

🔌 Usage

from zep_cloud import Zep

client = Zep(
    api_key="YOUR_API_KEY",
)
client.graph.add(
    data="data",
    type="text",
)

⚙️ Parameters

data: str

type: GraphDataType

created_at: typing.Optional[str]

graph_id: typing.Optional[str] — graph_id is the ID of the graph to which the data will be added. If adding to the user graph, please use user_id field instead.

source_description: typing.Optional[str]

user_id: typing.Optional[str] — User ID is the ID of the user to which the data will be added. If not adding to a user graph, please use graph_id field instead.

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.graph.add_batch(...)

📝 Description

Add data to the graph in batch mode. Episodes are processed sequentially in the order provided.

🔌 Usage

from zep_cloud import EpisodeData, Zep

client = Zep(
    api_key="YOUR_API_KEY",
)
client.graph.add_batch(
    episodes=[
        EpisodeData(
            data="data",
            type="text",
        )
    ],
)

⚙️ Parameters

episodes: typing.Sequence[EpisodeData]

graph_id: typing.Optional[str] — graph_id is the ID of the graph to which the data will be added. If adding to the user graph, please use user_id field instead.

user_id: typing.Optional[str] — User ID is the ID of the user to which the data will be added. If not adding to a user graph, please use graph_id field instead.

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.graph.add_fact_triple(...)

📝 Description

Add a fact triple for a user or group

🔌 Usage

from zep_cloud import Zep

client = Zep(
    api_key="YOUR_API_KEY",
)
client.graph.add_fact_triple(
    fact="fact",
    fact_name="fact_name",
)

⚙️ Parameters

fact: str — The fact relating the two nodes that this edge represents

fact_name: str — The name of the edge to add. Should be all caps using snake case (eg RELATES_TO)

created_at: typing.Optional[str] — The timestamp of the message

edge_attributes: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]]

Additional attributes of the edge. Values must be scalar types (string, number, boolean, or null). Nested objects and arrays are not allowed.

expired_at: typing.Optional[str] — The time (if any) at which the edge expires

fact_uuid: typing.Optional[str] — The uuid of the edge to add

graph_id: typing.Optional[str]

invalid_at: typing.Optional[str] — The time (if any) at which the fact stops being true

source_node_attributes: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]]

Additional attributes of the source node. Values must be scalar types (string, number, boolean, or null). Nested objects and arrays are not allowed.

source_node_labels: typing.Optional[typing.Sequence[str]] — The labels for the source node

source_node_name: typing.Optional[str] — The name of the source node to add

source_node_summary: typing.Optional[str] — The summary of the source node to add

source_node_uuid: typing.Optional[str] — The source node uuid

target_node_attributes: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]]

Additional attributes of the target node. Values must be scalar types (string, number, boolean, or null). Nested objects and arrays are not allowed.

target_node_labels: typing.Optional[typing.Sequence[str]] — The labels for the target node

target_node_name: typing.Optional[str] — The name of the target node to add

target_node_summary: typing.Optional[str] — The summary of the target node to add

target_node_uuid: typing.Optional[str] — The target node uuid

user_id: typing.Optional[str]

valid_at: typing.Optional[str] — The time at which the fact becomes true

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.graph.clone(...)

📝 Description

Clone a user or group graph.

🔌 Usage

from zep_cloud import Zep

client = Zep(
    api_key="YOUR_API_KEY",
)
client.graph.clone()

⚙️ Parameters

source_graph_id: typing.Optional[str] — source_graph_id is the ID of the graph to be cloned. Required if source_user_id is not provided

source_user_id: typing.Optional[str] — user_id of the user whose graph is being cloned. Required if source_graph_id is not provided

target_graph_id: typing.Optional[str] — target_graph_id is the ID to be set on the cloned graph. Must not point to an existing graph. Required if target_user_id is not provided.

target_user_id: typing.Optional[str] — user_id to be set on the cloned user. Must not point to an existing user. Required if target_graph_id is not provided.

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.graph.create(...)

📝 Description

Creates a new graph.

🔌 Usage

from zep_cloud import Zep

client = Zep(
    api_key="YOUR_API_KEY",
)
client.graph.create(
    graph_id="graph_id",
)

⚙️ Parameters

graph_id: str

description: typing.Optional[str]

name: typing.Optional[str]

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.graph.list_all(...)

📝 Description

Returns all graphs. In order to list users, use user.list_ordered instead

🔌 Usage

from zep_cloud import Zep

client = Zep(
    api_key="YOUR_API_KEY",
)
client.graph.list_all(
    page_number=1,
    page_size=1,
    order_by="order_by",
    asc=True,
)

⚙️ Parameters

page_number: typing.Optional[int] — Page number for pagination, starting from 1.

page_size: typing.Optional[int] — Number of graphs to retrieve per page.

order_by: typing.Optional[str] — Column to sort by (created_at, group_id, name).

asc: typing.Optional[bool] — Sort in ascending order.

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.graph.detect_patterns(...)

📝 Description

Detects structural patterns in a knowledge graph including relationship frequencies, multi-hop paths, co-occurrences, hubs, and clusters. When a query is provided, uses hybrid search to discover seed nodes, detects triple-frequency patterns, and returns resolved edges ranked by relevance.

🔌 Usage

from zep_cloud import Zep

client = Zep(
    api_key="YOUR_API_KEY",
)
client.graph.detect_patterns()

⚙️ Parameters

detect: typing.Optional[DetectConfig]

Which pattern types to detect with type-specific configuration. Omit to detect all types with defaults. Ignored when query is set.

edge_limit: typing.Optional[int] — Max resolved edges per pattern. Default: 10, Max: 100. Only used with query.

graph_id: typing.Optional[str] — Graph ID when detecting patterns on a named graph

limit: typing.Optional[int] — Max patterns to return. Default: 50, Max: 200

min_occurrences: typing.Optional[int] — Minimum occurrence count to report a pattern. Default: 2

query: typing.Optional[str]

Search query for discovering seed nodes via hybrid search. When set, forces triple-frequency detection only and enables edge resolution with cross-encoder reranking. Mutually exclusive with seeds.

query_limit: typing.Optional[int] — Max seed nodes from search. Default: 10, Max: 50. Only used with query.

recency_weight: typing.Optional[RecencyWeight]

Exponential half-life decay applied to edge created_at timestamps. Valid values: none, 7_days, 30_days, 90_days. Default: none

search_filters: typing.Optional[SearchFilters]

Filters which edges/nodes participate in pattern detection. Reuses the same filter format as /graph/search.

seeds: typing.Optional[PatternSeeds] — Seed selection. If omitted, analyzes the entire graph. Mutually exclusive with query.

user_id: typing.Optional[str] — User ID when detecting patterns on a user graph

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.graph.search(...)

📝 Description

Perform a graph search query.

🔌 Usage

from zep_cloud import Zep

client = Zep(
    api_key="YOUR_API_KEY",
)
client.graph.search(
    query="query",
)

⚙️ Parameters

query: str — The string to search for (required)

bfs_origin_node_uuids: typing.Optional[typing.Sequence[str]] — Nodes that are the origins of the BFS searches

center_node_uuid: typing.Optional[str] — Node to rerank around for node distance reranking

graph_id: typing.Optional[str] — The graph_id to search in. When searching user graph, please use user_id instead.

limit: typing.Optional[int] — The maximum number of facts to retrieve. Defaults to 10. Limited to 50.

mmr_lambda: typing.Optional[float] — weighting for maximal marginal relevance

reranker: typing.Optional[Reranker] — Defaults to RRF

scope: typing.Optional[GraphSearchScope] — Defaults to Edges. Communities will be added in the future.

search_filters: typing.Optional[SearchFilters] — Search filters to apply to the search

user_id: typing.Optional[str] — The user_id when searching user graph. If not searching user graph, please use graph_id instead.

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.graph.get(...)

📝 Description

Returns a graph.

🔌 Usage

from zep_cloud import Zep

client = Zep(
    api_key="YOUR_API_KEY",
)
client.graph.get(
    graph_id="graphId",
)

⚙️ Parameters

graph_id: str — The graph_id of the graph to get.

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.graph.delete(...)

📝 Description

Deletes a graph. If you would like to delete a user graph, make sure to use user.delete instead.

🔌 Usage

from zep_cloud import Zep

client = Zep(
    api_key="YOUR_API_KEY",
)
client.graph.delete(
    graph_id="graphId",
)

⚙️ Parameters

graph_id: str — Graph ID

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.graph.update(...)

📝 Description

Updates information about a graph.

🔌 Usage

from zep_cloud import Zep

client = Zep(
    api_key="YOUR_API_KEY",
)
client.graph.update(
    graph_id="graphId",
)

⚙️ Parameters

graph_id: str — Graph ID

description: typing.Optional[str]

name: typing.Optional[str]

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

Project

client.project.get()

📝 Description

Retrieve project info based on the provided api key.

🔌 Usage

from zep_cloud import Zep

client = Zep(
    api_key="YOUR_API_KEY",
)
client.project.get()

⚙️ Parameters

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

Task

client.task.get(...)

📝 Description

Gets a task by its ID

🔌 Usage

from zep_cloud import Zep

client = Zep(
    api_key="YOUR_API_KEY",
)
client.task.get(
    task_id="task_id",
)

⚙️ Parameters

task_id: str — Task ID

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

Thread

client.thread.list_all(...)

📝 Description

Returns all threads.

🔌 Usage

from zep_cloud import Zep

client = Zep(
    api_key="YOUR_API_KEY",
)
client.thread.list_all(
    page_number=1,
    page_size=1,
    order_by="order_by",
    asc=True,
)

⚙️ Parameters

page_number: typing.Optional[int] — Page number for pagination, starting from 1

page_size: typing.Optional[int] — Number of threads to retrieve per page.

order_by: typing.Optional[str] — Field to order the results by: created_at, updated_at, user_id, thread_id.

asc: typing.Optional[bool] — Order direction: true for ascending, false for descending.

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.thread.create(...)

📝 Description

Start a new thread.

🔌 Usage

from zep_cloud import Zep

client = Zep(
    api_key="YOUR_API_KEY",
)
client.thread.create(
    thread_id="thread_id",
    user_id="user_id",
)

⚙️ Parameters

thread_id: str — The unique identifier of the thread.

user_id: str — The unique identifier of the user associated with the thread

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.thread.delete(...)

📝 Description

Deletes a thread.

🔌 Usage

from zep_cloud import Zep

client = Zep(
    api_key="YOUR_API_KEY",
)
client.thread.delete(
    thread_id="threadId",
)

⚙️ Parameters

thread_id: str — The ID of the thread for which memory should be deleted.

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.thread.get_user_context(...)

📝 Description

Returns most relevant context from the user graph (including memory from any/all past threads) based on the content of the past few messages of the given thread.

🔌 Usage

from zep_cloud import Zep

client = Zep(
    api_key="YOUR_API_KEY",
)
client.thread.get_user_context(
    thread_id="threadId",
    template_id="template_id",
)

⚙️ Parameters

thread_id: str — The ID of the current thread (for which context is being retrieved).

template_id: typing.Optional[str] — Optional template ID to use for custom context rendering.

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.thread.get(...)

📝 Description

Returns messages for a thread.

🔌 Usage

from zep_cloud import Zep

client = Zep(
    api_key="YOUR_API_KEY",
)
client.thread.get(
    thread_id="threadId",
    limit=1,
    cursor=1,
    lastn=1,
)

⚙️ Parameters

thread_id: str — Thread ID

limit: typing.Optional[int] — Limit the number of results returned

cursor: typing.Optional[int] — Cursor for pagination

lastn: typing.Optional[int] — Number of most recent messages to return (overrides limit and cursor)

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.thread.add_messages(...)

📝 Description

Add messages to a thread.

🔌 Usage

from zep_cloud import Message, Zep

client = Zep(
    api_key="YOUR_API_KEY",
)
client.thread.add_messages(
    thread_id="threadId",
    messages=[
        Message(
            content="content",
            role="norole",
        )
    ],
)

⚙️ Parameters

thread_id: str — The ID of the thread to which messages should be added.

messages: typing.Sequence[Message] — A list of message objects, where each message contains a role and content.

ignore_roles: typing.Optional[typing.Sequence[RoleType]]

Optional list of role types to ignore when adding messages to graph memory. The message itself will still be added, retained and used as context for messages that are added to a user's graph.

return_context: typing.Optional[bool] — Optionally return context block relevant to the most recent messages.

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.thread.add_messages_batch(...)

📝 Description

Add messages to a thread in batch mode. This will process messages concurrently, which is useful for data migrations.

🔌 Usage

from zep_cloud import Message, Zep

client = Zep(
    api_key="YOUR_API_KEY",
)
client.thread.add_messages_batch(
    thread_id="threadId",
    messages=[
        Message(
            content="content",
            role="norole",
        )
    ],
)

⚙️ Parameters

thread_id: str — The ID of the thread to which messages should be added.

messages: typing.Sequence[Message] — A list of message objects, where each message contains a role and content.

ignore_roles: typing.Optional[typing.Sequence[RoleType]]

Optional list of role types to ignore when adding messages to graph memory. The message itself will still be added, retained and used as context for messages that are added to a user's graph.

return_context: typing.Optional[bool] — Optionally return context block relevant to the most recent messages.

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

User

client.user.list_user_summary_instructions(...)

📝 Description

Lists all user summary instructions for a project, user.

🔌 Usage

from zep_cloud import Zep

client = Zep(
    api_key="YOUR_API_KEY",
)
client.user.list_user_summary_instructions(
    user_id="user_id",
)

⚙️ Parameters

user_id: typing.Optional[str] — User ID to get user-specific instructions

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.user.add_user_summary_instructions(...)

📝 Description

Adds new summary instructions for users graphs without removing existing ones. If user_ids is empty, adds to project-wide default instructions.

🔌 Usage

from zep_cloud import UserInstruction, Zep

client = Zep(
    api_key="YOUR_API_KEY",
)
client.user.add_user_summary_instructions(
    instructions=[
        UserInstruction(
            name="name",
            text="text",
        )
    ],
)

⚙️ Parameters

instructions: typing.Sequence[UserInstruction] — Instructions to add to the user summary generation.

user_ids: typing.Optional[typing.Sequence[str]] — User IDs to add the instructions to. If empty, the instructions are added to the project-wide default.

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.user.delete_user_summary_instructions(...)

📝 Description

Deletes user summary/instructions for users or project wide defaults.

🔌 Usage

from zep_cloud import Zep

client = Zep(
    api_key="YOUR_API_KEY",
)
client.user.delete_user_summary_instructions()

⚙️ Parameters

instruction_names: typing.Optional[typing.Sequence[str]] — Unique identifier for the instructions to be deleted. If empty deletes all instructions.

user_ids: typing.Optional[typing.Sequence[str]] — Determines which users will have their custom instructions deleted. If no users are provided, the project-wide custom instructions will be effected.

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.user.add(...)

📝 Description

Adds a user.

🔌 Usage

from zep_cloud import Zep

client = Zep(
    api_key="YOUR_API_KEY",
)
client.user.add(
    user_id="user_id",
)

⚙️ Parameters

user_id: str — The unique identifier of the user.

disable_default_ontology: typing.Optional[bool] — When true, disables the use of default/fallback ontology for the user's graph.

email: typing.Optional[str] — The email address of the user.

first_name: typing.Optional[str] — The first name of the user.

last_name: typing.Optional[str] — The last name of the user.

metadata: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] — The metadata associated with the user.

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.user.list_ordered(...)

📝 Description

Returns all users.

🔌 Usage

from zep_cloud import Zep

client = Zep(
    api_key="YOUR_API_KEY",
)
client.user.list_ordered(
    page_number=1,
    page_size=1,
    search="search",
    order_by="order_by",
    asc=True,
)

⚙️ Parameters

page_number: typing.Optional[int] — Page number for pagination, starting from 1

page_size: typing.Optional[int] — Number of users to retrieve per page

search: typing.Optional[str] — Search term for filtering users by user_id, name, or email

order_by: typing.Optional[str] — Column to sort by (created_at, user_id, email)

asc: typing.Optional[bool] — Sort in ascending order

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.user.get(...)

📝 Description

Returns a user.

🔌 Usage

from zep_cloud import Zep

client = Zep(
    api_key="YOUR_API_KEY",
)
client.user.get(
    user_id="userId",
)

⚙️ Parameters

user_id: str — The user_id of the user to get.

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.user.delete(...)

📝 Description

Deletes a user.

🔌 Usage

from zep_cloud import Zep

client = Zep(
    api_key="YOUR_API_KEY",
)
client.user.delete(
    user_id="userId",
)

⚙️ Parameters

user_id: str — User ID

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.user.update(...)

📝 Description

Updates a user.

🔌 Usage

from zep_cloud import Zep

client = Zep(
    api_key="YOUR_API_KEY",
)
client.user.update(
    user_id="userId",
)

⚙️ Parameters

user_id: str — User ID

disable_default_ontology: typing.Optional[bool] — When true, disables the use of default/fallback ontology for the user's graph.

email: typing.Optional[str] — The email address of the user.

first_name: typing.Optional[str] — The first name of the user.

last_name: typing.Optional[str] — The last name of the user.

metadata: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] — The metadata to update

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.user.get_node(...)

📝 Description

Returns a user's node.

🔌 Usage

from zep_cloud import Zep

client = Zep(
    api_key="YOUR_API_KEY",
)
client.user.get_node(
    user_id="userId",
)

⚙️ Parameters

user_id: str — The user_id of the user to get the node for.

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.user.get_threads(...)

📝 Description

Returns all threads for a user.

🔌 Usage

from zep_cloud import Zep

client = Zep(
    api_key="YOUR_API_KEY",
)
client.user.get_threads(
    user_id="userId",
)

⚙️ Parameters

user_id: str — User ID

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.user.warm(...)

📝 Description

Hints Zep to warm a user's graph for low-latency search

🔌 Usage

from zep_cloud import Zep

client = Zep(
    api_key="YOUR_API_KEY",
)
client.user.warm(
    user_id="userId",
)

⚙️ Parameters

user_id: str — User ID

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

Graph Edge

client.graph.edge.get_by_graph_id(...)

📝 Description

Returns all edges for a graph.

🔌 Usage

from zep_cloud import Zep

client = Zep(
    api_key="YOUR_API_KEY",
)
client.graph.edge.get_by_graph_id(
    graph_id="graph_id",
)

⚙️ Parameters

graph_id: str — Graph ID

limit: typing.Optional[int] — Maximum number of items to return

uuid_cursor: typing.Optional[str] — UUID based cursor, used for pagination. Should be the UUID of the last item in the previous page

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.graph.edge.get_by_user_id(...)

📝 Description

Returns all edges for a user.

🔌 Usage

from zep_cloud import Zep

client = Zep(
    api_key="YOUR_API_KEY",
)
client.graph.edge.get_by_user_id(
    user_id="user_id",
)

⚙️ Parameters

user_id: str — User ID

limit: typing.Optional[int] — Maximum number of items to return

uuid_cursor: typing.Optional[str] — UUID based cursor, used for pagination. Should be the UUID of the last item in the previous page

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.graph.edge.get(...)

📝 Description

Returns a specific edge by its UUID.

🔌 Usage

from zep_cloud import Zep

client = Zep(
    api_key="YOUR_API_KEY",
)
client.graph.edge.get(
    uuid_="uuid",
)

⚙️ Parameters

uuid_: str — Edge UUID

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.graph.edge.delete(...)

📝 Description

Deletes an edge by UUID.

🔌 Usage

from zep_cloud import Zep

client = Zep(
    api_key="YOUR_API_KEY",
)
client.graph.edge.delete(
    uuid_="uuid",
)

⚙️ Parameters

uuid_: str — Edge UUID

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.graph.edge.update(...)

📝 Description

Updates an entity edge by UUID.

🔌 Usage

from zep_cloud import Zep

client = Zep(
    api_key="YOUR_API_KEY",
)
client.graph.edge.update(
    uuid_="uuid",
)

⚙️ Parameters

uuid_: str — Edge UUID

attributes: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] — Updated attributes. Merged with existing attributes. Set a key to null to delete it.

expired_at: typing.Optional[str] — Updated time at which the edge expires

fact: typing.Optional[str] — Updated fact for the edge

invalid_at: typing.Optional[str] — Updated time at which the fact stopped being true

name: typing.Optional[str] — Updated name (relationship type) for the edge

valid_at: typing.Optional[str] — Updated time at which the fact becomes true

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

Graph Episode

client.graph.episode.get_by_graph_id(...)

📝 Description

Returns episodes by graph id.

🔌 Usage

from zep_cloud import Zep

client = Zep(
    api_key="YOUR_API_KEY",
)
client.graph.episode.get_by_graph_id(
    graph_id="graph_id",
    lastn=1,
)

⚙️ Parameters

graph_id: str — Graph ID

lastn: typing.Optional[int] — The number of most recent episodes to retrieve.

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.graph.episode.get_by_user_id(...)

📝 Description

Returns episodes by user id.

🔌 Usage

from zep_cloud import Zep

client = Zep(
    api_key="YOUR_API_KEY",
)
client.graph.episode.get_by_user_id(
    user_id="user_id",
    lastn=1,
)

⚙️ Parameters

user_id: str — User ID

lastn: typing.Optional[int] — The number of most recent episodes entries to retrieve.

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.graph.episode.get(...)

📝 Description

Returns episodes by UUID

🔌 Usage

from zep_cloud import Zep

client = Zep(
    api_key="YOUR_API_KEY",
)
client.graph.episode.get(
    uuid_="uuid",
)

⚙️ Parameters

uuid_: str — Episode UUID

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.graph.episode.delete(...)

📝 Description

Deletes an episode by its UUID.

🔌 Usage

from zep_cloud import Zep

client = Zep(
    api_key="YOUR_API_KEY",
)
client.graph.episode.delete(
    uuid_="uuid",
)

⚙️ Parameters

uuid_: str — Episode UUID

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.graph.episode.get_nodes_and_edges(...)

📝 Description

Returns nodes and edges mentioned in an episode

🔌 Usage

from zep_cloud import Zep

client = Zep(
    api_key="YOUR_API_KEY",
)
client.graph.episode.get_nodes_and_edges(
    uuid_="uuid",
)

⚙️ Parameters

uuid_: str — Episode uuid

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

Graph Node

client.graph.node.get_by_graph_id(...)

📝 Description

Returns all nodes for a graph.

🔌 Usage

from zep_cloud import Zep

client = Zep(
    api_key="YOUR_API_KEY",
)
client.graph.node.get_by_graph_id(
    graph_id="graph_id",
)

⚙️ Parameters

graph_id: str — Graph ID

limit: typing.Optional[int] — Maximum number of items to return

uuid_cursor: typing.Optional[str] — UUID based cursor, used for pagination. Should be the UUID of the last item in the previous page

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.graph.node.get_by_user_id(...)

📝 Description

Returns all nodes for a user

🔌 Usage

from zep_cloud import Zep

client = Zep(
    api_key="YOUR_API_KEY",
)
client.graph.node.get_by_user_id(
    user_id="user_id",
)

⚙️ Parameters

user_id: str — User ID

limit: typing.Optional[int] — Maximum number of items to return

uuid_cursor: typing.Optional[str] — UUID based cursor, used for pagination. Should be the UUID of the last item in the previous page

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.graph.node.get_edges(...)

📝 Description

Returns all edges for a node

🔌 Usage

from zep_cloud import Zep

client = Zep(
    api_key="YOUR_API_KEY",
)
client.graph.node.get_edges(
    node_uuid="node_uuid",
)

⚙️ Parameters

node_uuid: str — Node UUID

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.graph.node.get_episodes(...)

📝 Description

Returns all episodes that mentioned a given node

🔌 Usage

from zep_cloud import Zep

client = Zep(
    api_key="YOUR_API_KEY",
)
client.graph.node.get_episodes(
    node_uuid="node_uuid",
)

⚙️ Parameters

node_uuid: str — Node UUID

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.graph.node.get(...)

📝 Description

Returns a specific node by its UUID.

🔌 Usage

from zep_cloud import Zep

client = Zep(
    api_key="YOUR_API_KEY",
)
client.graph.node.get(
    uuid_="uuid",
)

⚙️ Parameters

uuid_: str — Node UUID

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.graph.node.delete(...)

📝 Description

Deletes a node by UUID.

🔌 Usage

from zep_cloud import Zep

client = Zep(
    api_key="YOUR_API_KEY",
)
client.graph.node.delete(
    uuid_="uuid",
)

⚙️ Parameters

uuid_: str — Node UUID

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.graph.node.update(...)

📝 Description

Updates an entity node by UUID.

🔌 Usage

from zep_cloud import Zep

client = Zep(
    api_key="YOUR_API_KEY",
)
client.graph.node.update(
    uuid_="uuid",
)

⚙️ Parameters

uuid_: str — Node UUID

attributes: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] — Updated attributes. Merged with existing attributes. Set a key to null to delete it.

labels: typing.Optional[typing.Sequence[str]] — Updated labels for the node

name: typing.Optional[str] — Updated name for the node

summary: typing.Optional[str] — Updated summary for the node

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

Thread Message

client.thread.message.update(...)

📝 Description

Updates a message.

🔌 Usage

from zep_cloud import Zep

client = Zep(
    api_key="YOUR_API_KEY",
)
client.thread.message.update(
    message_uuid="messageUUID",
    metadata={"key": "value"},
)

⚙️ Parameters

message_uuid: str — The UUID of the message.

metadata: typing.Dict[str, typing.Optional[typing.Any]]

request_options: typing.Optional[RequestOptions] — Request-specific configuration.