Skip to main content
The Custom Agents API allows you to create specialized agents with custom personalities, behaviors, and configurations.

Overview

Custom agents extend DeerFlow with:
  • SOUL.md: Agent personality and behavioral guardrails
  • Model override: Use specific LLM for this agent
  • Tool groups: Restrict available tools
  • USER.md: Global user profile injected into all custom agents
Base URL: http://localhost:8001/api

List Custom Agents

Get all custom agents available in the agents directory.

Response

array
Array of agent objects

Example

Response

Check Agent Name

Validate an agent name and check availability.

Parameters

string
required
Agent name to check (must match ^[A-Za-z0-9-]+$)

Response

boolean
Whether the name is available (case-insensitive)
string
Normalized name (lowercase)

Example

Response

Get Custom Agent

Retrieve details and SOUL.md content for a specific agent.

Parameters

string
required
Agent name

Response

string
Agent identifier
string
Agent description
string
Optional model override
array
Optional tool group whitelist
string
SOUL.md content (included in GET only)

Example

Response

Create Custom Agent

Create a new custom agent with config and SOUL.md.

Request Body

string
required
Agent name (must match ^[A-Za-z0-9-]+$, stored as lowercase)
string
default:""
Agent description
string
Optional model override (e.g., “gpt-4”, “claude-3-opus”)
array
Optional tool group whitelist (e.g., [“sandbox”, “research”])
string
default:""
SOUL.md content - agent personality and behavioral guardrails

Response

Returns the created agent object with all fields including SOUL.md content.

Example

Response
Agent names are case-insensitive and normalized to lowercase for storage.

Update Custom Agent

Update an existing agent’s config and/or SOUL.md.

Parameters

string
required
Agent name

Request Body

All fields are optional. Only provided fields will be updated.
string
Updated description
string
Updated model override
array
Updated tool group whitelist
string
Updated SOUL.md content

Response

Returns the updated agent object with all fields.

Example

Delete Custom Agent

Delete a custom agent and all its files.

Parameters

string
required
Agent name

Response

Returns 204 No Content on success.

Example

This permanently deletes the agent directory including config.yaml, SOUL.md, and any agent-specific memory.

Get User Profile

Read the global USER.md file injected into all custom agents.

Response

string
USER.md content, or null if not yet created

Example

Response

Update User Profile

Write the global USER.md file that describes you to all agents.

Request Body

string
default:""
USER.md content - your background, preferences, and context

Response

string
The saved content

Example

SOUL.md Format

SOUL.md defines your custom agent’s personality and behavior:

Agent Directory Structure

Custom agents are stored in:
config.yaml:

Best Practices

Define personality, behavioral guardrails, and communication style explicitly.
Different tasks benefit from different models:
  • Code review: GPT-4 (strong reasoning)
  • Content writing: Claude (natural language)
  • Data analysis: GPT-4 with code interpreter
Limit tools to what the agent needs:
Create a comprehensive USER.md that all agents can reference:

Error Codes

error
Agent not found
error
Agent already exists (when creating)
error
Invalid agent name (must match ^[A-Za-z0-9-]+$)
error
Internal server error

Next Steps

Gateway API Overview

Learn about other Gateway endpoints

Skills API

Manage skills for your agents

Models Configuration

Configure LLM models

Agent System

Understanding the agent architecture