Skip to main content

agent-framework-mnemoverse

Long-term memory for Microsoft Agent Framework (Python) agents, backed by Mnemoverse. The memory lives in your Mnemoverse account, so what an agent saves here is also there in Claude Code, Cursor, ChatGPT and any other tool connected to the same account.

  • MnemoverseContextProvider recalls the memories relevant to the user's latest message before every run and adds them to the run's instructions, within a time budget. If recall is slow or fails, the run goes on without memory.
  • mnemoverse_tools() gives the agent three function tools: mnemoverse_search, mnemoverse_save and mnemoverse_rate. Rating a recalled memory as helpful or misleading changes what comes back next for similar questions.

Install

pip install agent-framework-mnemoverse

Get a free API key at console.mnemoverse.com and set it as MNEMOVERSE_API_KEY, or pass api_key=. With neither, building the provider or the tools raises ValueError.

The example below uses OpenAIChatClient, which comes in a separate package (pip install agent-framework-openai) and reads OPENAI_API_KEY; any Agent Framework chat client works the same way.

Use

import asyncio

from agent_framework import Agent
from agent_framework.openai import OpenAIChatClient
from mnemoverse import AsyncMnemoClient

from agent_framework_mnemoverse import MnemoverseContextProvider, bind_user, mnemoverse_tools


async def main() -> None:
    client = AsyncMnemoClient()  # reads MNEMOVERSE_API_KEY
    agent = Agent(
        client=OpenAIChatClient(),
        instructions="You are a helpful assistant.",
        context_providers=[MnemoverseContextProvider(client)],
        tools=mnemoverse_tools(client),
    )
    session = agent.create_session()
    bind_user(session, "ana")  # this session reads and writes the domain user:ana

    print(await agent.run("Remember that I always take the window seat.", session=session))
    print(await agent.run("Which seat do I take on flights?", session=session))
    await client.close()


asyncio.run(main())

Use a client, and the provider and tools built on it, in one event loop only, as above: the SDK's connection pool belongs to the loop that first used it, so the same instance used again from a second asyncio.run() fails its first call there with "Event loop is closed", and that run's recall goes without memory.

Which memory a session uses

Every call reads and writes one Mnemoverse domain, a namespace inside your account such as user:ana or project:support.

  • One user: pass domain="user:ana" to the provider and to mnemoverse_tools(); every session uses it.
  • Several users in one app: leave domain out and bind each session with bind_user(session, user_id) (domain user:<user_id>) or bind_domain(session, domain). Take user_id from your app's signed-in user on the server, never from client input or model output. The binding is kept in session.state, so it is saved with the session. A session with no binding gets no memory: it is never served from another session's domain.
  • Both: a session bound to a domain other than a fixed domain= is refused by each component that was given that domain=: the provider then gives no memory and logs an error, and such a tool returns an error to the model, so one run never reads one user's memory and writes another's. A binding that matches domain= is fine.

A domain separates how memory is used, not who may read it: the API key can read every domain of its account. Give each app its own key, so you can revoke one without the others.

Settings

MnemoverseContextProvider argument Default What it does
top_k 8 Memories per recall
min_relevance 0.3 Lowest relevance, 0 to 1, of a recalled memory. A broad message ("what do you know about me?") scores lower than a specific one; lower this if broad messages recall nothing
recall_timeout 8.0 Seconds the run waits for recall before it goes on without it; also how long it waits for a capture. A call that has started is not cancelled: it finishes in the background, but only while the event loop keeps running. asyncio.run() cancels it when it returns, and the provider logs that it did not complete
context_prompt a heading and one line Text above the recalled memories. The default line tells the model the memories are reference data, not instructions; keep it if you write your own
capture False Save the user's own messages after each turn. Prefer the mnemoverse_save tool, which saves only what the user asks to keep

mnemoverse_tools(save=False) leaves out the save tool, and rate=False leaves out the rate tool. There is no delete tool.

Memory text is written by other people and tools too: members of a shared room, the other AI tools on the account. In the provider's memory block and in the search tool's answer each memory is therefore one line, with line breaks turned into spaces and < and > into ‹ and ›, so a memory cannot close the block or pose as another memory with an id the server never returned.

Errors

Memory never breaks a run. A timeout or a failed call is logged under the agent_framework_mnemoverse logger and the run continues without memory. A refusal (401 or 403) is logged with the server's reason, and the provider stops recall, or capture, for that domain only. Tool calls return the error to the model as a short message with the server's reason, so the agent can tell the user what happened. Long input is kept within the API limits: recall reads the last 5,000 characters of the message, capture saves the first 10,000, and the save tool refuses a memory over 10,000 characters.

Compatibility

Tested with the mnemoverse Python SDK 0.5.2 and agent-framework-core 1.26.0 on Python 3.11, 3.12 and 3.13, and with the lowest supported agent-framework-core, 1.25.0, on Python 3.11. It needs SDK 0.5.2 or later: in earlier versions a call refused with a client error (such as 401, 403 or a quota 429) while the client was probing the service after an outage could leave that client refusing every call until the process restarted.

License

MIT

Metadata

Release files for agent-framework-mnemoverse 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 agent-framework-mnemoverse 0.1.0
File Size Uploaded Provenance Actions
agent_framework_mnemoverse-0.1.0.tar.gz 19.7 kB With provenance Details for agent_framework_mnemoverse-0.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for agent-framework-mnemoverse 0.1.0
File Interpreter ABI Platform Actions
agent_framework_mnemoverse-0.1.0-py3-none-any.whl Python 3 none any Details for agent_framework_mnemoverse-0.1.0-py3-none-any.whl

Total release size: 35.2 kB

Release files / agent_framework_mnemoverse-0.1.0.tar.gz

Download URL agent_framework_mnemoverse-0.1.0.tar.gz
Size 19.7 kB
Tags Source
SHA-256 checksum
How to use checksums
a829e795a39b85dd3b12b8bd181882365bce040ee45431e56a89763c341d910e
BLAKE2b-256 checksum
How to use checksums
77a4b143cc5e46b28c036d501d7276b8ae0e4c09fb93f6734e3d365824aed287
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Nov 22, 2026.

Transparency log

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

Download URL agent_framework_mnemoverse-0.1.0-py3-none-any.whl
Size 15.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
4392a4c43bd7417a7624d13573a60f31a605f21c0631b70f176b367b9198e1e9
BLAKE2b-256 checksum
How to use checksums
e6cdaf94a0fe72369bfa3d1bc18577c819dac51fb8a0fe9dd3fc81e11ba98d4a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Nov 22, 2026.

Transparency log

Security for agent-framework-mnemoverse 0.1.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

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

Select from 2 files

Attestation for agent_framework_mnemoverse-0.1.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 Nov 22, 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.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files Full provenance

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