{ "openapi": "3.1.0", "info": { "title": "Agent Protocol", "version": "0.1.0" }, "tags": [ { "name": "Threads", "description": "A thread contains the accumulated outputs of a group of runs." }, { "name": "Runs", "description": "A run is an invocation of a graph / assistant on a thread. It updates the state of the thread." }, { "name": "Store", "description": "Store is an API for managing persistent key-value store (long-term memory) that is available from any thread." } ], "paths": { "/threads": { "post": { "tags": ["Threads"], "summary": "Create Thread", "description": "Create a thread.", "operationId": "create_thread_threads_post", "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ThreadCreate" } } }, "required": true }, "responses": { "200": { "description": "Success", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Thread" } } } }, "409": { "description": "Conflict", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } } } } }, "/threads/search": { "post": { "tags": ["Threads"], "summary": "Search Threads", "description": "Search for threads.\n\nThis endpoint also functions as the endpoint to list all threads.", "operationId": "search_threads_threads_search_post", "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ThreadSearchRequest" } } }, "required": true }, "responses": { "200": { "description": "Success", "content": { "application/json": { "schema": { "items": { "$ref": "#/components/schemas/Thread" }, "type": "array", "title": "Response Search Threads Threads Search Post" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } } } } }, "/threads/{thread_id}/state": { "get": { "tags": ["Threads"], "summary": "Get Thread State", "description": "Get state for a thread.\n\nThe latest state of the thread (i.e. latest checkpoint) is returned.", "operationId": "get_latest_thread_state_threads__thread_id__state_get", "parameters": [ { "description": "The ID of the thread.", "required": true, "schema": { "type": "string", "format": "uuid", "title": "Thread Id", "description": "The ID of the thread." }, "name": "thread_id", "in": "path" } ], "responses": { "200": { "description": "Success", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ThreadState" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } } } }, "post": { "tags": ["Threads"], "summary": "Update Thread State", "description": "Add state to a thread.", "operationId": "update_thread_state_threads__thread_id__state_post", "parameters": [ { "description": "The ID of the thread.", "required": true, "schema": { "type": "string", "format": "uuid", "title": "Thread Id", "description": "The ID of the thread." }, "name": "thread_id", "in": "path" } ], "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ThreadStateUpdate" } } }, "required": true }, "responses": { "200": { "description": "Success", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ThreadStateUpdateResponse" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } } } } }, "/threads/{thread_id}/history": { "get": { "tags": ["Threads"], "summary": "Get Thread History", "description": "Get all past states for a thread.", "operationId": "get_thread_history_threads__thread_id__history_get", "parameters": [ { "description": "The ID of the thread.", "required": true, "schema": { "type": "string", "format": "uuid", "title": "Thread Id", "description": "The ID of the thread." }, "name": "thread_id", "in": "path" }, { "required": false, "schema": { "type": "integer", "title": "Limit", "default": 10 }, "name": "limit", "in": "query" }, { "required": false, "schema": { "type": "string", "title": "Before" }, "name": "before", "in": "query" } ], "responses": { "200": { "description": "Success", "content": { "application/json": { "schema": { "items": { "$ref": "#/components/schemas/ThreadState" }, "type": "array", "title": "Response Get Thread History Threads Thread Id History Get" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } } } } }, "/threads/{thread_id}/copy": { "post": { "tags": ["Threads"], "summary": "Copy Thread", "description": "Create a new thread with a copy of the state and checkpoints from an existing thread.", "operationId": "copy_thread_post_threads__thread_id__copy_post", "parameters": [ { "description": "The ID of the thread.", "required": true, "schema": { "type": "string", "format": "uuid", "title": "Thread Id", "description": "The ID of the thread." }, "name": "thread_id", "in": "path" } ], "responses": { "200": { "description": "Success", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Thread" } } } }, "409": { "description": "Conflict", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } } } } }, "/threads/{thread_id}": { "get": { "tags": ["Threads"], "summary": "Get Thread", "description": "Get a thread by ID.", "operationId": "get_thread_threads__thread_id__get", "parameters": [ { "description": "The ID of the thread.", "required": true, "schema": { "type": "string", "format": "uuid", "title": "Thread Id", "description": "The ID of the thread." }, "name": "thread_id", "in": "path" } ], "responses": { "200": { "description": "Success", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Thread" } } } }, "404": { "description": "Not Found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } } } }, "delete": { "tags": ["Threads"], "summary": "Delete Thread", "description": "Delete a thread by ID.", "operationId": "delete_thread_threads__thread_id__delete", "parameters": [ { "description": "The ID of the thread.", "required": true, "schema": { "type": "string", "format": "uuid", "title": "Thread Id", "description": "The ID of the thread." }, "name": "thread_id", "in": "path" } ], "responses": { "200": { "description": "Success", "content": { "application/json": { "schema": {} } } }, "404": { "description": "Not Found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } } } }, "patch": { "tags": ["Threads"], "summary": "Patch Thread", "description": "Update a thread.", "operationId": "patch_thread_threads__thread_id__patch", "parameters": [ { "description": "The ID of the thread.", "required": true, "schema": { "type": "string", "format": "uuid", "title": "Thread Id", "description": "The ID of the thread." }, "name": "thread_id", "in": "path" } ], "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ThreadPatch" } } }, "required": true }, "responses": { "200": { "description": "Success", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Thread" } } } }, "404": { "description": "Not Found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } } } } }, "/threads/{thread_id}/runs": { "get": { "tags": ["Runs"], "summary": "List Runs", "description": "List runs for a thread.", "operationId": "list_runs_http_threads__thread_id__runs_get", "parameters": [ { "description": "The ID of the thread.", "required": true, "schema": { "type": "string", "format": "uuid", "title": "Thread Id", "description": "The ID of the thread." }, "name": "thread_id", "in": "path" }, { "required": false, "schema": { "type": "integer", "title": "Limit", "default": 10 }, "name": "limit", "in": "query" }, { "required": false, "schema": { "type": "integer", "title": "Offset", "default": 0 }, "name": "offset", "in": "query" } ], "responses": { "200": { "description": "Success", "content": { "application/json": { "schema": { "items": { "$ref": "#/components/schemas/Run" }, "type": "array" } } } }, "404": { "description": "Not Found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } } } }, "post": { "tags": ["Runs"], "summary": "Create Background Run", "description": "Create a run in existing thread, return the run ID immediately. Don't wait for the final run output.", "operationId": "create_run_threads__thread_id__runs_post", "parameters": [ { "description": "The ID of the thread.", "required": true, "schema": { "type": "string", "format": "uuid", "title": "Thread Id", "description": "The ID of the thread." }, "name": "thread_id", "in": "path" } ], "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/RunCreateStateful" } } }, "required": true }, "responses": { "200": { "description": "Success", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Run" } } } }, "404": { "description": "Not Found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } }, "409": { "description": "Conflict", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } } } } }, "/threads/{thread_id}/runs/stream": { "post": { "tags": ["Runs"], "summary": "Create Run, Stream Output", "description": "Create a run in existing thread. Stream the output.", "operationId": "stream_run_threads__thread_id__runs_stream_post", "parameters": [ { "description": "The ID of the thread.", "required": true, "schema": { "type": "string", "format": "uuid", "title": "Thread Id", "description": "The ID of the thread." }, "name": "thread_id", "in": "path" } ], "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/RunCreateStateful" } } }, "required": true }, "responses": { "200": { "description": "Success", "content": { "application/json": { "schema": {} } } }, "404": { "description": "Not Found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } }, "409": { "description": "Conflict", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } } } } }, "/threads/{thread_id}/runs/wait": { "post": { "tags": ["Runs"], "summary": "Create Run, Wait for Output", "description": "Create a run in existing thread. Wait for the final output and then return it.", "operationId": "wait_run_threads__thread_id__runs_wait_post", "parameters": [ { "description": "The ID of the thread.", "required": true, "schema": { "type": "string", "format": "uuid", "title": "Thread Id", "description": "The ID of the thread." }, "name": "thread_id", "in": "path" } ], "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/RunCreateStateful" } } }, "required": true }, "responses": { "200": { "description": "Success", "content": { "application/json": { "schema": {} } } }, "404": { "description": "Not Found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } }, "409": { "description": "Conflict", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } } } } }, "/threads/{thread_id}/runs/{run_id}": { "get": { "tags": ["Runs"], "summary": "Get Run", "description": "Get a run by ID.", "operationId": "get_run_http_threads__thread_id__runs__run_id__get", "parameters": [ { "description": "The ID of the thread.", "required": true, "schema": { "type": "string", "format": "uuid", "title": "Thread Id", "description": "The ID of the thread." }, "name": "thread_id", "in": "path" }, { "description": "The ID of the run.", "required": true, "schema": { "type": "string", "format": "uuid", "title": "Run Id", "description": "The ID of the run." }, "name": "run_id", "in": "path" } ], "responses": { "200": { "description": "Success", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Run" } } } }, "404": { "description": "Not Found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } } } }, "delete": { "tags": ["Runs"], "summary": "Delete Run", "description": "Delete a run by ID.", "operationId": "delete_run_threads__thread_id__runs__run_id__delete", "parameters": [ { "description": "The ID of the thread.", "required": true, "schema": { "type": "string", "format": "uuid", "title": "Thread Id", "description": "The ID of the thread." }, "name": "thread_id", "in": "path" }, { "description": "The ID of the run.", "required": true, "schema": { "type": "string", "format": "uuid", "title": "Run Id", "description": "The ID of the run." }, "name": "run_id", "in": "path" } ], "responses": { "200": { "description": "Success", "content": { "application/json": { "schema": {} } } }, "404": { "description": "Not Found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } } } } }, "/threads/{thread_id}/runs/{run_id}/wait": { "get": { "tags": ["Runs"], "summary": "Wait for Run output", "description": "Wait for a run to finish, return the final output. If the run already finished, returns its final output immediately.", "operationId": "join_run_http_threads__thread_id__runs__run_id__join_get", "parameters": [ { "description": "The ID of the thread.", "required": true, "schema": { "type": "string", "format": "uuid", "title": "Thread Id", "description": "The ID of the thread." }, "name": "thread_id", "in": "path" }, { "description": "The ID of the run.", "required": true, "schema": { "type": "string", "format": "uuid", "title": "Run Id", "description": "The ID of the run." }, "name": "run_id", "in": "path" } ], "responses": { "200": { "description": "Success", "content": { "application/json": { "schema": {} } } }, "404": { "description": "Not Found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } } } } }, "/threads/{thread_id}/runs/{run_id}/stream": { "get": { "tags": ["Runs"], "summary": "Stream output from Run", "description": "Join the output stream of an existing run. This endpoint streams output in real-time from a run similar to the /threads/__THREAD_ID__/runs/stream endpoint. Only output produced after this endpoint is called will be streamed.", "operationId": "stream_run_http_threads__thread_id__runs__run_id__join_get", "parameters": [ { "description": "The ID of the thread.", "required": true, "schema": { "type": "string", "format": "uuid", "title": "Thread Id", "description": "The ID of the thread." }, "name": "thread_id", "in": "path" }, { "description": "The ID of the run.", "required": true, "schema": { "type": "string", "format": "uuid", "title": "Run Id", "description": "The ID of the run." }, "name": "run_id", "in": "path" } ], "responses": { "200": { "description": "Success", "content": { "application/json": { "schema": {} } } }, "404": { "description": "Not Found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } } } } }, "/threads/{thread_id}/runs/{run_id}/cancel": { "post": { "tags": ["Runs"], "summary": "Cancel Run", "operationId": "cancel_run_http_threads__thread_id__runs__run_id__cancel_post", "parameters": [ { "description": "The ID of the thread.", "required": true, "schema": { "type": "string", "format": "uuid", "title": "Thread Id", "description": "The ID of the thread." }, "name": "thread_id", "in": "path" }, { "description": "The ID of the run.", "required": true, "schema": { "type": "string", "format": "uuid", "title": "Run Id", "description": "The ID of the run." }, "name": "run_id", "in": "path" }, { "required": false, "schema": { "type": "boolean", "title": "Wait", "default": false }, "name": "wait", "in": "query" }, { "description": "Action to take when cancelling the run. Possible values are `interrupt` or `rollback`. `interrupt` will simply cancel the run. `rollback` will cancel the run and delete the run and associated checkpoints afterwards.", "required": false, "schema": { "type": "string", "enum": ["interrupt", "rollback"], "title": "Action", "default": "interrupt" }, "name": "action", "in": "query" } ], "responses": { "200": { "description": "Success", "content": { "application/json": { "schema": {} } } }, "404": { "description": "Not Found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } } } } }, "/store/items": { "put": { "tags": ["Store"], "summary": "Store or update an item.", "operationId": "put_item", "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/StorePutRequest" } } } }, "responses": { "204": { "description": "Success" }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } } } }, "delete": { "tags": ["Store"], "summary": "Delete an item.", "operationId": "delete_item", "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/StoreDeleteRequest" } } } }, "responses": { "204": { "description": "Success" }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } } } }, "get": { "tags": ["Store"], "summary": "Retrieve a single item.", "operationId": "get_item", "parameters": [ { "name": "key", "in": "query", "required": true, "schema": { "type": "string" } }, { "name": "namespace", "in": "query", "required": false, "schema": { "type": "array", "items": { "type": "string" } } } ], "responses": { "200": { "description": "Success", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Item" } } } }, "400": { "description": "Bad Request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } } } } }, "/store/items/search": { "post": { "tags": ["Store"], "summary": "Search for items within a namespace prefix.", "operationId": "search_items", "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/StoreSearchRequest" } } } }, "responses": { "200": { "description": "Success", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/SearchItemsResponse" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } } } } }, "/store/namespaces": { "post": { "tags": ["Store"], "summary": "List namespaces with optional match conditions.", "operationId": "list_namespaces", "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/StoreListNamespacesRequest" } } } }, "responses": { "200": { "description": "Success", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ListNamespaceResponse" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } } } } } }, "components": { "schemas": { "Run": { "properties": { "run_id": { "type": "string", "format": "uuid", "title": "Run Id", "description": "The ID of the run." }, "thread_id": { "type": "string", "format": "uuid", "title": "Thread Id", "description": "The ID of the thread." }, "assistant_id": { "type": "string", "format": "uuid", "title": "Assistant Id", "description": "The assistant that was used for this run." }, "created_at": { "type": "string", "format": "date-time", "title": "Created At", "description": "The time the run was created." }, "updated_at": { "type": "string", "format": "date-time", "title": "Updated At", "description": "The last time the run was updated." }, "status": { "type": "string", "enum": ["pending", "error", "success", "timeout", "interrupted"], "title": "Status", "description": "The status of the run. One of 'pending', 'error', 'success', 'timeout', 'interrupted'." }, "metadata": { "type": "object", "title": "Metadata", "description": "The run metadata." }, "kwargs": { "type": "object", "title": "Kwargs" }, "multitask_strategy": { "type": "string", "enum": ["reject", "rollback", "interrupt", "enqueue"], "title": "Multitask Strategy", "description": "Strategy to handle concurrent runs on the same thread." } }, "type": "object", "required": [ "run_id", "thread_id", "assistant_id", "created_at", "updated_at", "status", "metadata", "kwargs", "multitask_strategy" ], "title": "Run" }, "RunCreateStateful": { "properties": { "assistant_id": { "anyOf": [ { "type": "string", "format": "uuid", "title": "Assistant Id" }, { "type": "string", "title": "Graph Id" } ], "description": "The assistant ID or graph name to run. If using graph name, will default to first assistant created from that graph." }, "input": { "anyOf": [ { "items": { "type": "object" }, "type": "array" }, { "type": "object" }, { "type": "null" } ], "title": "Input", "description": "The input to the graph." }, "metadata": { "type": "object", "title": "Metadata", "description": "Metadata to assign to the run." }, "config": { "properties": { "tags": { "items": { "type": "string" }, "type": "array", "title": "Tags" }, "recursion_limit": { "type": "integer", "title": "Recursion Limit" }, "configurable": { "type": "object", "title": "Configurable" } }, "type": "object", "title": "Config", "description": "The configuration for the assistant." }, "context": { "type": "object", "title": "Context", "description": "Static context to add to the assistant for this run." }, "webhook": { "type": "string", "maxLength": 65536, "minLength": 1, "format": "uri", "title": "Webhook", "description": "Webhook to call after LangGraph API call is done." }, "interrupt_before": { "anyOf": [ { "type": "string", "enum": ["*"] }, { "items": { "type": "string" }, "type": "array" } ], "title": "Interrupt Before", "description": "Nodes to interrupt immediately before they get executed." }, "interrupt_after": { "anyOf": [ { "type": "string", "enum": ["*"] }, { "items": { "type": "string" }, "type": "array" } ], "title": "Interrupt After", "description": "Nodes to interrupt immediately after they get executed." }, "stream_mode": { "anyOf": [ { "items": { "type": "string", "enum": [ "values", "messages", "messages-tuple", "updates", "events", "debug", "custom" ] }, "type": "array" }, { "type": "string", "enum": ["values", "messages", "messages-tuple", "updates", "events", "debug", "custom"] } ], "title": "Stream Mode", "description": "The stream mode(s) to use.", "default": ["values"] }, "stream_subgraphs": { "type": "boolean", "title": "Stream Subgraphs", "description": "Whether to stream output from subgraphs.", "default": false }, "on_disconnect": { "type": "string", "enum": ["cancel", "continue"], "title": "On Disconnect", "description": "The disconnect mode to use. Must be one of 'cancel' or 'continue'.", "default": "cancel" }, "feedback_keys": { "items": { "type": "string" }, "type": "array", "title": "Feedback Keys", "description": "Feedback keys to assign to run." }, "multitask_strategy": { "type": "string", "enum": ["reject", "rollback", "interrupt", "enqueue"], "title": "Multitask Strategy", "description": "Multitask strategy to use. Must be one of 'reject', 'interrupt', 'rollback', or 'enqueue'.", "default": "reject" }, "if_not_exists": { "type": "string", "enum": ["create", "reject"], "title": "If Not Exists", "description": "How to handle missing thread. Must be either 'reject' (raise error if missing), or 'create' (create new thread).", "default": "reject" }, "after_seconds": { "type": "integer", "title": "After Seconds", "description": "The number of seconds to wait before starting the run. Use to schedule future runs." } }, "type": "object", "required": ["assistant_id"], "title": "RunCreateStateful", "description": "Payload for creating a run." }, "ThreadSearchRequest": { "properties": { "metadata": { "type": "object", "title": "Metadata", "description": "Thread metadata to filter on." }, "values": { "type": "object", "title": "Values", "description": "State values to filter on." }, "status": { "type": "string", "enum": ["idle", "busy", "interrupted", "error"], "title": "Status", "description": "Thread status to filter on." }, "limit": { "type": "integer", "title": "Limit", "description": "Maximum number to return.", "default": 10, "minimum": 1, "maximum": 1000 }, "offset": { "type": "integer", "title": "Offset", "description": "Offset to start from.", "default": 0, "minimum": 0 } }, "type": "object", "title": "ThreadSearchRequest", "description": "Payload for listing threads." }, "Thread": { "properties": { "thread_id": { "type": "string", "format": "uuid", "title": "Thread Id", "description": "The ID of the thread." }, "created_at": { "type": "string", "format": "date-time", "title": "Created At", "description": "The time the thread was created." }, "updated_at": { "type": "string", "format": "date-time", "title": "Updated At", "description": "The last time the thread was updated." }, "metadata": { "type": "object", "title": "Metadata", "description": "The thread metadata." }, "status": { "type": "string", "enum": ["idle", "busy", "interrupted", "error"], "title": "Status", "description": "The status of the thread." }, "values": { "type": "object", "title": "Values", "description": "The current state of the thread." } }, "type": "object", "required": ["thread_id", "created_at", "updated_at", "metadata", "status"], "title": "Thread" }, "ThreadCreate": { "properties": { "thread_id": { "type": "string", "format": "uuid", "title": "Thread Id", "description": "The ID of the thread. If not provided, a random UUID will be generated." }, "assistant_id": { "type": "string", "format": "uuid", "title": "Assistant Id", "description": "The assistant to bind to the thread." }, "metadata": { "type": "object", "title": "Metadata", "description": "Metadata to add to thread." }, "if_exists": { "type": "string", "enum": ["raise", "do_nothing"], "title": "If Exists", "description": "How to handle duplicate creation. Must be either 'raise' (raise error if duplicate), or 'do_nothing' (return existing thread).", "default": "raise" } }, "type": "object", "title": "ThreadCreate", "description": "Payload for creating a thread." }, "ThreadPatch": { "properties": { "metadata": { "type": "object", "title": "Metadata", "description": "Metadata to merge with existing thread metadata." } }, "type": "object", "title": "ThreadPatch", "description": "Payload for creating a thread." }, "ThreadState": { "properties": { "values": { "anyOf": [ { "items": { "type": "object" }, "type": "array" }, { "type": "object" } ], "title": "Values" }, "next": { "items": { "type": "string" }, "type": "array", "title": "Next" }, "tasks": { "items": { "type": "object", "properties": { "id": { "type": "string", "title": "Task Id" }, "name": { "type": "string", "title": "Node Name" }, "error": { "type": "string", "title": "Error" }, "interrupts": { "type": "array", "items": {} }, "checkpoint": { "$ref": "#/components/schemas/CheckpointConfig", "title": "Checkpoint" }, "state": { "$ref": "#/components/schemas/ThreadState" } }, "required": ["id", "name"] }, "type": "array", "title": "Tasks" }, "checkpoint": { "$ref": "#/components/schemas/CheckpointConfig", "title": "Checkpoint" }, "metadata": { "type": "object", "title": "Metadata" }, "created_at": { "type": "string", "title": "Created At" }, "parent_checkpoint": { "type": "object", "title": "Parent Checkpoint" } }, "type": "object", "required": ["values", "next", "checkpoint", "metadata", "created_at"], "title": "ThreadState" }, "ThreadStateUpdate": { "properties": { "values": { "anyOf": [ { "type": "object" }, { "type": "null" } ], "title": "Values", "description": "The values to update the state with." }, "checkpoint": { "$ref": "#/components/schemas/CheckpointConfig", "title": "Checkpoint", "description": "The checkpoint to update the state of." } }, "type": "object", "title": "ThreadStateUpdate", "description": "Payload for updating the state of a thread." }, "ThreadStateUpdateResponse": { "properties": { "checkpoint": { "type": "object", "title": "Checkpoint" } }, "type": "object", "title": "ThreadStateUpdateResponse", "description": "Response for adding state to a thread." }, "CheckpointConfig": { "type": "object", "title": "CheckpointConfig", "description": "Checkpoint config.", "properties": { "thread_id": { "type": "string", "description": "Unique identifier for the thread associated with this checkpoint." }, "checkpoint_ns": { "type": "string", "description": "Namespace for the checkpoint, used for organization and retrieval." }, "checkpoint_id": { "type": "string", "description": "Optional unique identifier for the checkpoint itself." }, "checkpoint_map": { "type": "object", "description": "Optional dictionary containing checkpoint-specific data." } } }, "StorePutRequest": { "type": "object", "required": ["namespace", "key", "value"], "properties": { "namespace": { "type": "array", "items": { "type": "string" }, "title": "Namespace", "description": "A list of strings representing the namespace path." }, "key": { "type": "string", "title": "Key", "description": "The unique identifier for the item within the namespace." }, "value": { "type": "object", "title": "Value", "description": "A dictionary containing the item's data." } }, "title": "StorePutRequest", "description": "Request to store or update an item." }, "StoreDeleteRequest": { "type": "object", "required": ["key"], "properties": { "namespace": { "type": "array", "items": { "type": "string" }, "title": "Namespace", "description": "A list of strings representing the namespace path." }, "key": { "type": "string", "title": "Key", "description": "The unique identifier for the item." } }, "title": "StoreDeleteRequest", "description": "Request to delete an item." }, "StoreSearchRequest": { "type": "object", "properties": { "namespace_prefix": { "type": ["array", "null"], "items": { "type": "string" }, "title": "Namespace Prefix", "description": "List of strings representing the namespace prefix." }, "filter": { "type": ["object", "null"], "additionalProperties": true, "title": "Filter", "description": "Optional dictionary of key-value pairs to filter results." }, "limit": { "type": "integer", "default": 10, "title": "Limit", "description": "Maximum number of items to return (default is 10)." }, "offset": { "type": "integer", "default": 0, "title": "Offset", "description": "Number of items to skip before returning results (default is 0)." } }, "title": "StoreSearchRequest", "description": "Request to search for items within a namespace prefix." }, "StoreListNamespacesRequest": { "type": "object", "properties": { "prefix": { "type": "array", "items": { "type": "string" }, "title": "Prefix", "description": "Optional list of strings representing the prefix to filter namespaces." }, "suffix": { "type": "array", "items": { "type": "string" }, "title": "Suffix", "description": "Optional list of strings representing the suffix to filter namespaces." }, "max_depth": { "type": "integer", "title": "Max Depth", "description": "Optional integer specifying the maximum depth of namespaces to return." }, "limit": { "type": "integer", "default": 100, "title": "Limit", "description": "Maximum number of namespaces to return (default is 100)." }, "offset": { "type": "integer", "default": 0, "title": "Offset", "description": "Number of namespaces to skip before returning results (default is 0)." } } }, "Item": { "type": "object", "required": ["namespace", "key", "value", "created_at", "updated_at"], "properties": { "namespace": { "type": "array", "items": { "type": "string" }, "description": "The namespace of the item. A namespace is analogous to a document's directory." }, "key": { "type": "string", "description": "The unique identifier of the item within its namespace. In general, keys needn't be globally unique." }, "value": { "type": "object", "description": "The value stored in the item. This is the document itself." }, "created_at": { "type": "string", "format": "date-time", "description": "The timestamp when the item was created." }, "updated_at": { "type": "string", "format": "date-time", "description": "The timestamp when the item was last updated." } }, "description": "Represents a single document or data entry in the graph's Store. Items are used to store cross-thread memories." }, "SearchItemsResponse": { "type": "object", "required": ["items"], "properties": { "items": { "type": "array", "items": { "$ref": "#/components/schemas/Item" } } } }, "ListNamespaceResponse": { "type": "array", "items": { "type": "array", "items": { "type": "string" } } }, "ErrorResponse": { "type": "string", "title": "ErrorResponse", "description": "Error message returned from the server" } }, "responses": { "GetItemResponse": { "description": "Successful retrieval of an item.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Item" } } } }, "PutItemResponse": { "description": "Item successfully stored or updated.", "content": {} }, "DeleteItemResponse": { "description": "Item successfully deleted.", "content": {} }, "SearchItemsResponse": { "description": "Successful search operation.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/SearchItemsResponse" } } } }, "ListNamespacesResponse": { "description": "Successful retrieval of namespaces.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ListNamespaceResponse" } } } }, "ErrorResponse": { "description": "An error occurred.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } } } } }