Skip to content

feat: Add MnemoPay tools — agent memory + wallet#7514

Open
t49qnsx7qt-kpanks wants to merge 1 commit intomicrosoft:mainfrom
t49qnsx7qt-kpanks:feat/mnemopay-tools
Open

feat: Add MnemoPay tools — agent memory + wallet#7514
t49qnsx7qt-kpanks wants to merge 1 commit intomicrosoft:mainfrom
t49qnsx7qt-kpanks:feat/mnemopay-tools

Conversation

@t49qnsx7qt-kpanks
Copy link
Copy Markdown

Summary

  • 12 new BaseTool subclasses under autogen_ext.tools.mnemopay that give AutoGen agents persistent memory and a micropayment wallet via the MnemoPay MCP server
  • Memory tools: remember, recall, forget, reinforce, consolidate — store, search, boost, and prune agent knowledge across sessions
  • Wallet tools: charge, settle, refund — escrow-based micropayments with reputation tracking
  • Info tools: balance, profile, history, logs — agent stats, tx history, and audit trail

Motivation

AI agents today are stateless and cannot transact. MnemoPay solves both problems through a single MCP server (npx -y @mnemopay/sdk):

  1. Memory — Agents remember important context across sessions with importance scoring, semantic search, and automatic decay/consolidation
  2. Wallet — Agents can charge for work via escrow, building on-chain reputation (settle = +0.01, refund = -0.05)

The mnemopay-autogen PyPI package (v1.0.0) already exists as a standalone integration. This PR brings the tools directly into autogen-ext so AutoGen users can access them natively.

Architecture

  • Each tool is a BaseTool[ArgsT, ReturnT] subclass with typed Pydantic arg/return models
  • A _MnemoPayMixin provides shared MCP client logic using AutoGen's existing create_mcp_server_session infrastructure
  • mnemopay_tools(config) factory returns all 12 tools ready to pass to AssistantAgent
  • New [mnemopay] optional dependency in pyproject.toml (depends on mcp>=1.11.0)

Usage

from autogen_ext.tools.mnemopay import mnemopay_tools, MnemoPayConfig
from autogen_agentchat.agents import AssistantAgent

config = MnemoPayConfig(agent_id="research-bot")
agent = AssistantAgent(
    name="researcher",
    tools=mnemopay_tools(config),
    model_client=model_client,
)

Or use individual tools:

from autogen_ext.tools.mnemopay import RememberTool, RecallTool, ChargeTool

agent = AssistantAgent(
    name="billing_agent",
    tools=[RememberTool(config), RecallTool(config), ChargeTool(config)],
    model_client=model_client,
)

Files changed

File Description
autogen_ext/tools/mnemopay/__init__.py Public API, exports, module docstring
autogen_ext/tools/mnemopay/_config.py MnemoPayConfig (agent_id, mode, server_url, npx_command)
autogen_ext/tools/mnemopay/_tools.py 12 BaseTool subclasses + mnemopay_tools() factory
autogen-ext/pyproject.toml [mnemopay] optional dependency

Test plan

  • Verify syntax: python -c "from autogen_ext.tools.mnemopay import mnemopay_tools" imports cleanly
  • Verify tool count: len(mnemopay_tools()) == 12
  • Verify each tool has correct name, description, and schema properties
  • Integration test: RememberToolRecallTool round-trip with live MCP server
  • Integration test: ChargeToolSettleTool round-trip with live MCP server

Related

🤖 Generated with Claude Code

Add 12 BaseTool subclasses under autogen_ext.tools.mnemopay that give
AutoGen agents persistent memory and a micropayment wallet via the
MnemoPay MCP server (npx -y @mnemopay/sdk).

Memory tools: remember, recall, forget, reinforce, consolidate
Wallet tools: charge, settle, refund
Info tools: balance, profile, history, logs

Each tool follows AutoGen's BaseTool[ArgsT, ReturnT] pattern with
Pydantic arg/return models and communicates over stdio using the
existing autogen_ext.tools.mcp session infrastructure.

Includes mnemopay_tools() factory and [mnemopay] optional dependency.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@t49qnsx7qt-kpanks
Copy link
Copy Markdown
Author

i agree to CLA

@t49qnsx7qt-kpanks
Copy link
Copy Markdown
Author

No [company=...] part needed

@t49qnsx7qt-kpanks
Copy link
Copy Markdown
Author

@microsoft-github-policy-service agree

@t49qnsx7qt-kpanks
Copy link
Copy Markdown
Author

Hey team — just checking in on this. Happy to address any feedback or make changes if needed. Let me know if there's anything blocking review.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant