MemMachine

MemMachineApache-2.0活跃维护

为 AI Agent 提供可扩展、可互操作的通用记忆层,统一存储与检索状态,简化自主系统的上下文管理。

Universal memory layer for AI Agents. It provides scalable, extensible, and interoperable memory storage and retrieval to streamline AI agent state management for next-generation autonomous systems.

v0.4.0发布于 2026-10-08 00:27 UTC3,085star227fork同步于 2026-11-10 05:41 UTC

怎么上手

由 README 提炼,执行前请确认
pip install memmachine-client
硬件要求按 README 说明

README 未说明显存或 GPU 要求;支持本地、Docker 或云端部署,需运行 MemMachine Server,并使用 Neo4j 图数据库与 SQL 存储。

下载:源码 zip·GitHub Releases(安装包)本站不镜像安装包

项目说明

由 README 自动翻译提炼

给 AI Agent 加持久记忆的开源记忆层,让无状态聊天机器人跨会话记住用户

为 AI Agent 提供可扩展、可互操作的通用记忆层,统一存储与检索状态,简化自主系统的上下文管理。

核心能力

  • 用图数据库存 Episodic 对话上下文,跨会话保留
  • 用 SQL 存 Profile 长期用户事实与偏好
  • 提供 Working/Episodic/Profile 三类记忆
  • 提供 Python SDK、REST API、TypeScript SDK 与 MCP 服务
  • 兼容 LangChain、LangGraph、CrewAI、LlamaIndex 等框架

容易踩的坑

客户端只是 SDK,必须先启动 MemMachine Server 或使用云端账号;Episodic 记忆依赖 Neo4j 图数据库,需额外部署;README 示例代码中 import 语句疑似有误,实际导入需核对。

内容由模型根据 README 生成,可能不完整或不准确,以官方文档为准。看原文 README

最近发版

5 个版本v0.4.0
  1. v0.4.0最新正式版2026-10-08 · 2026-10-08 00:27 UTC

    What's Changed

  2. v0.3.92026-05-18 · 2026-05-18 02:22 UTC
    查看更新说明

    What's Changed

    New Contributors

    Full Changelog: https://github.com/MemMachine/MemMachine/compare/v0.3.8...v0.3.9

  3. v0.3.82026-05-08 · 2026-05-08 19:16 UTC
    查看更新说明

    What's Changed

    New Contributors

    Full Changelog: https://github.com/MemMachine/MemMachine/compare/v0.3.7...v0.3.8

  4. v0.3.72026-05-01 · 2026-05-01 23:50 UTC
    查看更新说明

    What's Changed

    New Contributors

    Full Changelog: https://github.com/MemMachine/MemMachine/compare/v0.3.6...v0.3.7

  5. v0.3.62026-04-24 · 2026-04-24 23:22 UTC
    查看更新说明

    What's Changed

    Full Changelog: https://github.com/MemMachine/MemMachine/compare/v0.3.5...v0.3.6

用户点评

登录用户的真实使用记录,可按版本和硬件筛选
共 0 条

    还没有人点评。第一个说出真实体验的人最有价值。

    README 原文

    未翻译

    MemMachine

    MemMachine: Long Term Memory for AI Agents

    The open-source memory layer for AI agents.

    Stop building stateless agents. Give your AI persistent memory with just 5 lines of code.

    GitHub Release Version GitHub License Ask DeepWiki Discord Docker Pulls GitHub Downloads PyPI Downloads - memmachine-client PyPI Downloads - memmachine-server

    What is MemMachine?

    MemMachine is an open-source long-term memory layer for AI agents and LLM-powered applications. It enables your AI to learn, store, and recall information from past sessions—transforming stateless chatbots into personalized, context-aware assistants.

    Key Capabilities

    • Episodic Memory: Graph-based conversational context that persists across sessions
    • Profile Memory: Long-term user facts and preferences stored in SQL
    • Working Memory: Short-term context for the current session
    • Agent Memory Persistence: Memory that survives restarts, sessions, and even model changes

    Quick Start

    Get up and running in under 5 minutes:

    Prerequisites: This code requires a running MemMachine Server. Start a server locally or create a free account on the MemMachine Platform.

    pip install memmachine-client
    
    from memmachine_client import import MemMachineClient
    
    # Initialize the client
    client = MemMachineClient(base_url="http://localhost:8080")
    
    # Get or create a project
    project = client.get_or_create_project(org_id="my_org", project_id="my_project")
    
    # Create a memory instance for a user session
    memory = project.memory(
        group_id="default",
        agent_id="travel_agent",
        user_id="alice",
        session_id="session_001"
    )
    
    # Add a memory
    memory.add("I prefer aisle seats on flights", metadata={"category": "travel"})
    # => [AddMemoryResult(uid='...')]
    
    # Search memories
    results = memory.search("What are my flight preferences?")
    print(results.content.episodic_memory.long_term_memory.episodes[0].content)
    # => "I prefer aisle seats on flights"
    

    For full installation options (Docker, self-hosted, cloud), visit the Quick Start Guide.

    Integrations

    MemMachine works seamlessly with your favorite AI frameworks:

    FrameworkDescription
    LangChainMemory provider for LangChain agents
    LangGraphStateful memory for LangGraph workflows
    CrewAIPersistent memory for CrewAI multi-agent systems
    LlamaIndexMemory integration for LlamaIndex applications
    AWS StrandsMemory for AWS Strands Agent SDK
    n8nNo-code workflow automation integration
    DifyMemory backend for Dify AI applications
    FastGPTIntegration with FastGPT platform

    MCP Server Support

    MemMachine includes a native Model Context Protocol (MCP) server for seamless integration with Claude Desktop, Cursor, and other MCP-compatible clients:

    # Stdio mode (for Claude Desktop)
    memmachine-mcp-stdio
    
    # HTTP mode (for web clients)
    memmachine-mcp-http
    

    See the MCP documentation for setup instructions.

    Who Is MemMachine For?

    • Developers building AI agents, assistants, or autonomous workflows
    • Researchers experimenting with agent architectures and cognitive models
    • Teams who need persistent, cross-session memory for their LLM applications

    Key Features

    • Multiple Memory Types: Working (short-term), Episodic (long-term conversational), and Profile (user facts) memory
    • Developer-Friendly APIs: Python SDK, RESTful API, TypeScript SDK, and MCP server interfaces
    • Flexible Storage: Graph database (Neo4j) for episodic memory, SQL for profiles
    • LLM Agnostic: Works with OpenAI, Anthropic, Bedrock, Ollama, and any LLM provider
    • Self-Hosted or Cloud: Run locally, in Docker, or use our managed service

    For more information, refer to the API Reference Guide.

    Architecture

    MemMachine Architecture

    1. Agents interact via the API Layer: Users interact with an agent, which connects to MemMachine through a RESTful API, Python SDK, or MCP Server.
    2. MemMachine manages memory: Processes interactions and stores them as Episodic Memory (conversational context) and Profile Memory (long-term user facts).
    3. Data is persisted: Episodic memory is stored in a graph database; profile memory is stored in SQL.

    Use Cases & Example Agents

    MemMachine's versatile memory architecture can be applied across any domain. Explore our examples to see memory-powered agents in action:

    AgentDescription
    CRM AgentRecalls client history and deal stages to help sales teams close faster
    Healthcare NavigatorRemembers medical history and tracks treatment progress
    Personal Finance AdvisorStores portfolio preferences and risk tolerance for personalized insights
    Writing AssistantLearns your style guide and terminology for consistent content

    Built with MemMachine

    Are you using MemMachine in your project? We'd love to feature you!

    Growing Community

    MemMachine is a growing community of builders and developers. Help us grow by clicking the ⭐ Star button above!

    Documentation

    Community & Support

    Contributing

    We welcome contributions! Please see our CONTRIBUTING.md for guidelines.

    References

    @misc{luo2025agentlightningtrainai,
      title={Agent Lightning: Train ANY AI Agents with Reinforcement Learning},
      author={Xufang Luo and Yuge Zhang and Zhiyuan He and Zilong Wang and Siyun Zhao and Dongsheng Li and Luna K. Qiu and Yuqing Yang},
      year={2025},
      eprint={2508.03680},
      archivePrefix={arXiv},
      primaryClass={cs.AI},
      url={https://arxiv.org/abs/2508.03680},
    }
    

    License

    MemMachine is released under the Apache 2.0 License.