Skip to main content

open-memory-lab-sdk — the Python client

A client for the Open Memory Lab HTTP API: a layer generated from docs/api/openapi.yaml by a pinned openapi-python-client, and a thin hand-written wrapper over it. What the wrapper covers, the pins and the regeneration rule are decided in docs/engineering/sdks.md.

From v0.8.3 the client speaks the renamed API (ADR-0091): oml_sdk.generated.api.workspaces, the Workspace… models, create_workspace, the role reviewer, the statuses protected and frozen, and used_by with person. Code written against a v0.7 client that names a workarea type, the dreamer role or held_by does not import against it, and a v0.7 client does not work against a v0.8.3 server: upgrade the client before the server.

Python 3.11 or later. Each release attaches a wheel and an sdist to its GitHub release; install the wheel from the file, or install from a checkout of the repository:

pip install ./open_memory_lab_sdk-X.Y.Z-py3-none-any.whl  # the wheel from a release's files
uv add ./sdks/python                              # or: pip install ./sdks/python, from a checkout

The package is named open-memory-lab-sdk on PyPI and is imported as oml_sdk. It is not published there yet; until it is, install from a file or a checkout as above.

from oml_sdk import OmlClient

# One pair: url= and api_key=, else OML_URL and OML_API_KEY; one set alone is refused.
with OmlClient() as oml:
    written = oml.write("The canary stage must drain before the next one starts.")
    print(written.value.state)  # held: invisible to other keys until a reviewer's verdict
    print(written.value.claim_key)  # derived by the server when none is sent
    print(written.idempotency_key)  # the key every retry of this call sent

    for hit in oml.read(query="canary stage", include_unreviewed=True).hits:
        print(hit.memory.state, hit.memory.text)

    memory = oml.read(written.value.artifact_id)  # the key's own row, in any state
    print(memory.state, memory.text)

    # replaces must name the served tip, so a reviewer's approve promotes the version first:
    # superseding it while it is held raises SubmissionError (submission.tip_conflict).
    oml.write("Drain, then wait five minutes.", replaces=memory.artifact_id)

    for row in oml.iter_memories(own=True, limit=50):  # the key's own rows; follows next_cursor to the end
        print(row.artifact_id, row.state)

Seven verbs: write, read, workspace, events, review_next, approve and reject. write's arguments choose a submission or, with replaces, a supersession; read's choose a fetch (artifact_id), a recall (query) or the listing (neither), as oml_write and oml_read do. Every refusal raises oml_sdk.ApiError carrying the envelope of errors.md — code, message, rule, retryable, details, request_id — and status, as the subclass of the code's family; an argument outside its mode is refused the same way before anything is sent.

oml_sdk.generated is generated and never edited by hand; python3 scripts/generate_sdks.py regenerates it. The tests run against a real oml-server-lead on a throwaway database (tests/conftest.py names the environment they read). The harness mints an owner and a serving role for that database, so its admin URL names a superuser that can mint roles; under a role that cannot, the server tests skip with did not run: <role> cannot create roles:

cd sdks/python && uv run --locked pytest

Metadata

Release files for open-memory-lab-sdk 0.8.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for open-memory-lab-sdk 0.8.3
File Size Uploaded Provenance Actions
open_memory_lab_sdk-0.8.3.tar.gz 234.4 kB With provenance Details for open_memory_lab_sdk-0.8.3.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for open-memory-lab-sdk 0.8.3
File Interpreter ABI Platform Actions
open_memory_lab_sdk-0.8.3-py3-none-any.whl Python 3 none any Details for open_memory_lab_sdk-0.8.3-py3-none-any.whl

Total release size: 792.5 kB

Release files / open_memory_lab_sdk-0.8.3.tar.gz

Download URL open_memory_lab_sdk-0.8.3.tar.gz
Size 234.4 kB
Tags Source
SHA-256 checksum
How to use checksums
45fba0eaf929a930923bf873c484ee916c66623167e19231bbf99a116b96671d
BLAKE2b-256 checksum
How to use checksums
1acfe0e8161bd7e4fc02ff4d92fc6c151269ec8e27e16051f5ddb46739c7db50
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 19, 2026.

Transparency log

Release files / open_memory_lab_sdk-0.8.3-py3-none-any.whl

Download URL open_memory_lab_sdk-0.8.3-py3-none-any.whl
Size 558.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
54e8d1b715f8360ac71c26dd6e3577a1f0cbe3d5f989ac7a98de3eba4984e9cd
BLAKE2b-256 checksum
How to use checksums
432567254439bf81829067da6a555788c2a6df52b104076f8f825c9dfee45ea6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 19, 2026.

Transparency log

Security for open-memory-lab-sdk 0.8.3

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for open_memory_lab_sdk-0.8.3.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 19, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.8.3 This release

2 release files Full provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page