Thin Python client for a self-hosted GovernedMemory REST API server
Project description
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.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file metaworkers-0.1.0.tar.gz.
File metadata
- Download URL: metaworkers-0.1.0.tar.gz
- Upload date:
- Size: 12.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0a21b47db464f02d6b810454cf48456afdc4dd5ac10a817f5e1b0b4d1a5a53f4
|
|
| MD5 |
757ea9cc519c649299f0c99a8a895ca6
|
|
| BLAKE2b-256 |
70a40a868d34bffd16b96c8882de00200ce157fcbc1329cb82e571250dc1b68f
|
Provenance
The following attestation bundles were made for metaworkers-0.1.0.tar.gz:
Publisher:
publish-python.yml on Metaworkers-ai/governedmemory
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
metaworkers-0.1.0.tar.gz -
Subject digest:
0a21b47db464f02d6b810454cf48456afdc4dd5ac10a817f5e1b0b4d1a5a53f4 - Sigstore transparency entry: 2232738179
- Sigstore integration time:
-
Permalink:
Metaworkers-ai/governedmemory@5186f7feb845f36b4711bf242aa414a62517c086 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/Metaworkers-ai
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-python.yml@5186f7feb845f36b4711bf242aa414a62517c086 -
Trigger Event:
push
-
Statement type:
File details
Details for the file metaworkers-0.1.0-py3-none-any.whl.
File metadata
- Download URL: metaworkers-0.1.0-py3-none-any.whl
- Upload date:
- Size: 12.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8b7b0dcf8565e090e800b0ebb07066eab6740e1a9a97932c909ce88634e0b75d
|
|
| MD5 |
35f1d4d05d0db9ca425d7ede8ca981bd
|
|
| BLAKE2b-256 |
3488b08a2ebd5820d6b79ec67a44ef20bf78e89e0b7baf24fac1574436b6ce6a
|
Provenance
The following attestation bundles were made for metaworkers-0.1.0-py3-none-any.whl:
Publisher:
publish-python.yml on Metaworkers-ai/governedmemory
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
metaworkers-0.1.0-py3-none-any.whl -
Subject digest:
8b7b0dcf8565e090e800b0ebb07066eab6740e1a9a97932c909ce88634e0b75d - Sigstore transparency entry: 2232738779
- Sigstore integration time:
-
Permalink:
Metaworkers-ai/governedmemory@5186f7feb845f36b4711bf242aa414a62517c086 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/Metaworkers-ai
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-python.yml@5186f7feb845f36b4711bf242aa414a62517c086 -
Trigger Event:
push
-
Statement type: