Integrations

AutoGen memory integration with Menda

Give your AutoGen agents persistent long-term memory. This guide shows how to store and recall facts across sessions using Menda's HTTP API — the same layer that powers ChatGPT, Claude, and Cursor integrations.

Why AutoGen agents need external memory

AutoGen orchestrates multi-agent conversations, but every run starts blank. Without an external memory layer, your agents forget user preferences, prior decisions, and project context the moment a session ends. Menda fixes that with a shared memory store any agent can read and write.

1. Get a Menda API key

Create a free account, then generate an API key from your Menda dashboard. Free tier includes 50 memories — plenty to try the AutoGen integration end-to-end.

2. Add memory tools to your agent

Wrap Menda's /memories/search and /memories endpoints as AutoGen tools. The agent calls them like any other function.

import os, requests
from autogen import AssistantAgent, UserProxyAgent

MENDA = "https://menda.aicreatorstudio.org/api/v1"
HEADERS = {"Authorization": f"Bearer {os.environ['MENDA_API_KEY']}"}

def recall(query: str) -> str:
    r = requests.get(f"{MENDA}/memories/search",
                     params={"q": query, "limit": 5}, headers=HEADERS)
    return "\n".join(m["content"] for m in r.json().get("results", []))

def remember(content: str, kind: str = "general") -> str:
    requests.post(f"{MENDA}/memories",
                  json={"content": content, "kind": kind}, headers=HEADERS)
    return "stored"

assistant = AssistantAgent(
    name="menda_agent",
    system_message="Use recall() before answering. Use remember() to save new facts.",
    llm_config={"functions": [
        {"name": "recall", "description": "Search long-term memory",
         "parameters": {"type": "object", "properties":
           {"query": {"type": "string"}}, "required": ["query"]}},
        {"name": "remember", "description": "Store a new memory",
         "parameters": {"type": "object", "properties":
           {"content": {"type": "string"}, "kind": {"type": "string"}},
           "required": ["content"]}},
    ]},
    function_map={"recall": recall, "remember": remember},
)

3. Share memory across agents

Every AutoGen agent that uses the same Menda API key sees the same memory. Planner, researcher, and executor agents share context automatically — no prompt-stuffing needed.

Next steps

Explore the MCP server for zero-config integration with Claude and Cursor, or read the full API reference for filters, kinds, and batch operations.