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.
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.
npx agentmods add agents/doobidoo/mcp-memory-service/autogengit clone --depth 1 https://github.com/doobidoo/mcp-memory-serviceWrote 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.
[](https://agentmods.dev/agents/doobidoo/mcp-memory-service/autogen)<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>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.
| Model | Per session | Once 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 |
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.
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())
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.
- 5d ago First seen · 228 lines · 0 tokens per session scan A abf5d6af7211
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.
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…
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…
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.
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…
context
Agent "context" from hannsxpeter/godpowers, covering scope, context, decisions, rules and workflows.
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…