This guide walks you through creating a sub-agent from scratch. By the end, you’ll have a working custom agent with its own instructions and capabilities.Agents become most powerful when connected to multiple services. Start simple with instructions, then add connections to build workflows across your stack.
The simplest agent needs nothing but instructions. Here’s a Writing Coach in under a minute:
Create an Agents folder in your workspace
Add a document called Writing Coach
Write your instructions directly in the document:
Copy
Ask AI
You are a writing coach that helps improve clarity and style.- Point out wordy phrases and suggest concise alternatives- Flag passive voice when active would be stronger- Keep feedback encouraging and specific
Run /agent refresh and activate with @writing-coach
That’s it—no API keys, no configuration. The document is the agent.
Every sub-agent is defined by a Craft document. The document title becomes the agent’s name, and the content defines its behavior:
Copy
Ask AI
📄 Agent Name└── Your agent's instructions, MCP configs, and API definitions
You can also create an Instructions subpage if you want to keep your instructions separate from other content in the document (like workflow results the agent might save). Both approaches work—the agent reads instructions from either location.
Let’s create a research assistant that can search the web using the Exa API.
1
Create the Agents folder
In your Craft workspace, create a folder called Agents at the root level. This is where Craft Agents looks for sub-agent definitions.
Copy
Ask AI
📁 Your Workspace└── 📁 Agents ← Create this folder
2
Create the agent document
Inside the Agents folder, create a new document. Name it Research - this becomes the agent’s name.
Copy
Ask AI
📁 Agents└── 📄 Research ← Create this document
3
Write the agent instructions
In your agent document, write what you want your agent to do:
Copy
Ask AI
You are a research assistant that helps find, analyze, and synthesize information from the web.## Your Approach- Always search for multiple sources on a topic- Prioritize recent and authoritative sources- Summarize findings clearly with bullet points- Include source links for verification## What You're Good At- Finding recent news and articles- Academic and technical research- Market and competitive analysis- Fact-checking claims## How to Respond- Start with a brief answer, then provide details- Use clear headings to organize information- Always cite your sources with links
4
Add API access (optional)
Craft Agents has built-in web search, so your agent can already find information online. But if you want more powerful and customizable web search for critical research tasks—like neural search, domain filtering, or full content extraction—you can add a dedicated search API. The simplest way is to paste a documentation link:
Copy
Ask AI
## Web Search APIhttps://docs.exa.ai/reference/search
If the doc link isn’t accessible to the agent, paste the relevant documentation:
Copy
Ask AI
## Web Search API**Base URL:** https://api.exa.ai### Search`POST /search`Body: `query` (required), `numResults`, `type` ("neural" or "keyword")Headers: `x-api-key: {api_key}`
Craft Agents automatically detects API definitions and creates tools the agent can use.
5
Refresh and activate
In Craft Agents, refresh the agent list and activate your new agent:
Copy
Ask AI
> /agent refreshFound 1 agent: Research> @researchSwitched to Research agent.> Find recent articles about AI agents
The first time you activate an agent with an API, you’ll be prompted for the API key.
Going further: This agent connects to one service. But you can add multiple—combine Exa search with Linear to automatically create issues from research findings, or add Slack to share results with your team.
Here’s the full agent document content for reference:
Copy
Ask AI
You are a research assistant that helps find, analyze, and synthesizeinformation from the web.## Your Approach- Always search for multiple sources on a topic- Prioritize recent and authoritative sources- Summarize findings clearly with bullet points- Include source links for verification## What You're Good At- Finding recent news and articles- Academic and technical research- Market and competitive analysis- Fact-checking claims## How to Respond- Start with a brief answer, then provide details- Use clear headings to organize information- Always cite your sources with links---## Web Search APIThis agent can search the web using Exa:```bashcurl -X POST https://api.exa.ai/search \ -H "x-api-key: YOUR_EXA_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "query": "search query", "numResults": 10, "type": "neural" }'
Agents can update their own instructions based on your feedback. If you say:
Copy
Ask AI
> Remember that I prefer APA citation format
The agent may offer to save this preference to its instructions for future conversations.You can also manually edit the agent document in Craft - changes take effect when you reload: