What AutoGen already keeps

Agents carry the message history of their conversation, and the framework offers memory interfaces you can implement. Durable, scoped storage with history and provenance is yours to provide.

Where Auld fits

Register two function tools on the assistant: recall and remember. In multi-agent teams, give memory tools to the agent that faces the user so that recall happens with that user’s viewer id.

ConcernAutoGenAuld
Current conversationYesNot needed
Facts across sessions and channelsYour codeYes
Which fact is current after a changeYour codeYes, with history
What was true on a dateYour codeYes (asOf)
Who may see a memoryYour codeIdentities and audiences
Source for each statementYour codeReturned with every memory

Implementation sequence

  1. Write async functions

    Tools in AutoGen’s AgentChat are plain typed functions.

  2. Pass them as tools

    Add them to the assistant agent’s tools list.

  3. Bind identity per session

    Create the agent per session with the user id captured in closures.

  4. Log what was recalled

    Store the recall response with the turn for debugging.

Example

memory_client.py — shared helper
import os, requests

AULD = os.environ["AULD_API_BASE"]          # e.g. https://YOUR-AULD-HOST
HEADERS = {"Authorization": f"Bearer {os.environ['AULD_API_KEY']}"}

def auld_post(path: str, body: dict) -> dict:
    r = requests.post(f"{AULD}/v1/{path}", json=body, headers=HEADERS, timeout=30)
    r.raise_for_status()
    return r.json()

def remember(text: str, user_id: str, source_id: str, occurred_at: str) -> str:
    """Store a dated record for one user. Returns the job id."""
    return auld_post("records", {"sourceId": source_id, "text": text,
                                 "occurredAt": occurred_at, "author": user_id,
                                 "visibility": f"user:{user_id}"})["jobId"]

def recall(query: str, user_id: str, max_tokens: int = 2000) -> str:
    """Current memories with sources, formatted for a prompt."""
    res = auld_post("recall", {"query": query, "viewer": user_id, "maxTokens": max_tokens})
    return "\n".join(f"- {m['text']} ({m['sources'][0]['title']}, {m['sources'][0]['occurredAt'][:10]})"
                     for m in res["memories"]) or "No relevant memory."
AutoGen wiring
from autogen_agentchat.agents import AssistantAgent
from memory_client import recall, remember

def build_assistant(model_client, user_id: str) -> AssistantAgent:
    async def recall_memory(query: str) -> str:
        """Recall durable facts about this user before answering history questions."""
        return recall(query, user_id)

    async def save_memory(fact: str, occurred_at: str) -> str:
        """Store a fact the user stated, with the ISO time it happened."""
        remember(fact, user_id, f"autogen-{user_id}-{occurred_at}", occurred_at)
        return "saved"

    return AssistantAgent("assistant", model_client=model_client,
                          tools=[recall_memory, save_memory],
                          system_message="Check memory before answering questions about prior work.")

Illustrative example · standard HTTP · check the framework’s current docs for exact signatures

Or connect the MCP server

If your AutoGen setup can use MCP tools, point it at the Auld MCP endpoint instead of writing wrappers. The model gets remember, recall, forget and memory_status. Use wrappers when you need to inject the user id yourself or post-process results; use MCP for speed of setup.

Connect an MCP client →

Custom integration recipe using standard HTTP/MCP tools

  • This recipe wires AutoGen’s own tool interface to the Auld REST API or MCP server; there is nothing Auld-specific to install.
  • Bind the viewer id from your authentication layer, not from model output.
  • Ingestion is asynchronous — poll the job before depending on a just-sent fact in tests.
  • Recall returns up to your plan’s token limit (8,000 on Pay as you go and Flex).

Frequently asked questions

Do I need AutoGen’s memory protocol?

No. Tools are simpler and make each memory call visible in the transcript. You can implement the protocol later to inject recall automatically.

How do I stop agents recalling for each other?

Only give memory tools to agents that act for a single user, and close over that user’s id.