Skip to content

API Reference

This reference covers the primary entry points for interacting with AgentSpine.

The AgentSpine class is the primary interface for the SDK.

from agentspine import AgentSpine
spine = AgentSpine(
workflow="my_workflow",
config=None # Optional AgentSpineConfig
)

Triggers the full pipeline orchestrator for a specific action.

result = await spine.execute_task(
task_id="unique_task_id",
action="action_name",
params={"foo": "bar"},
hard_dedupe=True # Optional, defaults to True
)
  • Returns: ActionResult object.
  • Raises: PolicyViolation if a policy blocks the action.

The AgentSpine server provides a RESTful API for interaction.

EndpointMethodDescription
/api/v1/actionsPOSTSubmit a new action request.
/api/v1/actionsGETList recent action executions.
/api/v1/actions/{id}GETGet detailed state and timeline for an action.
/api/v1/actions/{id}/replayPOSTRe-run a historical action.
EndpointMethodDescription
/api/v1/approvalsGETList actions waiting for manual approval.
/api/v1/approvals/{id}/resolvePOSTApprove or reject a pending action.
/api/v1/policiesGETList all active safety policies.
EndpointMethodDescription
/api/v1/eventsGETStream the global event log.
/api/v1/rewardsPOSTRecord feedback/reward signals for an action.
/healthGETLiveness and readiness check.

The object returned by SDK execution calls.

class ActionResult(BaseModel):
id: UUID
status: ActionStatus # SUCCESS, FAILED, BLOCKED
output: Optional[dict]
error: Optional[str]
metadata: dict