Skip to main content

ememdev: Python client for emem.dev

Thin, typed Python client for the emem.dev Earth memory protocol. Wraps the public REST surface in a single Client class that returns parsed JSON verbatim. Every ed25519-signed receipt and content-addressed CID is preserved for citation and offline verification. The current surface is whatever /openapi.json lists; this README does not restate a count that would go stale.

Install

pip install ememdev

The distribution and the import package are both named ememdev (so pip install ememdev, then from ememdev import Client); the shorter name emem on PyPI belongs to an unrelated project. To work from a checkout instead:

pip install -e sdks/emem-py

Requires Python 3.9+. The only runtime dependency is httpx. To sign memory writes (below), add the signing extra, which pulls blake3 and cryptography:

pip install "ememdev[signing]"

Quick start

from ememdev import Client

with Client() as em:
    cell = em.locate("Mount Fuji")["cell64"]
    facts = em.recall(cell, bands=["copdem30m.elevation_mean"])
    print(facts["facts"][0]["value"])

Async

import asyncio
from ememdev import AsyncClient

async def main() -> None:
    async with AsyncClient() as em:
        out = await em.ask("How tall is Mount Everest?")
        print(out["answer"])

asyncio.run(main())

Configuration

Env var Default Effect
EMEM_BASE_URL https://emem.dev Responder root; point at a self-hosted node
EMEM_TIMEOUT_SECS 180 HTTP timeout (matches gateway timeout)

You can also pass base_url= and timeout= directly to the constructor.

Surface coverage

Geocoder + read primitives, physics solvers, boring lat/lng shortcuts, and introspection — see the inline docstring on emem.client for the full endpoint → method mapping.

Writing a signed note

Reads are anonymous. Writes into the agent memory namespace are gated by an ed25519 attester block, and that signature is the one thing the MCP client cannot produce for you. ememdev[signing] produces it, from a persistent identity, so leaving a signed note is one command rather than a hand-rolled crypto script.

The identity is resolved once and reused every session, because the key is what owns your namespace at /memories/by_attester/<pubkey8>/.... Resolution order: EMEM_AGENT_KEY (a 64-char hex seed or a key-file path), then ~/.emem/agent_ed25519.pem (override the directory with EMEM_HOME), minted 0600 on first use if absent.

From the command line, for an agent that already speaks to emem over MCP:

ememdev whoami          # your pubkey and namespace_root

# emit just the attester block, sign nothing else (no network):
ememdev sign  --verb create --path /memories/by_attester/<you>/note.md --stdin < note.md

# or sign a create and POST it to /mcp in one step:
ememdev write --path /memories/by_attester/<you>/note.md --body-file note.md

Or in Python:

from ememdev import load_or_create_signer

signer = load_or_create_signer()             # persistent identity
path = f"{signer.namespace_root}/note.md"
body = b"a durable, signed, citeable note"
attester = signer.attester_block("create", path, body)
# POST {path, file_text, kind, attester} to /mcp memory_create.

str_replace and insert sign the whole file after the edit, and rename binds both ends of the move (signer.rename_attester_block(old, new)); see the ememdev.signing docstring for the per-verb body rule. A write into another key's namespace is refused with a 403, and sign/write refuse it locally first.

Receipts

Every non-introspection response carries a receipt block with:

  • responder_pubkey (ed25519 base32-nopad-lowercase)
  • signature_b32 (ed25519 over the canonical CBOR preimage)
  • merkle_root (BLAKE3 over the fact CIDs)
  • fact_cids[] (the BLAKE3 CIDs of every fact returned)

To cite an answer: quote receipt.fact_cids[0] and the responder pubkey. The signature can be verified offline against the public key at https://emem.dev/.well-known/emem.json; no callback to the responder is required.

License

Apache-2.0. Same as the upstream protocol.

Download files

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

Source Distribution

ememdev-1.3.0.tar.gz (24.0 kB view details)

Uploaded Source

Built Distribution

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

ememdev-1.3.0-py3-none-any.whl (25.3 kB view details)

Uploaded Python 3

File details

Details for the file ememdev-1.3.0.tar.gz.

File metadata

  • Download URL: ememdev-1.3.0.tar.gz
  • Upload date:
  • Size: 24.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.14

File hashes

Hashes for ememdev-1.3.0.tar.gz
Algorithm Hash digest
SHA256 1cd79d9c2b6d4d79093cda94073c1e359bc5d40891dd22445dc66a375d8f7886
MD5 0f9eb6786ffed2bf1445a5a001c23bdd
BLAKE2b-256 1b802740649aca55b8c4870e65616e10fce3a32ef5c9d3b55547ebdc778d8b97

See more details on using hashes here.

Provenance

The following attestation bundles were made for ememdev-1.3.0.tar.gz:

Publisher: publish-pypi.yml on Vortx-AI/emem

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file ememdev-1.3.0-py3-none-any.whl.

File metadata

  • Download URL: ememdev-1.3.0-py3-none-any.whl
  • Upload date:
  • Size: 25.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.14

File hashes

Hashes for ememdev-1.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 9fa7fb3f51ffe5dc5e302ff79a2444413c4c18160e625e8d749e2e621f6ee55c
MD5 a33e7c1ccca7b1f92118faa751a0be0e
BLAKE2b-256 b832b315a5e9a264d3df2ea2d1ad6ef42f94a4a47069b35cd2f69787be257f2a

See more details on using hashes here.

Provenance

The following attestation bundles were made for ememdev-1.3.0-py3-none-any.whl:

Publisher: publish-pypi.yml on Vortx-AI/emem

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

2.2.0

2 files

2.1.0

2 files

2.0.0

2 files

1.4.0

2 files

This release

1.3.0 This release

2 files

1.2.1

2 files

1.2.0

2 files

1.1.0

2 files

1.0.0

2 files

0.1.0

2 files

0.0.9

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