STATEK
API Reference
Agents

Agents

Agents define role instructions, tools, provider metadata, and private context. Jobs execute under an agent.

SymbolImport pathPurposeStability
Agentstatek.agents.agentBase workflow and tool specificationCore
SupervisedAgentstatek.agents.agentBase for queued or delegated agentsCore
WarmupDefstatek.agents.agentParsed warmup code and metadataCore
DialogAgentstatek.agents.dialog_agentOne-to-one dialog agent with send_message integrationSpecialized
Reminder, RecurringReminderstatek.agents.dialog_agentDialog reminder policiesSpecialized
Coordinatorstatek.agents.coordinatorDelegates requests to task agentsSpecialized
MessageDispatcherstatek.agents.message_dispatcherRoutes incoming messages to threadsSpecialized
Researcherstatek.agents.researcherResearch and answer agent templateSpecialized

For practical reminder examples, see Harness Reminders.

Agent

@db0.memo
@dataclass
class Agent:
    role: str
    _system_prompt: Optional[SystemPrompt]
    _tools: list[Callable]
    _metadata: Optional[dict[str, str]] = None
    _description: Optional[str] = None

Defines the reusable role, prompt, tools, metadata, and context for jobs.

Import path: from statek.agents.agent import Agent

Parameters

NameDescription
roleApplication-defined role name. Prompt files also match agents by role.
_system_promptParsed SystemPrompt or None when prompt files will fill it.
_toolsTool callables available to the agent. Names beginning with _ become internal tools.
_metadataPrompt/job metadata. MODEL is required before creating a JobDef.
_descriptionOptional short capability description.

Properties and methods

MemberReturnsDescription
description`strNone`
context`dictNone`
all_toolslist[Callable]Regular and internal tools, including name-resolved tools.
system_prompt(task_difficulty, job_params=None, **kwargs)strFormats the prompt for a difficulty and job parameters.
update_system_prompt(new_prompt)boolUpdates only when content differs.
update_metadata(new_metadata)boolUpdates metadata only when it differs.
update_description(new_description)boolUpdates description only when it differs.
init_context()NoneOverride hook for agent-specific context.
get_adapter(name)`AnyNone`
append_tool(tool_or_name)NoneAdds a callable or context-resolved tool name.
get_examples()list[str]Lists example names accessible to the role.

Raises

system_prompt(...) can raise formatting errors when prompt placeholders cannot be resolved. Tool formatting can raise ValueError if a name-based tool is missing from context.

from statek.agents.agent import Agent
from statek.prompt_config import make_system_prompt
 
agent = Agent(
    role="analyst",
    _system_prompt=make_system_prompt("Use the available tools.\n\n## Rules\n{tools}"),
    _tools=[],
    _metadata={"MODEL": "openai/gpt-5-mini"},
)

SupervisedAgent

@db0.memo
@dataclass
class SupervisedAgent(Agent):
    warmup_def: Optional[WarmupDef] = None

Adds warmup definitions and job-definition creation for agents managed by queues, coordinators, or subtasks.

Import path: from statek.agents.agent import SupervisedAgent

MemberReturnsDescription
referenced_localslist[str]External local names referenced by warmup code.
update_warmup_def(unparsed_warmup_def)boolParses and updates warmup code only when changed.
create_job_def(tools=None, warmup_code=None, shared_vars=None, locale=None, **kwargs)JobDefCreates a JobDef with combined warmup code and job parameters.
from statek.agents.agent import SupervisedAgent
from statek.prompt_config import make_system_prompt
 
agent = SupervisedAgent(
    role="worker",
    _system_prompt=make_system_prompt("Handle one queued task."),
    _tools=[],
    _metadata={"MODEL": "openai/gpt-5-mini"},
)
 
job_def = agent.create_job_def(task_id="A-42")

WarmupDef

@db0.memo
@dataclass
class WarmupDef:
    warmup_code: str | CodeBlock | Sequence[str | CodeBlock] | None = None
    metadata: dict[str, Any] | None = None

Stores warmup code parsed from configuration.

Import path: from statek.agents.agent import WarmupDef

MemberReturnsDescription
hiddenboolTrue when metadata contains hidden=True.

Specialized agents

ClassSignatureDescription
DialogAgentDialogAgent(send_message, tools=None, role="dialog_agent", add_answer_tool=True, _metadata=None)Builds dialog tools around a send_message(body, media=None) callable. Temporal send_message callables are rejected.
CoordinatorCoordinator(task_agents, role="coordinator")Exposes task-agent discovery and delegation tools.
MessageDispatcherMessageDispatcher(chat_history, start_new_thread, dispatch_to, role="message_dispatcher")Wraps routing callables as tools for thread dispatch.
ResearcherResearcher(send_message=None, tools=None, role="researcher")Adds or reuses ask and answer tools.
RecurringReminderRecurringReminder(text, min_dialog_len=None)Fires after the configured dialog length, or immediately when length is not set.

RecursiveReminder remains available as a deprecated compatibility alias for RecurringReminder.

from statek.agents.researcher import Researcher
 
def send_message(body: str, media=None):
    print(body)
 
agent = Researcher(
    send_message=send_message,
    role="researcher",
)
agent.update_metadata({"MODEL": "openai/gpt-5-mini"})

Related APIs: Jobs, Tools, Prompts, Runners.