Skip to content

manager

diapason.agents.manager

Persistent agent lifecycle manager.

Composition layer — stores agent state in SQLite, delegates all computation to the five existing primitives (Intelligence, Agent, Tools, Engine, Learning).

AgentManager

Persistent agent lifecycle manager with SQLite backing.

create_from_template(template_id, name, overrides=None)

Create an agent from a template with optional overrides.

find_binding_for_channel(channel_type, channel_id)

Find a dedicated binding for a specific channel.

list_templates() staticmethod

Discover built-in and user templates.

start_tick(agent_id)

Mark agent as running. Raises ValueError if already running.

A row that has been running longer than _STALE_TICK_SECONDS without any update is treated as a zombie left by a dead worker and overtaken rather than refused — otherwise a crash with no server around to sweep it would wedge the agent forever.

store_agent_response(agent_id, content, tool_calls=None)

Store an agent-to-user response message.

tool_calls is an optional list of {tool, arguments, result, success, latency} dicts captured during the turn. They are stored as JSON alongside the message so the UI can replay them after a page reload.