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 emem_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_b32 (ed25519 base32-nopad-lowercase)
  • signature_b32 (ed25519 over the BLAKE3 preimage digest)
  • preimage_version (which rule signed it; read it, do not assume)
  • merkle_proof (inclusion proof for fact_cids[0], when one was recorded)
  • 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.

Pass the receipt on whole. ememdev returns it verbatim and you should store and forward it the same way. From preimage_version: 2 the signature covers the inclusion proof as well as every other field it binds, which is what stops an intermediary stripping the proof in transit. The cost is that a receipt is byte-for-byte or nothing: drop merkle_proof because it looks redundant, re-key a field, or summarise the envelope, and it comes back signature_valid: false on data nobody tampered with — indistinguishable from forgery. POST /v1/verify_receipt reports reason: receipt_reshaped_after_signing instead of signature_invalid when the responder can prove that is what happened, but it never accepts the receipt.

License

Apache-2.0. Same as the upstream protocol.

Metadata

Release files for ememdev 2.4.4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for ememdev 2.4.4
File Size Uploaded Provenance Actions
ememdev-2.4.4.tar.gz 29.7 kB With provenance Details for ememdev-2.4.4.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for ememdev 2.4.4
File Interpreter ABI Platform Actions
ememdev-2.4.4-py3-none-any.whl Python 3 none any Details for ememdev-2.4.4-py3-none-any.whl

Total release size: 61.2 kB

Release files / ememdev-2.4.4.tar.gz

Download URL ememdev-2.4.4.tar.gz
Size 29.7 kB
Tags Source
SHA-256 checksum
How to use checksums
097680114314765ff6a08e73ab3d23e3ee34e388b0ebc65684b208cca923c36f
BLAKE2b-256 checksum
How to use checksums
ab3b19239b3306a2d210045bc591ac51bb1c55d6a8fc4c513c91c83506299d21
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Oct 18, 2026.

Transparency log

Release files / ememdev-2.4.4-py3-none-any.whl

Download URL ememdev-2.4.4-py3-none-any.whl
Size 31.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
2052c4edf164a2970f519acdd3fc04a76b11ea4a55e0d91bc172d5ec1dd35485
BLAKE2b-256 checksum
How to use checksums
fa1f3883f0e8057077ffce3c954a2dca549044521f3a004e58f8ca30dc85d78d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Oct 18, 2026.

Transparency log

Security for ememdev 2.4.4

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

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for ememdev-2.4.4.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 Oct 18, 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