Skip to main content

Overview

In this guide, you’ll create a specialized AI agent, configure its capabilities, and use it to accomplish real tasks. By the end, you’ll understand how to build agents tailored to your needs.

Prerequisites

  • klaw installed and configured (Installation Guide)
  • API key configured (ANTHROPIC_API_KEY or EACHLABS_API_KEY)

Step 1: Initialize klaw

If you haven’t already, initialize klaw’s configuration:
This creates the ~/.klaw directory with default configuration files.

Step 2: Create Your Agent

Let’s create a coding agent specialized for Go development:
Verify the agent was created:
Output:

Step 3: Examine the Agent Definition

View the agent’s configuration:
Output:
The agent definition is stored in ~/.klaw/agents/go-developer.toml:

Step 4: Chat with Your Agent

Start a conversation with your agent:
Now you can interact with your specialized Go developer:

Step 5: Add More Skills

Enhance your agent with additional capabilities:

Step 6: Run Agent Tasks

One-Shot Tasks

Execute a single task:

Interactive Mode

For ongoing work:

Container Mode

Run in isolation:

Step 7: Configure the Workspace

Customize the agent’s context by editing workspace files:

SOUL.md - Agent Identity

Edit ~/.klaw/workspace/SOUL.md:

USER.md - Your Preferences

Create ~/.klaw/workspace/USER.md:

Creating More Agents

Here are some useful agent configurations:

Research Agent

DevOps Agent

Documentation Agent

Using Multiple Agents

You can route messages to different agents:
Or dispatch tasks programmatically:

Best Practices

Each agent should have a specific focus. Specialized agents perform better than generalists.
Add skills as needed. Fewer skills mean faster responses and lower token usage.
  • Sonnet: General tasks, coding, research
  • Opus: Complex reasoning, architecture decisions
  • Haiku: Quick responses, simple tasks
For file-focused agents, set a workdir to contain operations:

Next Steps

Slack Integration

Deploy your agent to Slack

Custom Tools

Build custom tools for your agents

Multi-Agent Workflows

Orchestrate multiple agents together

Distributed Deployment

Scale across multiple machines