SPM — StellarPath Memory Operating System Docs

Correct, rate and promote memory

Published Last reviewed Applies to SPM-Polaris

Use this owner-controlled loop when saved memory is wrong, useful, or ready to share. Correct the source, record feedback, propose a lesson, review it, and promote only what you trust. SPM keeps the steps separate so observed evidence does not become committed guidance without review.

The lifecycle at a glance

  1. Correct a source when its text or topic is wrong.
  2. Rate the source after you use it.
  3. Propose a lesson with its scope and evidence.
  4. Review pending lessons.
  5. Promote or reject each lesson.
  6. Recall verified lessons when you need approved guidance.
  7. Commit and distill a finished session when it contains reusable knowledge.

These routes use https://api.spmos.ai. Send API authorization as required by your client. The examples show request bodies only.

1. Correct a source

Use PATCH /v2/sources/{source_id} with text, topic, or both:

{
  "text": "The release uses the staging deployment check.",
  "topic": "deployment"
}

The source keeps the same ID. The old text remains as a previous version. The edit is scoped to the source's ingest partition. Send at least one editable field. Text accepts up to 12,000 characters, and a topic accepts up to 64 characters.

Use this route for a factual correction. Do not use a lesson to hide a wrong source. Fix the source first, then propose guidance that points to the corrected evidence.

2. Record whether it helped

Use POST /v2/feedback to attach an observation to a source:

{
  "source_id": "src_123",
  "useful": true,
  "note": "This answer matched the deployment runbook."
}

SPM records the result under the feedback topic. Set useful to false when the source did not help, and explain why in note when a short explanation will help later curation. The note can contain up to 1,000 characters.

3. Propose a lesson

Use POST /v2/lessons to create a pending lesson:

{
  "text": "Run the staging deployment check before changing Polaris.",
  "partition": "personal",
  "applies_to": "SPM-Polaris deployments",
  "evidence_ids": ["src_123"],
  "supersedes": ""
}

A new lesson starts as lesson:pending. partition is required. applies_to explains where the lesson applies. evidence_ids links supporting sources, and supersedes can name the lesson it replaces. You can submit up to 32 evidence IDs. Lesson text accepts up to 12,000 characters.

Pending lessons are proposals, not approved memory. They should not be treated as team guidance until a reviewer promotes them.

4. List lessons for review

Use GET /v2/lessons to list pending lessons. Filter by state and partition:

GET /v2/lessons?state=pending&partition=personal

The state values are pending, verified, and rejected. The default state is pending. The response includes each lesson's source ID, state, text, partition, and source version.

Review the text, its evidence, its scope, and any feedback before you change its state. A lesson can be verified only when its evidence supports the claim and its applies_to value is clear enough for the intended readers.

5. Promote or reject a lesson

Promote a lesson with POST /v2/lessons/{source_id}/promote:

{
  "target_partition": "team-release",
  "reviewer_note": "Checked against the current deployment source."
}

Promotion marks the lesson as lesson:verified. If target_partition differs from the lesson's current partition, SPM copies the verified lesson into that partition under a new ID. If you omit it, SPM uses the source partition. The reviewer note is stored with the promoted content.

Reject a lesson with POST /v2/lessons/{source_id}/reject:

{
  "reviewer_note": "The evidence is too old for this workflow."
}

Rejection keeps the source ID and records the lesson as lesson:rejected with the review reason. Rejection does not delete the original evidence. Correct or replace the source when the evidence itself is wrong.

To recall only approved lessons, pass the verified topic:

{
  "query": "What is the deployment check?",
  "topics": ["lesson:verified"]
}

Recall also accepts topics, since, and until for narrower searches. Summary sources receive a small trust boost when you do not pass a topic filter.

6. Commit a finished session

Use POST /v2/sessions/commit to archive a session as one summary source plus its turns:

{
  "partition": "personal",
  "summary": "We fixed the deploy check and confirmed the staging path.",
  "turns": [
    {"role": "user", "text": "Which check failed?"},
    {"role": "assistant", "text": "The staging deployment check failed."}
  ],
  "session_id": "session-2026-12-04-001"
}

The session ID makes the operation idempotent. Repeating the same session ID does not create another summary. SPM writes one summary source and the supplied user, assistant, or tool turns as transcript sources.

The summary and each turn accept up to 12,000 characters. A commit accepts up to 200 turns. partition, summary, and session_id are required.

7. Distill pending lessons

After committing a session, use POST /v2/sessions/{summary_id}/distill:

{
  "partition": "personal",
  "max_lessons": 5
}

Distillation asks the configured extraction model first. If no model is configured or the call fails, it falls back to rules: it collects any 经验:, 教训:, or lesson: markers in the archived turns, then uses summary sentences until it reaches max_lessons. The response's proposed_by field says which path ran (llm or rules). Each result becomes a lesson:pending proposal with the session summary as evidence.

max_lessons must be between 1 and 10. Distillation proposes lessons. An owner or reviewer still decides whether to promote or reject them. If you need a better extractor, your harness can call POST /v2/lessons directly instead.

Limits and ownership

SPM does not claim that a correction resolves every conflicting source, that feedback automatically changes ranking, or that distillation finds every useful lesson. Keep the evidence linked, review the scope, and promote only claims an owner can support.