Skip to main content

metaworkers

Thin Python client for a self-hosted GovernedMemory REST API server.

No third-party dependencies — stdlib urllib.request only. This talks to a running server over HTTP; it doesn't touch Postgres or any governance logic directly. Run the server first (see the main repo's deploy/docker-compose.yml), then:

python -m pip install "metaworkers==0.1.0"

The stable package is published on PyPI. For local source changes, use python -m pip install -e ./sdk/python from the repository root. The package is stdlib-only and does not install Postgres, FastAPI, or a local embedding stack.

from metaworkers import GovernedMemory, Source

mem = GovernedMemory(base_url="http://localhost:8000", api_key="some-secret-key")

mem.write(
    customer_id="cust-1", agent_id="cx-1", session_id="s-1",
    content="customer prefers email contact",
    source=Source(type="user", ref="msg-1001", confidence=0.9),
    purpose=["cx_support"],
)

results = mem.retrieve(
    query="how does this customer want to be contacted?",
    agent_id="cx-1", session_id="s-1", purpose="cx_support", k=5,
)

mem.quarantine("mem-uuid")
mem.delete("mem-uuid")
events = mem.audit()

# E6 — provenance lineage + cascade purge
lineage = mem.provenance("mem-uuid")          # {memory_id, ancestors, descendants}
plan = mem.cascade_preview("mem-uuid")        # dry run: what cascade delete would remove
mem.delete("mem-uuid", cascade=True)          # hard-delete it and everything derived from it

# Listing (no query/ranking/gate — plain reads)
customers = mem.list_customers()
memories = mem.list_memories("cust-1")

Status

Covers every route the server (E7) exposes: write, retrieve, quarantine, delete (including cascade=True, backed by E6's provenance graph), cascade_preview, provenance, audit, list_customers, and list_memories.

Errors

Any non-2xx response raises metaworkers.GovernedMemoryError, with .status_code and .detail from the server's response. Connection-level failures (server unreachable, timeout) raise the underlying urllib.error.URLError instead.

Mem0 adapter

For the supported synchronous Mem0 OSS client, see docs/integrations/mem0.md. The adapter keeps Mem0 as the memory system of record and adds GovernedMemory evaluation, external-ID bindings, quarantine, and audit metadata around the existing add() and search() calls.

Release files for metaworkers 0.1.0

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

Source distribution (sdist)

Source distribution for metaworkers 0.1.0
File Size Uploaded
metaworkers-0.1.0.tar.gz 12.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for metaworkers 0.1.0
File Interpreter ABI Platform
metaworkers-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 25.2 kB

Release files / metaworkers-0.1.0.tar.gz

Download URL metaworkers-0.1.0.tar.gz
Size 12.7 kB
Tags Source
SHA-256 checksum
How to use checksums
0a21b47db464f02d6b810454cf48456afdc4dd5ac10a817f5e1b0b4d1a5a53f4
BLAKE2b-256 checksum
How to use checksums
70a40a868d34bffd16b96c8882de00200ce157fcbc1329cb82e571250dc1b68f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.14

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 Jul 24, 2026.

Transparency log

Release files / metaworkers-0.1.0-py3-none-any.whl

Download URL metaworkers-0.1.0-py3-none-any.whl
Size 12.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
8b7b0dcf8565e090e800b0ebb07066eab6740e1a9a97932c909ce88634e0b75d
BLAKE2b-256 checksum
How to use checksums
3488b08a2ebd5820d6b79ec67a44ef20bf78e89e0b7baf24fac1574436b6ce6a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.14

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 Jul 24, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files

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