Skip to main content

AMCS-0.1

Agent Memory Canonicalization Standard (AMCS) reference implementation.

Install

python -m pip install -e ".[dev,api]"

If you only need core library features:

python -m pip install -e ".[dev]"

Adopt In 1 Hour

  1. Create a SQLite store.
  2. Append events through AMCSClient.
  3. Read the memory root.
  4. Verify the chain.
  5. Optionally encrypt payload fields before append.

Minimal Append

from amcs import AMCSClient, SQLiteEventStore

store = SQLiteEventStore("./amcs.db")
client = AMCSClient(store=store, agent_id="agent-1")

result = client.append("interaction.append", {"message": "hello"})
print(result.sequence, result.event_hash, result.memory_root)

Verify Chain

from amcs import verify_chain

result = verify_chain(store, "agent-1")
assert result.ok

External Root Checkpoint (Optional)

Create a signed root receipt for external anchoring (for example: publish to an immutable log).

from amcs import b64encode, generate_keypair

private_key, public_key = generate_keypair()
checkpoint = client.create_root_checkpoint(
    signer_private_key_b64=b64encode(private_key),
    signer_kid="registry-main",
)
assert client.verify_root_checkpoint(
    checkpoint=checkpoint,
    signer_public_key_b64=b64encode(public_key),
)

Verification & Tamper Detection

For a full end-to-end tamper detection scenario, see:

  • tests/test_sdk_append_verify.py

Encrypt Field (Optional)

from amcs import encrypt_field

enc = encrypt_field(
    b"secret",
    key,
    "kid-1",
    {"agent_id": "agent-1", "event_id": "evt-1", "event_type": "interaction.append"},
)

Canonical JSON

from amcs import canonical_bytes, canonical_dumps

event = {"b": 1, "a": 2}
text = canonical_dumps(event)  # {"a":2,"b":1}
data = canonical_bytes(event)  # UTF-8 bytes

Optional API Service

from amcs.api import create_app

app = create_app("./amcs.db")

The API dependencies are installed with:

python -m pip install -e ".[api]"

Examples

  • examples/minimal_append.py
  • examples/action_invoke.py
  • examples/encrypted_interaction.py

Manual Acceptance Test (10 Minutes)

Run the human-legible acceptance test:

./scripts/manual_acceptance_test.sh

Detailed runbook:

  • docs/manual-acceptance-test-10min.md

Metadata

Release files for iap-amcs 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 iap-amcs 0.1.0
File Size Uploaded
iap_amcs-0.1.0.tar.gz 19.2 kB Details

Built distribution (wheel)

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

Total release size: 36.2 kB

Release files / iap_amcs-0.1.0.tar.gz

Download URL iap_amcs-0.1.0.tar.gz
Size 19.2 kB
Tags Source
SHA-256 checksum
How to use checksums
2dd841445d921cd4c96ea0f248398d28133967e18dd2115a5a1f2f74394e8851
BLAKE2b-256 checksum
How to use checksums
557193df48bbb3e14c3325a4cc49cc0336b6e91f97c7e558c8cbb5384efa58f3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.11.2

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

Download URL iap_amcs-0.1.0-py3-none-any.whl
Size 17.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
0358a76fdaf28d1d123361009a678f7ce0cb67b836743bdbc908c215c3c83fbd
BLAKE2b-256 checksum
How to use checksums
810eb0e0b3fc17f74dd4aefaaa6d28062a96742f2b0a575f3edade287483efb9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.11.2

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