SPM — StellarPath Memory Operating System Docs

Personal-agent harnesses

Published Last reviewed Applies to SPM-Polaris

Use SPM under a personal-agent harness when the harness already owns conversations, channels, scheduling, tools, or a memory interface. SPM is the memory daemon under that harness, not a rival harness. The harness owns the agent experience. SPM owns admission, evidence, promotion decisions, and deletion.

Divide the work clearly

The harness provides:

SPM provides the durable memory contract:

SPM does not provide channels, scheduling, or a UI for the agent. It does not connect to WeChat, Feishu, Telegram, calendars, or contacts. The console can list sources, but SPM does not provide a memory tree, diff editor, or merge editor for a personal harness.

Two reference harnesses show the split. OpenViking is an AGPL context filesystem. CowAgent is an MIT personal harness with tiered memory and self-evolution. Keep the bridge at the HTTP or MCP boundary. Do not link the AGPL tree into SPM or copy either harness into your deployment.

Give the adapter a reusable key

A long-running adapter needs one reusable key for its partition. Ordinary request tokens are single-use. SPM records each token identifier and rejects a replay. A delegated token with the "key": true claim can be presented on every request until it expires.

Mint the narrowest key the adapter needs with POST /v2/keys/delegate from an operator key. Give it only the scopes for its work, a partition, a time-to-live, and a delegation depth no greater than 3. Keep the returned key in the harness's protected configuration. See Authentication for the general key model.

The bridge can use HTTP or MCP. HTTP exposes the /v2 endpoints directly. MCP exposes explicit memory tools. Choose one transport for the adapter and keep the memory contract the same.

Reference adapters

Two adapters ship in the repository and are exercised against each harness's own types:

Run tools/e2e_harness_bridges.py with the SDK and harness checkouts to repeat the check.

Map the session lifecycle

Use this sequence when a session ends:

  1. Call POST /v2/sessions/commit with the session summary and turns. SPM stores a summary source and transcript sources in the selected partition.
  2. Call POST /v2/sessions/{id}/distill. SPM creates rule-based lesson:pending proposals.
  3. Show those proposals in the harness's review surface. Send approved items to POST /v2/lessons/{id}/promote and rejected items to POST /v2/lessons/{id}/reject with a reason.
  4. On the next run, recall verified lessons with POST /v2/recall. If exact text matters, pass each returned read_token to POST /v2/read.

Promotion stays in SPM even when the review button lives in the harness. A rejected lesson must not return as advice. Feedback can be recorded with POST /v2/feedback when the harness knows whether a recalled item helped.

Distillation tries the configured extraction model first and falls back to rules: it lifts summary sentences and supported 经验: lines into pending lessons. The response names which path ran (proposed_by: llm or rules). A harness with a better extractor can propose lessons directly with POST /v2/lessons.

Handle refusals and failures

Treat a refusal as a useful result, not as a missing string to fill with model guesses. When recall returns a gate_reason other than passed, surface that reason and the empty evidence count. Do not let the model invent a citation from the harness's private copy.

Handle the two common transport failures separately:

A successful connection or tool listing does not prove the bridge works. Run a complete commit, distill, promote, recall, read, delegate, and purge path against a local stack before wiring the harness. The local stack is described in Self-host SPM Personal. Keep the acceptance data in a throwaway partition.

A harness can keep its own display and scheduling state. SPM remains the authority for what enters memory, what can support an answer, and what has been deleted.