Agent¶
agent
¶
Agent model — a participant (node) in a Claw society graph.
Agents can be AI-powered (backed by an LLM) or human (interfacing via CLI, Slack, GitHub, or webhook). An agent is unaware of its position in the graph topology — it only receives events along its edges.
Example::
from claw import Agent
coder = Agent(
"coder",
role="implementer",
model="claude-opus",
instructions="Write clean, tested Python code.",
tools=[Tool(name="file_edit", description="Edit a file")],
)
human = Agent("maintainer", role="maintainer", human=True, interface="cli")
Tool
¶
Bases: BaseModel
A tool/action available to an agent.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
name
|
Unique tool identifier (e.g. "file_edit", "shell_exec"). |
required | |
description
|
Human-readable description of what the tool does. |
required | |
parameters
|
JSON Schema defining the tool's input parameters. |
required |
Agent
¶
Bases: BaseModel
A participant in a Claw society.
Agents are graph nodes. The same agent definition produces different behavior depending on its edge context — the compiler generates per-agent prompts from graph topology.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
name
|
Unique identifier for the agent within a society. |
required | |
role
|
Semantic role label (e.g. "implementer", "critic", "dispatcher"). |
required | |
model
|
LLM model identifier. Required for AI agents, None for humans. |
required | |
instructions
|
Agent-specific instructions included in compiled prompts. |
required | |
tools
|
List of tools available to this agent. |
required | |
human
|
Whether this is a human agent (different runtime interface). |
required | |
interface
|
Interface type for human agents ("cli", "github", "slack", "webhook"). |
required |
Raises:
| Type | Description |
|---|---|
ValueError
|
If a human agent lacks an interface or an AI agent lacks a model. |