SPM — StellarPath Memory Operating System Docs

Teams, presence and hand-off

Published Last reviewed Applies to SPM-Polaris

Use these endpoints when several agents share a case and need a small amount of coordination. You can record team membership, publish agent status, attach work to a case, and mint a short-lived key for a worker. These records help agents find context. Membership does not assign work, but it does gate team-scoped keys.

All examples use the hosted API:

https://api.spmos.ai

Send an SPM bearer key with each request:

Authorization: Bearer spm_live_...

Create an informational team

Create a team with a name:

curl -X POST https://api.spmos.ai/v2/teams \
  -H 'Authorization: Bearer spm_live_...' \
  -H 'Content-Type: application/json' \
  -d '{"name":"Release review"}'

List teams with GET /v2/teams. Add a member with POST /v2/teams/{team_id}/members:

{
  "actor_id": "agent-reviewer",
  "role": "reviewer"
}

The supported roles are owner, member, reviewer, and observer. Team creation, listing, and membership changes use the audit scope.

Membership is used in one place: only a non-observer member may mint a team-scoped key, and that key is confined to the team's registered partitions. Membership still does not assign cases.

Confine a key to the team

Register the partitions the team may use with POST /v2/teams/{team_id}/partitions:

{"partition": "team-release"}

Then mint a key with team_id:

{"scopes": ["recall", "memory:partition", "audit"], "team_id": "team_...", "ttl_seconds": 3600}

The caller must be a member and not an observer (403 TEAM_NOT_MEMBER or TEAM_ROLE_DENIED). The token carries the team and its partitions; using a partition outside that list returns 403 PARTITION_NOT_IN_TEAM. If you omit the partition, the team's first registered partition is used. A team with no registered partitions cannot issue a key (409 TEAM_HAS_NO_PARTITIONS).

Publish agent presence

A worker can report its current state with POST /v2/agents/{actor_id}/heartbeat:

curl -X POST https://api.spmos.ai/v2/agents/agent-reviewer/heartbeat \
  -H 'Authorization: Bearer spm_live_...' \
  -H 'Content-Type: application/json' \
  -d '{"status":"working"}'

The accepted statuses are online, working, blocked, and idle. List agents with GET /v2/agents. Each result includes actor_id, status, last_seen, and stale.

SPM marks a record stale after 120 seconds without a heartbeat. Remove a finished agent with DELETE /v2/agents/{actor_id} (404 UNKNOWN_AGENT if it is already gone). Presence is file-backed in a shared directory, so it survives a restart and concurrent writers are serialized; it is still not a distributed registry, so do not use it as a source of truth for cross-process liveness or scheduling.

Attach work to a case

Use POST /v2/artifacts to attach a produced file or note to a case:

{
  "case": "release-2026-12",
  "partition": "team-release",
  "uri": "https://github.com/VeridicalTech/example/pull/42",
  "text": "Review notes and remaining risks."
}

case and text are required. partition and uri are optional. A non-empty partition needs the memory:partition scope. The artifact is ingested as memory whose text starts with the literal marker case:<case>, so it appears in that case's timeline.

Read GET /v2/cases/{case}/timeline to retrieve artifacts and audit events for that case. The response includes sources whose text starts with case:<case> and audit events whose object_ref equals the case name. Timeline access uses the audit scope. A timeline is an audit view, not a task queue.

Mint a worker key

A lead can mint a narrower key with POST /v2/keys/delegate:

{
  "scopes": ["memory:read", "memory:write", "memory:partition"],
  "user_partition": "team-release",
  "ttl_seconds": 1800,
  "depth": 1
}

The requested scopes must be a subset of the caller's scopes. ttl_seconds must be between 60 and 86,400. depth must be between 1 and 3. Binding a partition requires the memory:partition scope. Any well-formed partition name is accepted; a typo quietly creates a new empty partition.

The returned token is narrower and expires at the returned expires_at time. SPM carries delegation depth in the job ID. A request that includes a scope the caller does not hold returns 403 SCOPE_NOT_HELD. A delegation beyond the requested depth returns 409 DELEGATION_TOO_DEEP.

A practical hand-off

  1. The lead recalls the case with its normal key and identifies the exact partition and work needed.
  2. The lead mints a delegate key with only the worker's required scopes, a short TTL, and the target partition.
  3. The worker starts with that key and sends a heartbeat with working.
  4. The worker performs its task, then attaches its output with POST /v2/artifacts. Include a public URI when one exists and put the useful note in text.
  5. The worker reports idle or blocked when it stops. The lead reads the case timeline and closes the hand-off with the resulting memory pack or timeline record.

The agent card at GET /.well-known/agent-card.json advertises the agent name, URL, capabilities, and skill IDs such as remember, recall, read, lessons, and delegate. Treat this card as descriptive metadata. It is not an execution contract and does not assign work or authorize requests.

Limits to plan for