Skip to main content
Use the minimum Server here. No generation model or vector search is needed. Prove one thing you can check: write a project decision, find it, then put it into this request’s . Then revise it, retire it, and confirm the history is still there. The first loop: write a Memory, find it, then get a cited PreparedContext.
Field names and error codes follow the latest published official docs. This page helps you run the first loop.

Four doors, the same data

HTTP, the Python Client, MCP, and the CLI all talk to the same Server. Coverage differs. The local Server can also open its API notes:
/docs is a public API notes page. It still opens after you enable Server auth. /openapi.json and the API calls themselves need a Bearer header. Do not put a token in the URL. The full field list still follows the official docs.

Prepare the example project

The previous page installed the client extra. Create api_tour.py with this complete script.
Run it:
Each run uses a unique Scope so old tutorial data does not break duplicate, entry-count, or Revision assertions. A real project should use a stable project Scope, not a random value.

What this script proves

Writing Memory does not need a Source first

remember_memory writes long-term knowledge you already accept. source_refs is normally empty in this example. The first effective write returns:
  • an exact Memory Artifact ref;
  • a logical entry_id;
  • an exact entry_version_id;
  • current entry content and state.
Identical active content is a no-op. The response keeps the current Memory ref, but entry is null. Do not assume that every remember_memory response has response.entry.citation.

Empty search has two normal cases

The Scope has no Memory lifecycle:
The Scope has Memory but the query has no match:
Both are normal results under HTTP 200.

PreparedContext is already the final envelope

prepared.content already contains the trust marker, boundaries, and Citations. An Agent can put it into this request as untrusted historical evidence. Do not rebuild it from search hits. When status="empty":
When status="ready", the actual UTF-8 length equals content_bytes and does not exceed request max_bytes.

Reading history and changing content use different version rules

An old Citation can still read history through get_memory_entry. revise_memory_entry and retire_memory_entry accept only the current-head Citation. After a Memory change moves the Revision forward, changing with the old Citation returns HTTP 409 revision_conflict. Use the new Citation from the change response.

Retire does not delete

After retirement:
  • default listing no longer includes the entry;
  • active search and recall stop selecting it;
  • include_inactive=True still supports audit;
  • exact historical read still works.

What to read when it fails

The Python Client keeps the HTTP status, stable error code, Server message, and X-PowerContext-Request-ID.
Common statuses: After a 409, read the current value before you decide whether to retry. Do not guess the Revision.

MCP and HTTP do not cover the same surface

MCP is the tool set an Agent calls explicitly. HTTP is the full API. POST /v1/context/prepare and Python Client prepare_context are not MCP tools. A hook or framework adapter usually prepares the final PreparedContext at request time. MCP also does not reproduce each integration’s automatic recall, capture, and flush. To connect a client and see which tools you can call, open Connect with MCP.

How you know it worked

The terminal should show:
  • The first write returns an exact entry Citation.
  • A duplicate write is a no-op with entry=None.
  • Full-text search / auto finds the active entry.
  • PreparedContext is ready, and the byte count matches.
  • After revise, the old Citation still reads exactly.
  • Changing with the old Citation returns 409.
  • After retire, the default list is empty. Inactive history is still readable.
If this does not match, start with Troubleshooting.

Next step

Check the counts in Dashboard

The Dashboard does not show Memory text. Configure the Scope you just used and check total=1, active=0, and inactive=1.

Source and Memory

The next path captures a Source first, then extracts Memory. A successful capture does not mean knowledge stayed.