How to Create Agents on DigitalOcean Gradient™ AI Platform

Validated on 28 Aug 2025 • Last edited on 2 Sep 2025

DigitalOcean Gradient™ AI Platform lets you build fully-managed AI agents with knowledge bases for retrieval-augmented generation, multi-agent routing, guardrails, and more, or use serverless inference to make direct requests to popular foundation models.

Create an Agent Using Automation

To create an agent with the DigitalOcean API, provide a name, a foundation model, instructions, the project identifier, and the datacenter region. We strongly recommend adding a knowledge base so your agent can ground its responses in your own domain data, reducing hallucinations and improving accuracy.

How to Create an Agent Using the DigitalOcean API
  1. Create a personal access token and save it for use with the API.
  2. Send a POST request to https://api.digitalocean.com/v2/gen-ai/agents.

cURL

Using cURL:

curl -X POST \
    -H "Content-Type: application/json"  \
    -H "Authorization: Bearer $DIGITALOCEAN_TOKEN" \
    "https://api.digitalocean.com/v2/gen-ai/agents" \
    -d '{
      "name": "api-create",
      "model_uuid": "95ea6652-75ed-11ef-bf8f-4e013e2ddde4",
      "instruction": "be a weather reporter",
      "description": "weather-agent",
      "project_id": "37455431-84bd-4fa2-94cf-e8486f8f8c5e",
      "tags": [
        "tag1"
      ],
      "region": "tor1",
      "knowledge_base_uuid": [
        "9758a232-b351-11ef-bf8f-4e013e2ddde4"
      ]
    }'

You can also use the API to get available options for these parameters:

Create an Agent Using the Control Panel

To create an agent from the DigitalOcean Control Panel, in the left menu, click Agent Platform to go to the Agent Workspaces tab. Click the workspace where you want to create an agent to go to that workspace’s Agents tab. Finally, click Create Agent to open the Create an agent page, where you can choose a custom configuration or a template.

Give Your Agent a Name

Choose a descriptive name in the Agent name field that reflects the agent’s role or expertise.

Choose a Configuration

Choose a custom configuration to define the agent’s objective, model, and settings, or choose a template with predefined instructions and a default model. You can add a knowledge base with either option.

Define Agent Instructions

Provide clear instructions that define your agent’s identity, objectives, expertise, and boundaries. These instructions help the agent understand what role it plays, what tasks it should prioritize, and which resources it can use.

You are a travel agent. You help find airline tickets and car rentals, compare prices, schedules, and find the best deals.
You also suggest hotel, resort, or vacation rentals that cost less than $5000 for a week.
Make sure that the recommendations you make are clear, actionable, and customized to the financial situation.

See Write Effective Agent Instructions for best practices. You can also use the agent instruction templates as-is or adapt them to your needs.

Select a Model

Agent use foundation models to interpret prompts and generate responses.

Select a foundation model from the Select a model drop-down list. To test models before choosing, use the Model Playground by clicking Model Playground.

If you use a commercial model like Anthropic Claude, you must bring your own API key. We bill usage directly to your model account. If your team already has keys, choose one from the Select or add an API key drop-down list, or add a new key.

You can change the foundation model at any time after creating the agent.

Add API Key

From your Anthropic account, copy your API key. In the Add Anthropic API Key window, under the Anthropic API Key section, paste the key.

Under Key Name, type a unique name without using the key itself. Names can include lowercase letters, numbers, hyphens, and periods.

Check I agree to the Anthropic Terms to confirm agreement, and then click Verify and Save to validate the API key.

After verification, under the Select or add an API key section, in the drop-down list, we automatically select the API key.

In the Model Keys page, you can view, add, edit, or delete model keys. For more details on foundation models, see our models page.

Select a Template

From the Agent templates tab, select one of the following templates:

  • Customer Support Agent: This template creates an agent configured to answer product questions and help users troubleshoot issues.
  • Business Analytics Agent: This template creates an agent configured to analyze data and generate insights.

The template automatically sets the model and guardrails.

Choose a Workspace

Workspaces group related agents together under a single space to help you organize your AI agents, share them across your team, and run evaluations to test and compare their performance in a structured way. Every agent you create exists in a workspace. By default, you have one workspace called My Agent Workspace (Created by Default).

In the Where should your agent live? section, choose a workspace for your agent. You can select an existing workspace by clicking Use Existing and choosing one from the drop-down list, or create a new workspace by clicking Create New and providing the new workspace a name and description.

Add Knowledge Bases

A knowledge base is a mixture of unstructured text files in Spaces buckets and web pages. Knowledge bases provide context to the prompt for your agent’s foundation model. Your agent uses knowledge bases to augment prompts to the foundation model, answer questions, and analyze documents. Examples of knowledge bases include product documentation, pricing, and product catalogs.

We strongly recommend adding one or more knowledge bases when creating your agent to ground its responses in your data and improve accuracy, either by selecting an existing one from the Knowledge Bases drop-down list or creating a new one.

Finalize and Create

By default, the new agent belongs to your default project. You can choose a different project from the Select a project drop-down list.

Optionally, you can tags your agents. Tags organize related resources. Tags must be single words with letters, numbers, colons, dashes, or underscores.

At the bottom of this section, review the chosen agent resources and model token rate.

Click Create Agent to complete creating the agent. Your agent appears in the Projects section of the control panel’s main menu.

Next Steps

After creating your agent, you can:

We can't find any results for your search.

Try using different keywords or simplifying your search terms.