Recipes / Spawn a long-running agent

Spawn a long-running agent

Most MCP servers expose CRUD. Cognethics also exposes agentic primitives — the same ones that orchestrate work inside the platform. This recipe walks the full round-trip: mission defines scope and budget, spawn creates a worker under a persona, check_budget enforces the ceiling at dispatch time, wait_for_messages blocks on fold-back instead of polling, complete_task folds the result up the hierarchy, and audit returns a hash-chained record of every step.

Authenticate

from cognethics import Client

client = Client(
    api_key="ck_…",                                # minted from https://platform.cognethics.com/dashboard/
    base_url="https://<your-tenant>.cognethics.com",  # your tenant subdomain
)

Discover, then invoke

found = client.call("prism_introspect", dimension="capability_search", query="launch a mission with a budget")
coord = found["results"][0]["coordinate"]          # e.g. "agent_command/<app>/mission/launch"
result = client.call(coord, arguments={"goal": "Validate the March AP batch", "budget_usd": 10})
print(result["data"]["mission_id"])

Discover the coordinate at runtime rather than hard-coding it — the catalog is versioned and permission-scoped, and capability_search returns exactly what your key may call.

The full worked recipe — every call in order, with request and response bodies — is in the signed-in reference: sign in to read it.


Back to all recipes.