Skip to main content

ai-memory-layer-client

Python client for the memory-layer HTTP service.

Install

pip install ai-memory-layer-client

For local development and tests:

pip install -e '.[dev]'
pytest

Quick Start

from memory_layer_client import MemoryClient, MemoryRuntimeClient, MemoryScope

client = MemoryClient(
    "http://localhost:3100",
    api_key="dev-key",
    default_scope=MemoryScope(
        tenant_id="acme",
        system_id="python-worker",
        collaboration_id="release-42",
        scope_id="run-42",
    ),
)
runtime = MemoryRuntimeClient(client)

result = runtime.run_turn(
    "Remember that deployments must stay blue-green.",
    lambda prepared: "Stored. I will keep rollout constraints in memory.",
)
print(result.prepared.prompt)

Async Client

import asyncio
from memory_layer_client import AsyncMemoryClient, AsyncMemoryRuntimeClient

async def main() -> None:
    client = AsyncMemoryClient("http://localhost:3100", api_key="dev-key")
    runtime = AsyncMemoryRuntimeClient(client)
    result = await runtime.run_turn(
        "Track migration status.",
        lambda prepared: "I will keep the migration status in memory.",
    )
    health = await client.health()
    print(result.prepared.context.token_estimate, health.active_turn_count)
    await client.aclose()

asyncio.run(main())

Scope Resolution

Each request can inherit a default scope and override it per call. This matches the multi-tenant routing model used by the HTTP server.

MemoryScope also supports collaboration_id, so Python clients can participate in shared multi-agent workspaces the same way the TypeScript server and SDK do.

Hosted Runtime And Changes

from memory_layer_client import MemoryClient, MemoryRuntimeClient

client = MemoryClient("http://localhost:3100")
runtime = MemoryRuntimeClient(client)

knowledge = client.list_knowledge(limit=20)
detail = client.inspect_knowledge(knowledge.items[0]["id"])
changes = client.poll_changes("2026-03-01T00:00:00Z", scope_level="workspace")
cross_scope = client.search_cross_scope("rollback", scope_level="workspace")
prepared = runtime.before_model_call("What changed in the shared workspace?")
print(prepared.prompt)
for event in client.stream_events(event_types=["knowledge_change"], scope_level="workspace"):
    print(event.type, event.meta)
    break

CLI

memory-layer-client --base-url http://localhost:3100 health
memory-layer-client --base-url http://localhost:3100 search "rollback checklist"
memory-layer-client --base-url http://localhost:3100 inspect-knowledge --limit 10
memory-layer-client --base-url http://localhost:3100 run-reverification --admin-key secret

Metadata

Release files for ai-memory-layer-client 5.0.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 ai-memory-layer-client 5.0.0
File Size Uploaded Provenance
ai_memory_layer_client-5.0.0.tar.gz 31.0 kB With provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for ai-memory-layer-client 5.0.0
File Interpreter ABI Platform
ai_memory_layer_client-5.0.0-py3-none-any.whl Python 3 none any Details

Total release size: 59.9 kB

Release files / ai_memory_layer_client-5.0.0.tar.gz

Download URL ai_memory_layer_client-5.0.0.tar.gz
Size 31.0 kB
Tags Source
SHA-256 checksum
How to use checksums
0249f058d35efa46b361c225205fa246d8982945692e41a5748db15bb9e4c000
BLAKE2b-256 checksum
How to use checksums
66233aca4604158b30e9bdf169b92cdfbf12bc6cb82935f5c643c89ead340a1c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

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 16, 2026.

Transparency log

Release files / ai_memory_layer_client-5.0.0-py3-none-any.whl

Download URL ai_memory_layer_client-5.0.0-py3-none-any.whl
Size 28.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
8643e690cc8b651f27d54321428d90cd5c848bf67a61779d75cc64154f107b71
BLAKE2b-256 checksum
How to use checksums
4c50b76fa4bb847a0dda290ee0d267e2d9f93dd586399bbf99ab8a6d31bdd74d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

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 16, 2026.

Transparency log

Security for ai-memory-layer-client 5.0.0

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

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for ai_memory_layer_client-5.0.0.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 Jul 16, 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.

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