### Install Zep Cloud SDK Source: https://github.com/getzep/zep-python/blob/main/README.md Install the Zep Cloud SDK using pip. This is for Zep Cloud installations. ```bash pip install zep-cloud ``` -------------------------------- ### Install Zep Community Edition SDK Source: https://github.com/getzep/zep-python/blob/main/README.md Install the Zep Community Edition SDK using pip. This is for self-hosted Zep instances. ```bash pip install zep-python ``` -------------------------------- ### Install Zep v0.x Compatible SDK Source: https://github.com/getzep/zep-python/blob/main/README.md Install a Zep v0.x compatible SDK version using pip. Use this if you need to maintain compatibility with older Zep versions. ```bash pip install "zep-python>=1.5.0,<2.0.0" ``` -------------------------------- ### Import LangChain Zep Classes Source: https://github.com/getzep/zep-python/blob/main/README.md Import ZepChatMessageHistory and ZepVectorStore classes from the zep_cloud.langchain module. Ensure you have langchain_core installed. ```python from zep_cloud.langchain import ZepChatMessageHistory, ZepVectorStore ``` -------------------------------- ### client.thread.create(thread_id, user_id) Source: https://github.com/getzep/zep-python/blob/main/reference.md Starts a new thread with a specified ID and associated user ID. ```APIDOC ## client.thread.create(thread_id, user_id) ### Description Start a new thread. ### Method POST (assumed) ### Endpoint /threads (assumed) ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body - **thread_id** (string) - Required - The unique identifier of the thread. - **user_id** (string) - Required - The unique identifier of the user associated with the thread. ### Request Example ```python from zep_cloud import Zep client = Zep( api_key="YOUR_API_KEY", ) client.thread.create( thread_id="thread_id", user_id="user_id", ) ``` ### Response #### Success Response (200) - **thread_details** (object) - Information about the created thread. ``` -------------------------------- ### client.batch.get Source: https://github.com/getzep/zep-python/blob/main/reference.md Get a batch summary, including runtime progress when the batch has been processed. ```APIDOC ## client.batch.get ### Description Get a batch summary, including runtime progress when the batch has been processed. ### Method GET ### Endpoint /batches/{batch_id} ### Parameters #### Path Parameters - **batch_id** (str) - The batch ID. ### Request Example ```python client.batch.get( batch_id="batchId", ) ``` ### Response #### Success Response (200) - **id** (str) - The ID of the batch. - **status** (str) - The status of the batch. - **created_at** (str) - The timestamp when the batch was created. - **updated_at** (str) - The timestamp when the batch was last updated. - **progress** (Optional[dict]) - Runtime progress information. ### Response Example ```json { "id": "batch-id-789", "status": "processing", "created_at": "2023-01-01T14:00:00Z", "updated_at": "2023-01-01T14:05:00Z", "progress": { "total_items": 100, "processed_items": 50 } } ``` ``` -------------------------------- ### Retrieve Project Info with Zep SDK Source: https://github.com/getzep/zep-python/blob/main/reference.md Use this to get project details using your API key. Ensure the Zep client is initialized with a valid API key. ```python from zep_cloud import Zep client = Zep( api_key="YOUR_API_KEY", ) client.project.get() ``` -------------------------------- ### client.batch.process Source: https://github.com/getzep/zep-python/blob/main/reference.md Starts the processing of a filled batch. Subsequent calls with the same batch ID will return the status of the existing batch run. ```APIDOC ## client.batch.process ### Description Starts the processing of a filled batch. Subsequent calls with the same batch ID will return the status of the existing batch run. ### Method `process` ### Parameters #### Path Parameters - **batch_id** (str) - Required - The batch ID. - **request_options** (typing.Optional[RequestOptions]) - Optional - Request-specific configuration options. ``` -------------------------------- ### Get Episodes Mentioning a Node Source: https://github.com/getzep/zep-python/blob/main/reference.md Retrieves all episodes that mention a given node. Requires the node's UUID. ```python from zep_cloud import Zep client = Zep( api_key="YOUR_API_KEY", ) client.graph.node.get_episodes( node_uuid="node_uuid", ) ``` -------------------------------- ### Get Context Template Source: https://github.com/getzep/zep-python/blob/main/reference.md Use this to retrieve a specific context template by its template_id. Ensure the template_id is correctly specified. ```python from zep_cloud import Zep client = Zep( api_key="YOUR_API_KEY", ) client.context.get_context_template( template_id="template_id", ) ``` -------------------------------- ### Get Edges for a Node Source: https://github.com/getzep/zep-python/blob/main/reference.md Fetches all edges connected to a specified node. Requires the node's UUID. ```python from zep_cloud import Zep client = Zep( api_key="YOUR_API_KEY", ) client.graph.node.get_edges( node_uuid="node_uuid", ) ``` -------------------------------- ### Get User by ID with Zep Python SDK Source: https://github.com/getzep/zep-python/blob/main/reference.md Retrieve a specific user's details using their unique user ID. The Zep client must be initialized first. ```python from zep_cloud import Zep client = Zep( api_key="YOUR_API_KEY", ) client.user.get( user_id="userId", ) ``` -------------------------------- ### Get User Node with Zep Python SDK Source: https://github.com/getzep/zep-python/blob/main/reference.md Fetch the specific node associated with a user, identified by their user ID. Ensure the Zep client is initialized. ```python from zep_cloud import Zep client = Zep( api_key="YOUR_API_KEY", ) client.user.get_node( user_id="userId", ) ``` -------------------------------- ### Get Task by ID with Zep SDK Source: https://github.com/getzep/zep-python/blob/main/reference.md Retrieve a specific task using its unique ID. The Zep client must be initialized with an API key. ```python from zep_cloud import Zep client = Zep( api_key="YOUR_API_KEY", ) client.task.get( task_id="task_id", ) ``` -------------------------------- ### Get summary for a thread using Zep Python SDK Source: https://github.com/getzep/zep-python/blob/main/reference.md Retrieve the incremental summary generated from messages within a thread. Returns a 404 error if no summary exists for the specified thread. ```python from zep_cloud import Zep client = Zep( api_key="YOUR_API_KEY", ) client.thread.get_summary( thread_id="threadId", ) ``` -------------------------------- ### Get Nodes by User ID Source: https://github.com/getzep/zep-python/blob/main/reference.md Retrieves all nodes associated with a specific user. Supports pagination with limit and cursor. ```python from zep_cloud import Zep client = Zep( api_key="YOUR_API_KEY", ) client.graph.node.get_by_user_id( user_id="user_id", ) ``` -------------------------------- ### Get Context Template Source: https://github.com/getzep/zep-python/blob/main/reference.md Retrieves a specific context template using its unique template ID. This allows you to view the details of an existing template. ```APIDOC ## get_context_template(template_id: str, request_options: typing.Optional[RequestOptions] = None) ### Description Retrieves a context template by template_id. ### Method client.context.get_context_template(template_id) ### Parameters #### Path Parameters - **template_id:** `str` - Template ID #### Query Parameters - **request_options:** `typing.Optional[RequestOptions]` - Request-specific configuration. ### Request Example ```python from zep_cloud import Zep client = Zep( api_key="YOUR_API_KEY", ) client.context.get_context_template( template_id="template_id", ) ``` ### Response #### Success Response (200) - **template_id:** `str` - The unique identifier for the template. - **template:** `str` - The content of the template. - **created_at:** `datetime` - The timestamp when the template was created. - **updated_at:** `datetime` - The timestamp when the template was last updated. ``` -------------------------------- ### Get All Edges for a User Source: https://github.com/getzep/zep-python/blob/main/reference.md Use this method to retrieve all edges associated with a specific user ID. Supports pagination with limit and cursor. ```python from zep_cloud import Zep client = Zep( api_key="YOUR_API_KEY", ) client.graph.edge.get_by_user_id( user_id="user_id", ) ``` -------------------------------- ### Get Episode by UUID - Python Source: https://github.com/getzep/zep-python/blob/main/reference.md Retrieves a specific episode using its unique UUID. Use this when you know the exact episode you need. Requires API key initialization. ```python from zep_cloud import Zep client = Zep( api_key="YOUR_API_KEY", ) client.graph.episode.get( uuid_="uuid", ) ``` -------------------------------- ### Get Batch Summary Source: https://github.com/getzep/zep-python/blob/main/reference.md Retrieves a summary of a specific batch, including its processing progress. Use this to check the status of a batch by its ID. ```python from zep_cloud import Zep client = Zep( api_key="YOUR_API_KEY", ) client.batch.get( batch_id="batchId", ) ``` -------------------------------- ### Get Nodes and Edges from Episode - Python Source: https://github.com/getzep/zep-python/blob/main/reference.md Retrieves the nodes and edges mentioned within a specific episode, identified by its UUID. Requires API key initialization. ```python from zep_cloud import Zep client = Zep( api_key="YOUR_API_KEY", ) client.graph.episode.get_nodes_and_edges( uuid_="uuid", ) ``` -------------------------------- ### Get User Context from Thread with Zep SDK Source: https://github.com/getzep/zep-python/blob/main/reference.md Retrieves contextual information from the user graph based on recent messages in a thread. Requires the Zep client to be initialized with an API key, and specifies the thread ID and a template ID. ```python from zep_cloud import Zep client = Zep( api_key="YOUR_API_KEY", ) client.thread.get_user_context( thread_id="threadId", template_id="template_id", ) ``` -------------------------------- ### Get Thread Summaries by Graph ID Source: https://github.com/getzep/zep-python/blob/main/reference.md Retrieve incremental thread summaries associated with a specific graph. Use the `limit` and `uuid_cursor` parameters for pagination. ```python from zep_cloud import Zep client = Zep( api_key="YOUR_API_KEY", ) client.graph.thread_summary.get_by_graph_id( graph_id="graph_id", ) ``` -------------------------------- ### Get User Threads with Zep Python SDK Source: https://github.com/getzep/zep-python/blob/main/reference.md Retrieve all conversation threads belonging to a specific user, using their user ID. The Zep client needs to be initialized prior to use. ```python from zep_cloud import Zep client = Zep( api_key="YOUR_API_KEY", ) client.user.get_threads( user_id="userId", ) ``` -------------------------------- ### Get messages for a thread using Zep Python SDK Source: https://github.com/getzep/zep-python/blob/main/reference.md Retrieve messages for a specific thread. Supports pagination with limit and cursor, or fetching the most recent messages with lastn. ```python from zep_cloud import Zep client = Zep( api_key="YOUR_API_KEY", ) client.thread.get( thread_id="threadId", limit=1, cursor=1000000, lastn=1, ) ``` -------------------------------- ### Set Entity Types with Zep Python SDK Source: https://github.com/getzep/zep-python/blob/main/reference.md Sets the entity types for multiple users and graphs, replacing any existing ones. This function requires specific parameters not shown in the example. ```python from zep_cloud import Zep client = Zep( api_key="YOUR_API_KEY", ) client.graph.set_entity_types_internal() ``` -------------------------------- ### Get Episode by User ID - Python Source: https://github.com/getzep/zep-python/blob/main/reference.md Retrieves episodes associated with a specific user ID. Use this to fetch recent episodes for a given user. Requires API key initialization. ```python 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, ) ``` -------------------------------- ### List User Summary Instructions - Python Source: https://github.com/getzep/zep-python/blob/main/reference.md Lists all user summary instructions for a specific project and user. Requires initialization of the Zep client with an API key. ```python from zep_cloud import Zep client = Zep( api_key="YOUR_API_KEY", ) client.user.list_user_summary_instructions( user_id="user_id", ) ``` -------------------------------- ### client.user.list_user_summary_instructions Source: https://github.com/getzep/zep-python/blob/main/reference.md Lists all user summary instructions for a project or a specific user. ```APIDOC ## client.user.list_user_summary_instructions ### Description Lists all user summary instructions for a project, user. ### Method client.user.list_user_summary_instructions ### Parameters #### Query Parameters - **user_id** (typing.Optional[str]) - Optional - User ID to get user-specific instructions - **request_options** (typing.Optional[RequestOptions]) - Optional - Request-specific configuration. ``` -------------------------------- ### Get Specific Node by UUID Source: https://github.com/getzep/zep-python/blob/main/reference.md Retrieves a single node using its unique identifier (UUID). ```python from zep_cloud import Zep client = Zep( api_key="YOUR_API_KEY", ) client.graph.node.get( uuid_="uuid", ) ``` -------------------------------- ### List Custom Instructions with Zep Python SDK Source: https://github.com/getzep/zep-python/blob/main/reference.md Lists all custom instructions for a project, user, or graph. Specify user_id or graph_id to filter. ```python 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", ) ``` -------------------------------- ### Add User Summary Instructions - Python Source: https://github.com/getzep/zep-python/blob/main/reference.md Adds new summary instructions for user graphs without removing existing ones. If user_ids is empty, instructions are added to project-wide default instructions. Requires Zep and UserInstruction imports. ```python 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", ) ], ) ``` -------------------------------- ### Get a Specific Edge by UUID Source: https://github.com/getzep/zep-python/blob/main/reference.md Retrieves a single graph edge using its unique identifier (UUID). ```python from zep_cloud import Zep client = Zep( api_key="YOUR_API_KEY", ) client.graph.edge.get( uuid_="uuid", ) ``` -------------------------------- ### List Context Templates Source: https://github.com/getzep/zep-python/blob/main/reference.md Use this to retrieve a list of all available context templates. Ensure the Zep client is initialized with your API key. ```python from zep_cloud import Zep client = Zep( api_key="YOUR_API_KEY", ) client.context.list_context_templates() ``` -------------------------------- ### List Users with Zep Python SDK Source: https://github.com/getzep/zep-python/blob/main/reference.md Use this to list users with optional pagination, search, and sorting. Ensure you have initialized the Zep client with your API key. ```python 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, ) ``` -------------------------------- ### client.user.add_user_summary_instructions Source: https://github.com/getzep/zep-python/blob/main/reference.md Adds new summary instructions for users graphs without removing existing ones. If user_ids is empty, adds to project-wide default instructions. ```APIDOC ## 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. ### Method client.user.add_user_summary_instructions ### Parameters #### Request Body - **instructions** (typing.Sequence[UserInstruction]) - Required - Instructions to add to the user summary generation. #### Query Parameters - **user_ids** (typing.Optional[typing.Sequence[str]]) - Optional - User IDs to add the instructions to. If empty, the instructions are added to the project-wide default. - **request_options** (typing.Optional[RequestOptions]) - Optional - Request-specific configuration. ``` -------------------------------- ### Get Nodes by Graph ID Source: https://github.com/getzep/zep-python/blob/main/reference.md Retrieves all nodes associated with a specific graph. Supports pagination with limit and cursor. ```python from zep_cloud import Zep client = Zep( api_key="YOUR_API_KEY", ) client.graph.node.get_by_graph_id( graph_id="graph_id", ) ``` -------------------------------- ### Add User - Python Source: https://github.com/getzep/zep-python/blob/main/reference.md Adds a new user to the Zep system. Can optionally include email, first name, last name, and metadata. Requires Zep client initialization. ```python from zep_cloud import Zep client = Zep( api_key="YOUR_API_KEY", ) client.user.add( user_id="user_id", ) ``` -------------------------------- ### List Context Templates Source: https://github.com/getzep/zep-python/blob/main/reference.md Lists all available context templates. This is useful for understanding the existing templates in your Zep project. ```APIDOC ## list_context_templates() ### Description Lists all context templates. ### Method client.context.list_context_templates() ### Parameters #### Query Parameters - **request_options:** `typing.Optional[RequestOptions]` - Request-specific configuration. ### Request Example ```python from zep_cloud import Zep client = Zep( api_key="YOUR_API_KEY", ) client.context.list_context_templates() ``` ### Response #### Success Response (200) - **templates:** `list` - A list of context templates. - **template_id:** `str` - The unique identifier for the template. - **template:** `str` - The content of the template. - **created_at:** `datetime` - The timestamp when the template was created. - **updated_at:** `datetime` - The timestamp when the template was last updated. ``` -------------------------------- ### List All Threads with Zep SDK Source: https://github.com/getzep/zep-python/blob/main/reference.md Fetches all threads with support for pagination and ordering. Initialize the Zep client with your API key before use. ```python 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, ) ``` -------------------------------- ### Get All Edges for a Graph Source: https://github.com/getzep/zep-python/blob/main/reference.md Use this method to retrieve all edges associated with a specific graph ID. Supports pagination with limit and cursor. ```python from zep_cloud import Zep client = Zep( api_key="YOUR_API_KEY", ) client.graph.edge.get_by_graph_id( graph_id="graph_id", ) ``` -------------------------------- ### List Ordered Users - Python Source: https://github.com/getzep/zep-python/blob/main/reference.md Returns all users in the Zep system. Requires Zep client initialization. ```python from zep_cloud import Zep client = Zep( api_key="YOUR_API_KEY", ) client.user.list_ordered() ``` -------------------------------- ### client.project.get() Source: https://github.com/getzep/zep-python/blob/main/reference.md Retrieves project information using the provided API key. ```APIDOC ## client.project.get() ### Description Retrieve project info based on the provided api key. ### Method GET (assumed) ### Endpoint /project (assumed) ### Parameters #### Query Parameters - **api_key** (string) - Required - The API key for authentication. #### Request Body None ### Request Example ```python from zep_cloud import Zep client = Zep( api_key="YOUR_API_KEY", ) client.project.get() ``` ### Response #### Success Response (200) - **project_info** (object) - Details about the project. ``` -------------------------------- ### Get Observations by Graph ID Source: https://github.com/getzep/zep-python/blob/main/reference.md Retrieve read-only observation nodes associated with a specific graph. Pagination is supported using `limit` and `uuid_cursor`. ```python from zep_cloud import Zep client = Zep( api_key="YOUR_API_KEY", ) client.graph.observation.get_by_graph_id( graph_id="graph_id", ) ``` -------------------------------- ### client.user.add Source: https://github.com/getzep/zep-python/blob/main/reference.md Adds a user to the Zep system. ```APIDOC ## client.user.add ### Description Adds a user. ### Method client.user.add ### Parameters #### Request Body - **user_id** (str) - Required - The unique identifier of the user. - **disable_default_ontology** (typing.Optional[bool]) - Optional - When true, disables the use of default/fallback ontology for the user's graph. - **email** (typing.Optional[str]) - Optional - The email address of the user. - **first_name** (typing.Optional[str]) - Optional - The first name of the user. - **last_name** (typing.Optional[str]) - Optional - The last name of the user. - **metadata** (typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]]) - Optional - The metadata associated with the user. #### Query Parameters - **request_options** (typing.Optional[RequestOptions]) - Optional - Request-specific configuration. ``` -------------------------------- ### client.batch.create Source: https://github.com/getzep/zep-python/blob/main/reference.md Create a draft batch that can be filled with graph episodes and thread messages. ```APIDOC ## client.batch.create ### Description Create a draft batch that can be filled with graph episodes and thread messages. ### Method POST ### Endpoint /batches ### Parameters #### Request Body - **ignore_roles** (Optional[Sequence[RoleType]]) - Optional list of message role types to skip during graph ingestion for thread_message items in this batch. - **metadata** (Optional[Dict[str, Optional[Any]]]) - Metadata for the batch. ### Request Example ```python client.batch.create( ignore_roles=["user"], metadata={"key": "value"} ) ``` ### Response #### Success Response (200) - **id** (str) - The ID of the created batch. - **status** (str) - The status of the batch. - **created_at** (str) - The timestamp when the batch was created. ### Response Example ```json { "id": "batch-id-456", "status": "draft", "created_at": "2023-01-01T13:00:00Z" } ``` ``` -------------------------------- ### Add Custom Instructions with Zep Python SDK Source: https://github.com/getzep/zep-python/blob/main/reference.md Adds new custom instructions without removing existing ones. If graph_ids or user_ids are empty, instructions are added to project-wide defaults. ```python from zep_cloud import CustomInstruction, Zep client = Zep( api_key="YOUR_API_KEY", ) client.graph.add_custom_instructions( instructions=[ CustomInstruction( name="name", text="text", ) ], ) ``` -------------------------------- ### Get a Specific Observation Node Source: https://github.com/getzep/zep-python/blob/main/reference.md Retrieve a single, read-only observation node using its unique UUID. This is useful for accessing specific data points. ```python from zep_cloud import Zep client = Zep( api_key="YOUR_API_KEY", ) client.graph.observation.get( uuid_="uuid", ) ``` -------------------------------- ### client.graph.list_custom_instructions Source: https://github.com/getzep/zep-python/blob/main/reference.md Lists all custom instructions for a project, user, or graph. You can filter by user_id or graph_id to retrieve specific sets of instructions. ```APIDOC ## client.graph.list_custom_instructions ### Description Lists all custom instructions for a project, user, or graph. ### Method client.graph.list_custom_instructions ### Parameters #### Query Parameters - **user_id** (Optional[str]) - User ID to get user-specific instructions - **graph_id** (Optional[str]) - Graph ID to get graph-specific instructions - **request_options** (Optional[RequestOptions]) - Request-specific configuration. ### Usage Example ```python 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", ) ``` ``` -------------------------------- ### Get Observations by User ID Source: https://github.com/getzep/zep-python/blob/main/reference.md Fetch read-only observation nodes for a user's graph. This method allows for paginated retrieval using `limit` and `uuid_cursor`. ```python from zep_cloud import Zep client = Zep( api_key="YOUR_API_KEY", ) client.graph.observation.get_by_user_id( user_id="user_id", ) ``` -------------------------------- ### Delete User Summary Instructions - Python Source: https://github.com/getzep/zep-python/blob/main/reference.md Deletes user summary instructions for specific users or project-wide defaults. If instruction_names is empty, all instructions are deleted. Requires Zep client initialization. ```python from zep_cloud import Zep client = Zep( api_key="YOUR_API_KEY", ) client.user.delete_user_summary_instructions() ``` -------------------------------- ### Create a New Thread with Zep SDK Source: https://github.com/getzep/zep-python/blob/main/reference.md Initiates a new thread, requiring a unique thread ID and a user ID. The Zep client needs to be configured with an API key. ```python from zep_cloud import Zep client = Zep( api_key="YOUR_API_KEY", ) client.thread.create( thread_id="thread_id", user_id="user_id", ) ``` -------------------------------- ### List Batches Source: https://github.com/getzep/zep-python/blob/main/reference.md Lists batches for the current project, with optional filtering by status. Use this to retrieve an overview of existing batches. ```python from zep_cloud import Zep client = Zep( api_key="YOUR_API_KEY", ) client.batch.list( limit=1, cursor=1, status="status", ) ``` -------------------------------- ### client.graph.add_custom_instructions Source: https://github.com/getzep/zep-python/blob/main/reference.md Adds new custom instructions for graphs without removing existing ones. If user_ids or graph_ids are empty, adds to project-wide default instructions. ```APIDOC ## 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. ### Method client.graph.add_custom_instructions ### Parameters #### Request Body - **instructions** (Sequence[CustomInstruction]) - Instructions to add to the graph. - **graph_ids** (Optional[Sequence[str]]) - Graph IDs to add the instructions to. If empty, the instructions are added to the project-wide default. - **user_ids** (Optional[Sequence[str]]) - User IDs to add the instructions to. If empty, the instructions are added to the project-wide default. - **request_options** (Optional[RequestOptions]) - Request-specific configuration. ### Usage Example ```python from zep_cloud import CustomInstruction, Zep client = Zep( api_key="YOUR_API_KEY", ) client.graph.add_custom_instructions( instructions=[ CustomInstruction( name="name", text="text", ) ], ) ``` ``` -------------------------------- ### client.graph.warm Source: https://github.com/getzep/zep-python/blob/main/reference.md Hints Zep to warm a graph for low-latency search. ```APIDOC ## client.graph.warm ### Description Hints Zep to warm a graph for low-latency search. ### Method POST ### Endpoint /v1/graph/{graph_id}/warm ### Parameters #### Path Parameters - **graph_id** (str) - Required - The graph_id of the graph to warm. #### Request Body None ### Response #### Success Response (200) - **message** (str) - Confirmation message ### Request Example ```python from zep_cloud import Zep client = Zep(api_key="YOUR_API_KEY") client.graph.warm(graph_id="graphId") ``` ``` -------------------------------- ### Create Context Template Source: https://github.com/getzep/zep-python/blob/main/reference.md Creates a new context template with the provided content and a unique identifier. Templates are used to define structured context for Zep. ```APIDOC ## create_context_template(template: str, template_id: str, request_options: typing.Optional[RequestOptions] = None) ### Description Creates a new context template. ### Method client.context.create_context_template(template, template_id) ### Parameters #### Path Parameters - **template:** `str` - The template content (max 1200 characters). - **template_id:** `str` - Unique identifier for the template (max 100 characters). #### Query Parameters - **request_options:** `typing.Optional[RequestOptions]` - Request-specific configuration. ### Request Example ```python from zep_cloud import Zep client = Zep( api_key="YOUR_API_KEY", ) client.context.create_context_template( template="template", template_id="template_id", ) ``` ### Response #### Success Response (200) - **message:** `str` - Confirmation message. - **template_id:** `str` - The ID of the created template. ``` -------------------------------- ### Get Thread Summaries by User ID Source: https://github.com/getzep/zep-python/blob/main/reference.md Retrieve incremental thread summaries generated from messages in threads associated with a user's graph. Supports pagination via `limit` and `uuid_cursor`. ```python from zep_cloud import Zep client = Zep( api_key="YOUR_API_KEY", ) client.graph.thread_summary.get_by_user_id( user_id="user_id", ) ``` -------------------------------- ### client.batch.add Source: https://github.com/getzep/zep-python/blob/main/reference.md Add graph episodes and thread messages to a draft batch. Items are appended in request order. ```APIDOC ## client.batch.add ### Description Add graph episodes and thread messages to a draft batch. Items are appended in request order. ### Method POST ### Endpoint /batches/{batch_id}/items ### Parameters #### Path Parameters - **batch_id** (str) - The batch ID. #### Request Body - **items** (list) - A list of items to add to the batch. Each item can be a graph episode or a thread message. ### Request Example ```python client.batch.add( batch_id="batchId", items=[ { "type": "thread_message", "message": { "role": "user", "content": "Hello, Zep!" } } ] ) ``` ### Response #### Success Response (200) - **id** (str) - The ID of the batch. - **items_added** (int) - The number of items added to the batch. ### Response Example ```json { "id": "batch-id-abc", "items_added": 1 } ``` ``` -------------------------------- ### client.batch.list Source: https://github.com/getzep/zep-python/blob/main/reference.md List batches for the current project, optionally filtered by batch status. ```APIDOC ## client.batch.list ### Description List batches for the current project, optionally filtered by batch status. ### Method GET ### Endpoint /batches ### Parameters #### Query Parameters - **limit** (Optional[int]) - Maximum number of batches to return. - **cursor** (Optional[int]) - Pagination cursor from a previous response. - **status** (Optional[str]) - Batch status filter. ### Request Example ```python client.batch.list( limit=1, cursor=1, status="status", ) ``` ### Response #### Success Response (200) - **batches** (list) - A list of batch objects. - **next_cursor** (str) - The cursor for the next page of results. ### Response Example ```json { "batches": [ { "id": "batch-id-123", "status": "completed", "created_at": "2023-01-01T12:00:00Z", "updated_at": "2023-01-01T12:05:00Z" } ], "next_cursor": "cursor-abc" } ``` ``` -------------------------------- ### Create Draft Batch Source: https://github.com/getzep/zep-python/blob/main/reference.md Creates a draft batch that can be populated with graph episodes and thread messages. This is the initial step before adding content to a batch. ```python from zep_cloud import Zep client = Zep( api_key="YOUR_API_KEY", ) client.batch.create() ``` -------------------------------- ### client.thread.list_all(page_number, page_size, order_by, asc) Source: https://github.com/getzep/zep-python/blob/main/reference.md Returns all threads with optional pagination and ordering. ```APIDOC ## client.thread.list_all(page_number, page_size, order_by, asc) ### Description Returns all threads. ### Method GET (assumed) ### Endpoint /threads (assumed) ### Parameters #### Query Parameters - **page_number** (integer) - Optional - Page number for pagination, starting from 1. - **page_size** (integer) - Optional - Number of threads to retrieve per page. - **order_by** (string) - Optional - Field to order the results by: created_at, updated_at, user_id, thread_id. - **asc** (boolean) - Optional - Order direction: true for ascending, false for descending. #### Request Body None ### Request Example ```python 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, ) ``` ### Response #### Success Response (200) - **threads** (array) - A list of thread objects. ``` -------------------------------- ### client.user.list_ordered Source: https://github.com/getzep/zep-python/blob/main/reference.md Returns all users. ```APIDOC ## client.user.list_ordered ### Description Returns all users. ### Method client.user.list_ordered ``` -------------------------------- ### Get Episode by Graph ID - Python Source: https://github.com/getzep/zep-python/blob/main/reference.md Retrieves episodes associated with a specific graph ID. Use this to fetch recent episodes related to a particular graph. Requires API key initialization. ```python 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, ) ``` -------------------------------- ### List Entity Types with Zep Python SDK Source: https://github.com/getzep/zep-python/blob/main/reference.md Returns all entity types for a project, user, or graph. Specify user_id or graph_id to filter. ```python 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", ) ``` -------------------------------- ### client.thread.get_summary Source: https://github.com/getzep/zep-python/blob/main/reference.md Retrieves the incremental summary generated from messages in a thread. Returns 404 if no summary exists. ```APIDOC ## GET client.thread.get_summary ### Description Returns the incremental summary generated from messages in the thread. Returns 404 if no summary exists for the thread. ### Method GET ### Endpoint /threads/{thread_id}/summary ### Parameters #### Path Parameters - **thread_id** (str) - The ID of the thread for which context is being retrieved. ### Request Example ```python client.thread.get_summary( thread_id="threadId", ) ``` ### Response #### Success Response (200) - **summary** (str) - The incremental summary of the thread. ``` -------------------------------- ### client.graph.create Source: https://github.com/getzep/zep-python/blob/main/reference.md Creates a new graph with the specified ID and optional details. ```APIDOC ## client.graph.create ### Description Creates a new graph. ### Method POST ### Endpoint /v1/graph ### Parameters #### Request Body - **graph_id** (str) - Required - The unique identifier for the graph. - **description** (str) - Optional - A description for the graph. - **name** (str) - Optional - The name of the graph. - **request_options** (RequestOptions) - Optional - Request-specific configuration. ``` -------------------------------- ### Warm User Graph for Low-Latency Search Source: https://github.com/getzep/zep-python/blob/main/reference.md Use this method to hint Zep to warm a user's graph for low-latency search. Requires your API key and the user ID. ```python from zep_cloud import Zep client = Zep( api_key="YOUR_API_KEY", ) client.user.warm( user_id="userId", ) ``` -------------------------------- ### Create Context Template Source: https://github.com/getzep/zep-python/blob/main/reference.md Use this to create a new context template. Provide a unique template_id and the template content. The template content has a maximum length of 1200 characters, and the template_id has a maximum of 100 characters. ```python from zep_cloud import Zep client = Zep( api_key="YOUR_API_KEY", ) client.context.create_context_template( template="template", template_id="template_id", ) ``` -------------------------------- ### Warm User Graph Source: https://github.com/getzep/zep-python/blob/main/reference.md Hints Zep to warm a user's graph for low-latency search. This is useful for improving the performance of subsequent searches for a specific user. ```APIDOC ## Warm User Graph ### Description Hints Zep to warm a user's graph for low-latency search. ### Method client.user.warm ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Request Example ```python from zep_cloud import Zep client = Zep( api_key="YOUR_API_KEY", ) client.user.warm( user_id="userId", ) ``` ### Response #### Success Response (200) This method does not return a value upon success. #### Response Example None ``` -------------------------------- ### Create a new graph Source: https://github.com/getzep/zep-python/blob/main/reference.md Use this function to create a new graph in Zep. You must provide a unique graph_id. ```python from zep_cloud import Zep client = Zep( api_key="YOUR_API_KEY", ) client.graph.create( graph_id="graph_id", ) ``` -------------------------------- ### client.user.delete_user_summary_instructions Source: https://github.com/getzep/zep-python/blob/main/reference.md Deletes user summary/instructions for users or project wide defaults. ```APIDOC ## client.user.delete_user_summary_instructions ### Description Deletes user summary/instructions for users or project wide defaults. ### Method client.user.delete_user_summary_instructions ### Parameters #### Query Parameters - **instruction_names** (typing.Optional[typing.Sequence[str]]) - Optional - Unique identifier for the instructions to be deleted. If empty deletes all instructions. - **user_ids** (typing.Optional[typing.Sequence[str]]) - Optional - 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]) - Optional - Request-specific configuration. ``` -------------------------------- ### Add Items to a Batch Source: https://github.com/getzep/zep-python/blob/main/reference.md Use this snippet to add items to a batch for asynchronous processing. Ensure you have initialized the Zep client with your API key. ```python from zep_cloud import BatchAddItem, Zep client = Zep( api_key="YOUR_API_KEY", ) client.batch.add( batch_id="batchId", items=[ BatchAddItem( type="graph_episode", ) ], ) ``` -------------------------------- ### client.graph.list_all Source: https://github.com/getzep/zep-python/blob/main/reference.md Returns all graphs, with options for pagination, searching, and sorting. ```APIDOC ## client.graph.list_all ### Description Returns all graphs. In order to list users, use user.list_ordered instead. ### Method GET ### Endpoint /v1/graph ### Parameters #### Query Parameters - **page_number** (int) - Optional - Page number for pagination, starting from 1. - **page_size** (int) - Optional - Number of graphs to retrieve per page. - **search** (str) - Optional - Search term for filtering graphs by graph_id. - **order_by** (str) - Optional - Column to sort by (created_at, group_id, name). - **asc** (bool) - Optional - Sort in ascending order. - **request_options** (RequestOptions) - Optional - Request-specific configuration. ``` -------------------------------- ### Update User with Zep Python SDK Source: https://github.com/getzep/zep-python/blob/main/reference.md Modify an existing user's information, such as name, email, or metadata. The user ID is required, and the Zep client must be initialized. ```python from zep_cloud import Zep client = Zep( api_key="YOUR_API_KEY", ) client.user.update( user_id="userId", ) ``` -------------------------------- ### List all graphs with pagination and search Source: https://github.com/getzep/zep-python/blob/main/reference.md Retrieves a paginated list of all graphs. Supports searching, ordering, and specifying page size. ```python from zep_cloud import Zep client = Zep( api_key="YOUR_API_KEY", ) client.graph.list_all( page_number=1, page_size=1, search="search", order_by="order_by", asc=True, ) ``` -------------------------------- ### Clone Graph using Zep Python SDK Source: https://github.com/getzep/zep-python/blob/main/reference.md Use this method to clone a user or group graph. Ensure you have your API key configured. ```python from zep_cloud import Zep client = Zep( api_key="YOUR_API_KEY", ) client.graph.clone() ``` -------------------------------- ### Warm a Zep Graph for Low-Latency Search Source: https://github.com/getzep/zep-python/blob/main/reference.md Hints Zep to warm a graph, which can improve search latency. This operation requires the `graph_id` of the graph to be warmed. ```python from zep_cloud import Zep client = Zep( api_key="YOUR_API_KEY", ) client.graph.warm( graph_id="graphId", ) ``` -------------------------------- ### client.batch.list_items Source: https://github.com/getzep/zep-python/blob/main/reference.md List items in a batch, including derived runtime status when the batch has been processed. ```APIDOC ## client.batch.list_items ### Description List items in a batch, including derived runtime status when the batch has been processed. ### Method GET ### Endpoint /batches/{batch_id}/items ### Parameters #### Path Parameters - **batch_id** (str) - The batch ID. #### Query Parameters - **limit** (Optional[int]) - Maximum number of batch items to return. - **cursor** (Optional[int]) - Pagination cursor from a previous response. - **status** (Optional[str]) - Batch item status filter. ### Request Example ```python client.batch.list_items( batch_id="batchId", limit=1, cursor=1, status="status", ) ``` ### Response #### Success Response (200) - **items** (list) - A list of batch item objects. - **next_cursor** (str) - The cursor for the next page of results. ### Response Example ```json { "items": [ { "id": "item-id-123", "batch_id": "batch-id-789", "status": "completed", "created_at": "2023-01-01T14:10:00Z" } ], "next_cursor": "cursor-def" } ``` ``` -------------------------------- ### List Batch Items Source: https://github.com/getzep/zep-python/blob/main/reference.md Lists items within a batch, showing their runtime status after processing. Use this to inspect the contents and status of items in a specific batch. ```python from zep_cloud import Zep client = Zep( api_key="YOUR_API_KEY", ) client.batch.list_items( batch_id="batchId", limit=1, cursor=1, status="status", ) ``` -------------------------------- ### Add Data to Zep Graph Source: https://github.com/getzep/zep-python/blob/main/reference.md Use this method to add individual data points to a Zep graph. Specify either a `graph_id` or `user_id` to direct the data. Metadata is optional and has a limit of 10 keys. ```python from zep_cloud import Zep client = Zep( api_key="YOUR_API_KEY", ) client.graph.add( data="data", type="text", ) ``` -------------------------------- ### Delete Custom Instructions with Zep Python SDK Source: https://github.com/getzep/zep-python/blob/main/reference.md Deletes custom instructions for specified graphs, users, or project-wide defaults. If instruction_names is empty, all instructions are deleted. ```python from zep_cloud import Zep client = Zep( api_key="YOUR_API_KEY", ) client.graph.delete_custom_instructions() ``` -------------------------------- ### Add Data in Batch to Zep Graph (Deprecated) Source: https://github.com/getzep/zep-python/blob/main/reference.md This method is deprecated and users should migrate to the Batch API (`client.batch.*`). It was used for adding data in batch mode, processing episodes concurrently. Specify either `graph_id` or `user_id`. ```python from zep_cloud import EpisodeData, Zep client = Zep( api_key="YOUR_API_KEY", ) client.graph.add_batch( episodes=[ EpisodeData( data="data", type="text", ) ], ) ``` -------------------------------- ### client.batch.add Source: https://github.com/getzep/zep-python/blob/main/reference.md Adds items to a specified batch. This method allows for the asynchronous population of a batch with various item types before processing. ```APIDOC ## client.batch.add ### Description Adds items to a specified batch. This method allows for the asynchronous population of a batch with various item types before processing. ### Method `add` ### Parameters #### Path Parameters - **batch_id** (str) - Required - The batch ID. - **items** (typing.Sequence[BatchAddItem]) - Required - A sequence of items to add to the batch. Each item should conform to the BatchAddItem structure. - **request_options** (typing.Optional[RequestOptions]) - Optional - Request-specific configuration options. ``` -------------------------------- ### Add messages to a thread using Zep Python SDK Source: https://github.com/getzep/zep-python/blob/main/reference.md Add messages to an existing thread. Each message requires a role and content. Optionally, specify roles to ignore for graph memory and whether to return context. ```python 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", ) ], ) ``` -------------------------------- ### client.user.list_ordered Source: https://github.com/getzep/zep-python/blob/main/reference.md Retrieves a paginated and ordered list of users. Supports filtering by a search term and sorting by specified columns. ```APIDOC ## client.user.list_ordered ### Description Retrieves a paginated and ordered list of users. Supports filtering by a search term and sorting by specified columns. ### Method ```python client.user.list_ordered( page_number: typing.Optional[int] = None, page_size: typing.Optional[int] = None, search: typing.Optional[str] = None, order_by: typing.Optional[str] = None, asc: typing.Optional[bool] = None, request_options: typing.Optional[RequestOptions] = None, ) ``` ### Parameters #### Query Parameters - **page_number** (int) - Optional - Page number for pagination, starting from 1 - **page_size** (int) - Optional - Number of users to retrieve per page - **search** (str) - Optional - Search term for filtering users by user_id, name, or email - **order_by** (str) - Optional - Column to sort by (created_at, user_id, email) - **asc** (bool) - Optional - Sort in ascending order - **request_options** (RequestOptions) - Optional - Request-specific configuration. ### Request Example ```python 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, ) ``` ``` -------------------------------- ### Search a Zep Graph Source: https://github.com/getzep/zep-python/blob/main/reference.md Perform a graph search query. Use `query` for text search, `graph_id` for specific graphs, or `user_id` for user-specific graphs. Various parameters control the search scope, limits, and reranking. ```python from zep_cloud import Zep client = Zep( api_key="YOUR_API_KEY", ) client.graph.search( query="query", ) ```