Skip to main content

PyPI version Python versions License: MIT Research: SLoD arXiv

Mnemoverse Python SDK

Hosted AI agent memory that learns from outcomes, from Python. mnemoverse is a sync and async client for the Mnemoverse REST API: write memories, search them with a natural-language query, and report whether a recalled memory helped or misled, which re-ranks what comes back next. graph() reads the association edges around given concepts. Shared rooms (beta) use the same calls: pass a room's xroom: address as domain to write to it or read it.

The SDK does not create, invite to or join rooms. Those are tools of the Mnemoverse MCP server, which also connects Claude, Cursor and ChatGPT to the same memory.

Installation

pip install mnemoverse

Quick Start

export MNEMOVERSE_API_KEY=mk_live_YOUR_KEY

Check the key in one command. It reads the same variable the client reads (in PowerShell, write $env:MNEMOVERSE_API_KEY and type curl.exe):

curl -s -H "X-Api-Key: $MNEMOVERSE_API_KEY" https://core.mnemoverse.com/api/v1/memory/stats
The API answers (as of 2026-09-23) What it means
JSON that includes "total_atoms" The key works.
"message":"This API key is not recognized. Check that the whole key was copied, or create a new key at https://console.mnemoverse.com/dashboard/keys." The key is wrong or revoked.
"message":"This API key is the placeholder from the documentation, not a real key. Create a key at https://console.mnemoverse.com/dashboard/keys and use it instead (MNEMOVERSE_API_KEY for the MCP server, the X-Api-Key header for REST)." MNEMOVERSE_API_KEY is still set to the placeholder from the export step above.
"message":"Missing API key. Send X-Api-Key header." No key reached the API: the variable is empty or not set in this shell.
from mnemoverse import MnemoClient

client = MnemoClient()
# or pass it explicitly — an explicit api_key always wins over the environment:
# client = MnemoClient(api_key="mk_live_YOUR_KEY")

# Store a memory
result = client.write(
    "Retry with exponential backoff fixed the timeout issue",
    concepts=["retry", "backoff", "timeout"]
)

# Search by natural-language query
memories = client.read("how to handle timeouts?")

# Report outcome — the system learns what works
client.feedback(
    atom_ids=[item.atom_id for item in memories.items],
    outcome=1.0,
    query_concepts=memories.query_concepts
)

Closing the client

MnemoClient holds a background event loop and a pooled HTTP connection, so close it when a script is done. Use it as a context manager, with MnemoClient() as client:, to close automatically on exit, or call client.close() directly. A client left unclosed closes itself at interpreter exit, which is a fallback rather than something to rely on.

Async Client

from mnemoverse import AsyncMnemoClient

async with AsyncMnemoClient(api_key="mk_live_YOUR_KEY") as client:
    result = await client.write("async memory", concepts=["async"])
    memories = await client.read("what about async?")

Features

  • Circuit breaker — 5 failures → open → 30s half-open → probe
  • Retry with backoff — 3 attempts, rate-limit-aware
  • Sync + async — MnemoClient for scripts, AsyncMnemoClient for FastAPI
  • Type-safe — Pydantic models, full type hints

Methods

Method Description
write(content, concepts, domain, metadata, external_ref, supersedes, fingerprint) Store a memory
write_batch(items) Store up to 500 memories
read(query, top_k, domain, since, until, order_by, exclude_author, include_history, fingerprint) Natural-language search — "what do I know about X"
recent(domain, since, until, exclude_author, limit, cursor, include_history) Newest-first feed — "what happened lately"
graph(seeds, depth, domain, min_weight, limit) Bounded read of the concept-association graph around seeds
feedback(atom_ids, outcome) Report success/failure
stats() Memory statistics
health() API health check

Every method exists on both MnemoClient (sync) and AsyncMnemoClient (async).

Search or feed?

read() answers what do I know about X and ranks by relevance. recent() answers what happened lately and is complete within one scope by construction — nothing is skipped, which a ranked search cannot promise. Reach for recent() to resume after a break or to catch up on a shared room.

from mnemoverse import MnemoClient

client = MnemoClient(api_key="mk_live_...")

# Catch up on a shared room. Rooms are SEPARATE stores: pass the address as
# `domain`, or an unscoped feed will not cover them.
page = client.recent(domain="xroom:room_01ABC", since="2026-08-01T00:00:00Z", limit=20)
for item in page.items:
    print(item.created_at, item.content)

if page.next_cursor:
    page = client.recent(domain="xroom:room_01ABC", cursor=page.next_cursor)

Read items carry created_at and provenance (who wrote it, where from).

Documentation

License

MIT

Metadata

Release files for mnemoverse 0.4.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 mnemoverse 0.4.0
File Size Uploaded
mnemoverse-0.4.0.tar.gz 86.7 kB Details

Built distribution (wheel)

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

Total release size: 108.9 kB

Release files / mnemoverse-0.4.0.tar.gz

Download URL mnemoverse-0.4.0.tar.gz
Size 86.7 kB
Tags Source
SHA-256 checksum
How to use checksums
1ec1f591d61eabc44c2d1e581753122e45e1be8f5a0aac0350b89321bd1ac3c5
BLAKE2b-256 checksum
How to use checksums
3ea8c21dcf0536f7caa94dcd0473c4105da9f6c4a6e2e906345764e1be015ed9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14

Release files / mnemoverse-0.4.0-py3-none-any.whl

Download URL mnemoverse-0.4.0-py3-none-any.whl
Size 22.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
934e9fc48eaa67bbb6a7213240227e0ce471ce2dc7986303c0e3d9334b4d729b
BLAKE2b-256 checksum
How to use checksums
3a4f0077f82ad9e5a331f40f12ddf378c759c1df912751f156630250ed7e65c5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14

Release history Release notifications | RSS feed

0.5.0

2 release files

This release

0.4.0 This release

2 release files

0.3.2

2 release files

0.3.1

2 release files

0.3.0

2 release files

0.2.0

2 release files

0.1.0

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