Skip to main content

agents

Creates, updates, deletes, gets or lists an agents resource.

Overview

Nameagents
TypeResource
Iddigitalocean.genai.agents

Fields

The following fields are returned by SELECT queries:

A successful response.

NameDatatypeDescription
namestringAgent name (example: example name)
project_idstring (example: 123e4567-e89b-12d3-a456-426614174000)
user_idstring (uint64)Id of user that created the agent (example: 12345)
route_namestringRoute name (example: example name)
anthropic_api_keyobjectAnthropic API Key Info
api_key_infosarrayApi key infos
api_keysarrayApi keys
chatbotobjectA Chatbot
chatbot_identifiersarrayChatbot identifiers
child_agentsarrayChild agents
conversation_logs_enabledbooleanWhether conversation logs are enabled for the agent
created_atstring (date-time)Creation date / time (example: 2023-01-01T00:00:00Z)
deploymentobjectDescription of deployment
descriptionstringDescription of agent (example: example string)
functionsarray
guardrailsarrayThe guardrails the agent is attached to
if_casestring (example: example string)
instructionstringAgent instruction. Instructions help your agent to perform its job effectively. See Write Effective Agent Instructions for best practices. (example: example string)
kinteger (int64)
knowledge_basesarrayKnowledge bases
logging_configobject
max_tokensinteger (int64)
mcp_serversarrayMCP (Model Context Protocol) servers attached to this agent
modelobjectDescription of a Model
model_provider_keyobject
model_routerobjectModel router
openai_api_keyobjectOpenAI API Key Info
parent_agentsarrayParent agents
provide_citationsbooleanWhether the agent should provide in-response citations
reasoning_effortstringThe reasoning effort for the agent (example: example string)
regionstringRegion code (example: example string)
retrieval_methodstring- RETRIEVAL_METHOD_UNKNOWN: The retrieval method is unknown - RETRIEVAL_METHOD_REWRITE: The retrieval method is rewrite - RETRIEVAL_METHOD_STEP_BACK: The retrieval method is step back - RETRIEVAL_METHOD_SUB_QUERIES: The retrieval method is sub queries - RETRIEVAL_METHOD_NONE: The retrieval method is none (RETRIEVAL_METHOD_UNKNOWN, RETRIEVAL_METHOD_REWRITE, RETRIEVAL_METHOD_STEP_BACK, RETRIEVAL_METHOD_SUB_QUERIES, RETRIEVAL_METHOD_NONE) (default: RETRIEVAL_METHOD_UNKNOWN, example: RETRIEVAL_METHOD_UNKNOWN)
route_created_atstring (date-time)Creation of route date / time (example: 2023-01-01T00:00:00Z)
route_created_bystring (uint64) (example: 12345)
route_uuidstring (example: 123e4567-e89b-12d3-a456-426614174000)
tagsarrayAgent tag to organize related resources
temperaturenumber (float)
templateobjectRepresents an AgentTemplate entity
thinking_token_budgetinteger (int64)The thinking token budget for Anthropic extended thinking (0 = disabled)
top_pnumber (float)
updated_atstring (date-time)Last modified (example: 2023-01-01T00:00:00Z)
urlstringAccess your agent under this url (example: example string)
uuidstringUnique agent id (example: 123e4567-e89b-12d3-a456-426614174000)
version_hashstringThe latest version of the agent (example: example string)
vpc_egress_ipsarrayVPC Egress IPs
vpc_uuidstring (example: "12345678-1234-1234-1234-123456789012")
web_fetch_enabledbooleanWhether this agent can use the built-in web_fetch tool.
web_search_enabledbooleanWhether this agent can use the built-in web_search tool.
workspaceobject

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
genai_get_agentselectuuidTo retrieve details of an agent, GET request to /v2/gen-ai/agents/{uuid}. The response body is a JSON object containing the agent.
genai_list_agents_by_workspaceselectworkspace_uuidonly_deployed, page, per_pageTo list all agents by a Workspace, send a GET request to /v2/gen-ai/workspaces/{workspace_uuid}/agents.
genai_list_agentsselectonly_deployed, page, per_pageTo list all agents, send a GET request to /v2/gen-ai/agents.
genai_create_agentinsertTo create a new agent, send a POST request to /v2/gen-ai/agents. The response body contains a JSON object with the newly created agent object.
genai_update_agentreplaceuuidTo update an agent, send a PUT request to /v2/gen-ai/agents/{uuid}. The response body is a JSON object containing the agent.
genai_update_agents_workspacereplaceworkspace_uuidTo move all listed agents a given workspace, send a PUT request to /v2/gen-ai/workspaces/{workspace_uuid}/agents.
genai_delete_agentdeleteuuidTo delete an agent, send a DELETE request to /v2/gen-ai/agents/{uuid}.
genai_attach_agent_functionexecagent_uuidTo create a function route for an agent, send a POST request to /v2/gen-ai/agents/{agent_uuid}/functions.
genai_update_agent_functionexecagent_uuid, function_uuidTo update the function route, send a PUT request to /v2/gen-ai/agents/{agent_uuid}/functions/{function_uuid}.
genai_detach_agent_functionexecagent_uuid, function_uuidTo delete a function route from an agent, send a DELETE request to /v2/gen-ai/agents/{agent_uuid}/functions/{function_uuid}.
genai_attach_agent_guardrailsexecagent_uuidTo attach guardrails to an agent, send a POST request to /v2/gen-ai/agents/{agent_uuid}/guardrails.
genai_detach_agent_guardrailexecagent_uuid, guardrail_uuidTo detach a guardrail from an agent, send a DELETE request to /v2/gen-ai/agents/{agent_uuid}/guardrails/{guardrail_uuid}.
genai_attach_agentexecparent_agent_uuid, child_agent_uuidTo add an agent route to an agent, send a POST request to /v2/gen-ai/agents/{parent_agent_uuid}/child_agents/{child_agent_uuid}.
genai_update_attached_agentexecparent_agent_uuid, child_agent_uuidTo update an agent route for an agent, send a PUT request to /v2/gen-ai/agents/{parent_agent_uuid}/child_agents/{child_agent_uuid}.
genai_detach_agentexecparent_agent_uuid, child_agent_uuidTo delete an agent route from a parent agent, send a DELETE request to /v2/gen-ai/agents/{parent_agent_uuid}/child_agents/{child_agent_uuid}.
genai_update_agent_deployment_visibilityexecuuidCheck whether an agent is public or private. To update the agent status, send a PUT request to /v2/gen-ai/agents/{uuid}/deployment_visibility.

Parameters

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
agent_uuidstringThe UUID of the agent. (example: "123e4567-e89b-12d3-a456-426614174000")
child_agent_uuidstringRouted agent id (example: "123e4567-e89b-12d3-a456-426614174000")
function_uuidstringThe function route to be destroyed. This does not destroy the function itself. (example: "123e4567-e89b-12d3-a456-426614174000")
guardrail_uuidstringThe UUID of the guardrail to detach. (example: "123e4567-e89b-12d3-a456-426614174000")
parent_agent_uuidstringPagent agent id (example: "123e4567-e89b-12d3-a456-426614174000")
uuidstringUnique id (example: "123e4567-e89b-12d3-a456-426614174000")
workspace_uuidstringWorkspace uuid to move agents to (example: "123e4567-e89b-12d3-a456-426614174000")
only_deployedbooleanOnly list agents that are deployed. (example: true)
pageintegerPage number. (example: 1)
per_pageintegerItems per page. (example: 1)

SELECT examples

To retrieve details of an agent, GET request to /v2/gen-ai/agents/{uuid}. The response body is a JSON object containing the agent.

SELECT
name,
project_id,
user_id,
route_name,
anthropic_api_key,
api_key_infos,
api_keys,
chatbot,
chatbot_identifiers,
child_agents,
conversation_logs_enabled,
created_at,
deployment,
description,
functions,
guardrails,
if_case,
instruction,
k,
knowledge_bases,
logging_config,
max_tokens,
mcp_servers,
model,
model_provider_key,
model_router,
openai_api_key,
parent_agents,
provide_citations,
reasoning_effort,
region,
retrieval_method,
route_created_at,
route_created_by,
route_uuid,
tags,
temperature,
template,
thinking_token_budget,
top_p,
updated_at,
url,
uuid,
version_hash,
vpc_egress_ips,
vpc_uuid,
web_fetch_enabled,
web_search_enabled,
workspace
FROM digitalocean.genai.agents
WHERE uuid = '{{ uuid }}' -- required
;

INSERT examples

To create a new agent, send a POST request to /v2/gen-ai/agents. The response body contains a JSON object with the newly created agent object.

INSERT INTO digitalocean.genai.agents (
anthropic_key_uuid,
description,
instruction,
knowledge_base_uuid,
mcp_servers,
model_provider_key_uuid,
model_router_uuid,
model_uuid,
name,
open_ai_key_uuid,
project_id,
reasoning_effort,
region,
router_preset_slug,
tags,
thinking_token_budget,
web_fetch_enabled,
web_search_enabled,
workspace_uuid
)
SELECT
'{{ anthropic_key_uuid }}',
'{{ description }}',
'{{ instruction }}',
'{{ knowledge_base_uuid }}',
'{{ mcp_servers }}',
'{{ model_provider_key_uuid }}',
'{{ model_router_uuid }}',
'{{ model_uuid }}',
'{{ name }}',
'{{ open_ai_key_uuid }}',
'{{ project_id }}',
'{{ reasoning_effort }}',
'{{ region }}',
'{{ router_preset_slug }}',
'{{ tags }}',
{{ thinking_token_budget }},
{{ web_fetch_enabled }},
{{ web_search_enabled }},
'{{ workspace_uuid }}'
RETURNING
agent
;

REPLACE examples

To update an agent, send a PUT request to /v2/gen-ai/agents/{uuid}. The response body is a JSON object containing the agent.

REPLACE digitalocean.genai.agents
SET
agent_log_insights_enabled = {{ agent_log_insights_enabled }},
allowed_domains = '{{ allowed_domains }}',
anthropic_key_uuid = '{{ anthropic_key_uuid }}',
clear_mcp_servers = {{ clear_mcp_servers }},
conversation_logs_enabled = {{ conversation_logs_enabled }},
description = '{{ description }}',
instruction = '{{ instruction }}',
k = {{ k }},
max_tokens = {{ max_tokens }},
mcp_servers = '{{ mcp_servers }}',
model_provider_key_uuid = '{{ model_provider_key_uuid }}',
model_router_uuid = '{{ model_router_uuid }}',
model_uuid = '{{ model_uuid }}',
name = '{{ name }}',
open_ai_key_uuid = '{{ open_ai_key_uuid }}',
project_id = '{{ project_id }}',
provide_citations = {{ provide_citations }},
reasoning_effort = '{{ reasoning_effort }}',
retrieval_method = '{{ retrieval_method }}',
router_preset_slug = '{{ router_preset_slug }}',
tags = '{{ tags }}',
temperature = {{ temperature }},
thinking_token_budget = {{ thinking_token_budget }},
top_p = {{ top_p }},
uuid = '{{ uuid }}',
web_fetch_enabled = {{ web_fetch_enabled }},
web_search_enabled = {{ web_search_enabled }}
WHERE
uuid = '{{ uuid }}' --required
RETURNING
agent;

DELETE examples

To delete an agent, send a DELETE request to /v2/gen-ai/agents/{uuid}.

DELETE FROM digitalocean.genai.agents
WHERE uuid = '{{ uuid }}' --required
;

Lifecycle Methods

To create a function route for an agent, send a POST request to /v2/gen-ai/agents/{agent_uuid}/functions.

EXEC digitalocean.genai.agents.genai_attach_agent_function
@agent_uuid='{{ agent_uuid }}' --required
@@json=
'{
"agent_uuid": "{{ agent_uuid }}",
"description": "{{ description }}",
"faas_name": "{{ faas_name }}",
"faas_namespace": "{{ faas_namespace }}",
"function_name": "{{ function_name }}",
"input_schema": "{{ input_schema }}",
"output_schema": "{{ output_schema }}"
}'
;