Skip to content

Shared Memory for A2A Agents ​

An agent built on an A2A framework can search and store your memory without an integration written for Mnemoverse.

The Problem ​

Agents built on different frameworks do not share what they learn. One agent records a decision. A week later another agent, on a different stack, gets the same question and starts from nothing. Connecting each of them to a memory API means one custom integration per framework.

The Solution ​

Mnemoverse answers as an A2A 1.0 agent. An A2A client reads the Agent Card, sends your API key, and calls one of two skills:

  • memory-search is the default: the text of the message is the query.
  • memory-write stores the text of the message. The client selects it explicitly, with skillId in the message's metadata.

The A2A endpoint reaches the same memory as MCP clients, the REST API and the Python SDK. What an A2A agent stores, Claude or ChatGPT can recall over MCP, and the other way round.

The full contract (authentication, both skills, every error, limits, client setup) is on the A2A endpoint page. This page shows one scenario end to end.

One decision, three clients ​

The scenario below ran against the production endpoint on 2026-11-17, in a test domain, with three clients and one API key. The requests and responses are from that run, except for a reference marker the test added to the memory text, which is left out.

1. An agent stores a decision ​

The first agent uses the official Python SDK. It discovers the endpoint from the Agent Card and sends one message with skillId set to memory-write:

json
{
  "jsonrpc": "2.0",
  "id": "1",
  "method": "SendMessage",
  "params": {
    "message": {
      "messageId": "store-1",
      "role": "ROLE_USER",
      "parts": [
        { "text": "The platform team chose PostgreSQL 16 for the billing service, not MongoDB, because invoices need multi-row transactions. Decided 2026-11-17." }
      ],
      "metadata": { "skillId": "memory-write", "domain": "a2a-test" }
    }
  }
}

The answer is one message. Its text part says:

text
Stored (importance: 1.00). ID: ff2d4854-9348-4fcb-b9ee-1257b05e6684

2. Another agent asks ​

The second client sends plain JSON-RPC over HTTP, which is what an A2A client sends to this endpoint. It has no skillId, so the message is a search:

bash
curl -sS -X POST https://mcp.mnemoverse.com/a2a \
  -H 'Content-Type: application/json' \
  -H 'A2A-Version: 1.0' \
  -H "Authorization: Bearer $MNEMOVERSE_API_KEY" \
  --data '{
    "jsonrpc": "2.0",
    "id": "1",
    "method": "SendMessage",
    "params": {
      "message": {
        "messageId": "ask-1",
        "role": "ROLE_USER",
        "parts": [{ "text": "Which database did we choose for the billing service, and why?" }],
        "metadata": { "domain": "a2a-test" }
      }
    }
  }'

The answer carries the decision twice, as text for a model to read and as data for code to use:

json
{
  "jsonrpc": "2.0",
  "id": "1",
  "result": {
    "message": {
      "messageId": "048a3651-6b60-47fc-a5eb-8d470cf8a9a4",
      "contextId": "93fe18ab-8fa9-4a53-9010-2869475a3b37",
      "role": "ROLE_AGENT",
      "parts": [
        {
          "text": "1. The platform team chose PostgreSQL 16 for the billing service, not MongoDB, because invoices need multi-row transactions. Decided 2026-11-17. @\"a2a-test\" [by \"api\" · external] · 2026-11-17 18:21Z\n   id: ff2d4854-9348-4fcb-b9ee-1257b05e6684\n\n(399ms)"
        },
        {
          "data": {
            "items": [
              {
                "memory_id": "ff2d4854-9348-4fcb-b9ee-1257b05e6684",
                "content": "The platform team chose PostgreSQL 16 for the billing service, not MongoDB, because invoices need multi-row transactions. Decided 2026-11-17.",
                "domain": "a2a-test",
                "created_at": "2026-11-17T18:21:18.590684Z",
                "author": "api · external"
              }
            ]
          },
          "mediaType": "application/json"
        }
      ]
    }
  }
}

In this run, the search was sent right after the write and found the memory.

3. A person asks from their assistant ​

The third client connects over MCP, as Claude, ChatGPT and editors do. It asked the same question through the memory_read tool, in the same domain, and got back the same memory with the same id.

The decision one agent stored over A2A reached a second agent over A2A and a person's assistant over MCP.

Try it ​

With the official Python SDK (a2a-sdk, run here with 1.3.0):

bash
pip install "a2a-sdk==1.3.0" httpx
export MNEMOVERSE_API_KEY=mk_live_...
python
import asyncio
import os

import httpx
from a2a.client import ClientConfig, create_client
from a2a.helpers import get_message_text, new_text_message
from a2a.types import Role, SendMessageRequest


async def ask(client, text, **metadata):
    msg = new_text_message(text, role=Role.ROLE_USER)  # the helper defaults to the agent role
    msg.metadata.update(metadata)                     # skillId and domain go here
    async for event in client.send_message(SendMessageRequest(message=msg)):
        return get_message_text(event.message)


async def main():
    http = httpx.AsyncClient(
        headers={"Authorization": f"Bearer {os.environ['MNEMOVERSE_API_KEY']}"},
        timeout=60,  # httpx waits 5 seconds by default
    )
    # Reads /.well-known/agent-card.json on this origin and calls the endpoint the card names.
    client = await create_client("https://mcp.mnemoverse.com", client_config=ClientConfig(httpx_client=http))
    try:
        print(await ask(client, "The team chose PostgreSQL for billing.", skillId="memory-write", domain="a2a-test"))
        print(await ask(client, "Which database did we choose?", domain="a2a-test"))
    finally:
        await client.close()
        await http.aclose()


asyncio.run(main())

The first call stores a real memory in your account. It uses the a2a-test domain so the test stays apart from your other memories.

For Google ADK, the JavaScript SDK and the A2A Inspector, see Clients.

Things to know ​

  • Writing is explicit. A message stores a memory only with skillId set to memory-write in the message's own metadata. Without it the message is a search, whatever its text says.
  • A domain keeps memories apart. Set domain in the same metadata, for example project:acme, to file a memory under a project and to search only there.
  • One request, one message. There are no tasks, no streaming and no push notifications.
  • The key decides whose memory it is. Every agent that holds your key reads and writes your memory. Create one key per platform in the console, so you can revoke one without touching the others.
  • Nothing is deleted over A2A. To correct a memory, an agent stores a new one.

Common questions ​

Can an A2A agent and an MCP client share the same memory? ​

Yes, when both use the same account. The A2A endpoint and the MCP endpoint reach the same memory, so a memory an A2A agent stores can be recalled over MCP from Claude, ChatGPT or an editor, and the other way round.

Does my agent need an integration written for Mnemoverse? ​

No. An A2A client reads the Agent Card at https://mcp.mnemoverse.com/.well-known/agent-card.json, which names the endpoint, the authentication and the two skills. It then sends standard A2A 1.0 messages with your API key. Some clients need a setting or two of their own; Clients lists them.

How does an A2A agent store a memory instead of searching? ​

It sets skillId to memory-write in the message's own metadata. Without it the message is a search, whatever the text says, so a sentence like "remember that…" never turns a search into a write.

Which A2A clients work with Mnemoverse? ​

The official Python and JavaScript SDKs, Google ADK and the A2A Inspector have been run against it. The Python SDK ran on the live endpoint; the other three ran before launch, on a local copy of the server. The A2A endpoint page lists what each one needs and how to set it up.

Get Started ​

  1. Create an API key in the console.
  2. Point your A2A client at https://mcp.mnemoverse.com.
  3. Read the A2A endpoint page for the contract, the errors and the limits.