autogen

autogen is an agent for coding agents from doobidoo/mcp-memory-service. It costs 0 tokens per session (1,701 once invoked), scanned A, original, Apache-2.0.

An integration guide for storing and retrieving persistent memory in AutoGen 0.4+ conversations. AutoGen is a framework for applications where multiple AI agents work together.

In plain words
What is it for?
Use it to connect AutoGen agents to mcp-memory-service, retrieve related memories, and add that context to each agent turn.
Why use it?
It lets agents reuse relevant information between turns instead of treating every conversation turn as isolated.

Agent

About the project

mcp-memory-service is a self-hosted memory backend that lets AI agents store and retrieve shared project context through REST, MCP, OAuth, a command-line interface, and a dashboard. It is intended for agent pipelines and clients such as LangGraph, CrewAI, AutoGen, Claude Desktop, and OpenCode, with support for knowledge graphs and memory consolidation. The catalogue includes skills, agents, commands, instructions, hooks, a setting, an MCP entry, and a plugin for its workflows.

doobidoo/mcp-memory-service · 1,922 stars · on GitHub

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add agents/doobidoo/mcp-memory-service/autogen
Clone the repo
git clone --depth 1 https://github.com/doobidoo/mcp-memory-service

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for autogen

README.md
[![agentmods](https://agentmods.dev/badge/agents/doobidoo/mcp-memory-service/autogen.svg)](https://agentmods.dev/agents/doobidoo/mcp-memory-service/autogen)
Your own site
<a href="https://agentmods.dev/agents/doobidoo/mcp-memory-service/autogen"><img src="https://agentmods.dev/badge/agents/doobidoo/mcp-memory-service/autogen.svg" alt="Measured on agentmods" height="20"></a>
Per session 0 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,701 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00000 $0.01701
Opus 5 $0.00000 $0.00851
Sonnet 5 $0.00000 $0.00340
Haiku 4.5 $0.00000 $0.00170

Measured 5d ago against content hash abf5d6af7211, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

autogen scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 5d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

docs/agents/autogen.md · 228 lines

How it starts

The opening of the file, as written. The whole thing — 228 lines — stays where its author put it; the contents beside it link to each section on GitHub.

AutoGen Integration Guide

Use mcp-memory-service as the persistent memory backend for AutoGen 0.4+ multi-agent conversations.

Setup

pip install mcp-memory-service autogen-agentchat httpx
MCP_ALLOW_ANONYMOUS_ACCESS=true memory server --http

Context Injection Before Each Turn

The most effective pattern for AutoGen: retrieve relevant memory and inject it into the agent's system message before each conversation turn.

import httpx
import asyncio
from autogen_agentchat.agents import AssistantAgent
from autogen_agentchat.teams import RoundRobinGroupChat
from autogen_ext.models import OpenAIChatCompletionClient

MEMORY_URL = "http://localhost:8000"


async def retrieve_context(query: str, tags: list[str] | None = None) -> str:
    """Retrieve relevant memory context for injection into system message."""
    payload = {"query": query, "limit": 5}
    if tags:
        payload["tags"] = tags

    async with httpx.AsyncClient() as client:
        response = await client.post(
            f"{MEMORY_URL}/api/memories/search",
            json=payload,
        )
        memories = response.json().get("memories", [])

    if not memories:
        return ""
    return "Relevant context from memory:\n" + "\n".join(f"- {m['content']}" for m in memories)


async def store_finding(content: str, agent_name: str, tags: list[str] | None = None):
    """Store an important finding from an agent."""
    async with httpx.AsyncClient() as client:
        await client.post(
            f"{MEMORY_URL}/api/memories",
            json={
                "content": content,
                "tags": tags or [],
                "memory_type": "observation",
            },
            headers={"X-Agent-ID": agent_name},
        )


# Build memory-aware agents
async def build_memory_agent(name: str, task_description: str) -> AssistantAgent:
    # Pre-load relevant context before conversation starts
    context = await retrieve_context(task_description)

    system_message = f"You are {name}, a helpful AI assistant."
    if context:
        system_message += f"\n\n{context}"

    return AssistantAgent(
        name=name,
        system_message=system_message,
        model_client=OpenAIChatCompletionClient(model="gpt-4o-mini"),
    )


async def main():
    task = "Analyze the performance characteristics of our REST API"

    researcher = await build_memory_agent("researcher", task)
    analyst = await build_memory_agent("analyst", task)

    team = RoundRobinGroupChat([researcher, analyst], max_turns=4)
    result = await team.run(task=task)

    # Store key findings for future conversations
    for message in result.messages:
        if len(message.content) > 100:  # Store substantive messages
            await store_finding(
                content=message.content[:500],
                agent_name=message.source,
                tags=["analysis", "api-performance"],
            )

asyncio.run(main())

Read the full file on GitHub · 228 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 5d ago First seen · 228 lines · 0 tokens per session scan A abf5d6af7211

Subscribe to this mod's changes

autogen is an agent published in the GitHub repository doobidoo/mcp-memory-service (1,922 stars, last pushed 2d ago), licensed Apache-2.0. It costs nothing until one of its globs matches a file; then it loads 1,701 tokens. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other agents, from other repositories

recall

Use to get grounded in a task, bug, feature, or decision from a PREVIOUS Claude Code, Codex, or Cursor session. Dispatch with the topic; it searches the unified history deeply (semantic + keyword + drill-down), reads the raw turns itself, and returns ONLY a tight brief — keeping the main thread's context clean. Prefer…

AbsoluteMode/session-recall · 88 tokens

context-manager

Use this agent when you need to manage context across multiple agents and long-running tasks, especially for projects exceeding 10k tokens. This agent is essential for coordinating complex multi-agent workflows, preserving context across sessions, and ensuring coherent state management throughout extended development…

czlonkowski/n8n-mcp · 0 tokens

context

You are the Context agent. Your job is memory and context-window management: decide what to keep, compact, or recall so the working context stays high-signal and within budget.

WrongStack/WrongStack · 0 tokens

portable-memory-parent-orchestrator

Top orchestrator for the portable-process-memory feature. Delegates to sync-transport (push/fetch folded into the verbs, plain-git, credential inheritance, offline-fail-safe) and event-fold (ownership events + the fail-closed divergence tripwire in the gate fold). Architect-only; coordinates portability/transport work…

seanrreid/RAD_framework · 77 tokens

context

Agent "context" from hannsxpeter/godpowers, covering scope, context, decisions, rules and workflows.

hannsxpeter/godpowers · 0 tokens

context-finder

Read-only, memory- and index-aware codebase search. Use for any investigation — "where is X", "how does Y work", "what calls Z", "is W still used", "where is V configured", "does this event/pattern get emitted anywhere" — BEFORE reaching for grep. Consults the knowledge graph, code index, and prior session memory…

futuregerald/futuregerald-claude-plugin · 111 tokens