Skip to main content

goodmemory-client

Official Python client for the GoodMemory HTTP bridge. Stdlib only — no third-party dependencies. Wire contract: phase-39.http-memory.v1.

Deploy the bridge (Node/Bun sidecar or Docker; see the bridge guide), then:

pip install goodmemory-client
from goodmemory_client import GoodMemoryClient, Scope

client = GoodMemoryClient(
    "http://127.0.0.1:8739",
    token="your-bridge-token",
    scope=Scope(user_id="u-1", workspace_id="workspace-a", session_id="s-1"),
)

client.wait_until_ready()

# Before your model call
recall = client.recall_context("What should the assistant know before replying?")
print(recall.context_text)
# routing shows silent strategy downgrades (e.g. hybrid -> rules-only when no
# embedding provider is configured on the bridge)
print(recall.routing.resolved_strategy, recall.routing.fallback_reason)

# After the response
client.remember([
    {"role": "user", "content": "Remember that the rollout is blocked on QA signoff."},
])

# Corrections, audit, deletion
client.feedback("Keep summaries short.", idempotency_key="fb-1")
export = client.export()
client.revise(memory_id="<memory-id>", content="corrected fact",
              reason="user correction", idempotency_key="rev-1")
client.forget("<memory-id>")

Notes:

  • Caller headers (x-goodmemory-*) are derived from the Scope you pass — the bridge requires the header caller and body scope to match. Per-call scope= overrides re-derive them.
  • operations defaults to "*"; pass an explicit list (e.g. ["recall-context", "remember"]) for least privilege — export, forget, and revise are sensitive operations the bridge authorizes individually.
  • Idempotency keys mirror the server: always required for feedback and revise, required for remember(mode="async") only.
  • Bridge errors raise GoodMemoryBridgeError with .code, .status, and .body; connection failures retry, HTTP-status errors never do (a 409 idempotency_conflict surfaces immediately).

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

goodmemory_client-0.1.0.tar.gz (8.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

goodmemory_client-0.1.0-py3-none-any.whl (7.0 kB view details)

Uploaded Python 3

File details

Details for the file goodmemory_client-0.1.0.tar.gz.

File metadata

  • Download URL: goodmemory_client-0.1.0.tar.gz
  • Upload date:
  • Size: 8.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.2

File hashes

Hashes for goodmemory_client-0.1.0.tar.gz
Algorithm Hash digest
SHA256 e6a87defb91b050bcedcb67eaf9f1e1ed96a812ff4670635c5bee74eb4a8345b
MD5 593d5ec2a9423651913d2fa14a3c4665
BLAKE2b-256 18be79ac3a57f9ccc66950e7736b8f9f01770fc2d360f25f4f99c27207c82975

See more details on using hashes here.

File details

Details for the file goodmemory_client-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for goodmemory_client-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 7f4560d867d850bea08797d5dde6b821386c230093bb0c843cb3bd0f6cf43b95
MD5 1772d8dd235bfb2becea6b6b4e9d400a
BLAKE2b-256 2daf63409e49d8b6d3957d8f844c7186fc59b6ec1489fea384174adcc2227853

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 files

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page