客户端只是 SDK,必须先启动 MemMachine Server 或使用云端账号;Episodic 记忆依赖 Neo4j 图数据库,需额外部署;README 示例代码中 import 语句疑似有误,实际导入需核对。
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.
pip install memmachine-clientREADME 未说明显存或 GPU 要求;支持本地、Docker 或云端部署,需运行 MemMachine Server,并使用 Neo4j 图数据库与 SQL 存储。
给 AI Agent 加持久记忆的开源记忆层,让无状态聊天机器人跨会话记住用户
为 AI Agent 提供可扩展、可互操作的通用记忆层,统一存储与检索状态,简化自主系统的上下文管理。
核心能力
- 用图数据库存 Episodic 对话上下文,跨会话保留
- 用 SQL 存 Profile 长期用户事实与偏好
- 提供 Working/Episodic/Profile 三类记忆
- 提供 Python SDK、REST API、TypeScript SDK 与 MCP 服务
- 兼容 LangChain、LangGraph、CrewAI、LlamaIndex 等框架
容易踩的坑
- v0.4.0最新正式版2026-10-08 · 2026-10-08 00:27 UTC
What's Changed
- feat: add BEAM benchmark support by @junttang in https://github.com/MemMachine/MemMachine/pull/1317
- Docs: Removing Playground References by @SarahScargall in https://github.com/MemMachine/MemMachine/pull/1413
- Chore: Automate Dependabot uv.lock repair and add scheduled CVE auto-fix workflow by @sscargal with @Copilot in https://github.com/MemMachine/MemMachine/pull/1414
- feat(language_model): add LiteLLM provider for 100+ backings by @RheagalFire in https://github.com/MemMachine/MemMachine/pull/1386
- Pin
check-uvlockfilecheckout ref tomainto avoid missing PR branch fetches by @sscargal with @Copilot in https://github.com/MemMachine/MemMachine/pull/1418 - Update Security Audit workflow to use setup-uv v8 and uv JSON output flag by @sscargal with @Copilot in https://github.com/MemMachine/MemMachine/pull/1419
- Support new vector DB implementation in semantic memory by @malatewang in https://github.com/MemMachine/MemMachine/pull/1406
- docs: regenerate openapi.json by @github-actions[bot] in https://github.com/MemMachine/MemMachine/pull/1420
- fix(ci): resolve security-audit workflow failures by @sscargal in https://github.com/MemMachine/MemMachine/pull/1421
- fix(ci): tolerate upstream uv audit OSV parse failure by @sscargal in https://github.com/MemMachine/MemMachine/pull/1423
- chore(ci): run security-audit on cron only, not per pull request by @sscargal in https://github.com/MemMachine/MemMachine/pull/1425
- Fix/security audit dependency key by @sscargal in https://github.com/MemMachine/MemMachine/pull/1428
- Update Dependabot Workflow to use package directories. by @sscargal in https://github.com/MemMachine/MemMachine/pull/1429
- Build(deps): Bump the uv-workspace group across 2 directories with 28 updates by @dependabot[bot] in https://github.com/MemMachine/MemMachine/pull/1430
- CI failing fix by @edwinyyyu in https://github.com/MemMachine/MemMachine/pull/1432
- Improve embedding format by @edwinyyyu in https://github.com/MemMachine/MemMachine/pull/1444
- OpenClaw plugin build masks unsupported SDK imports and drops episodic list results by @hsusul in https://github.com/MemMachine/MemMachine/pull/1480
- Feat: Add Milvus vector store backend by @zc277584121 in https://github.com/MemMachine/MemMachine/pull/1471
- Updating Color profile to match main website by @SarahScargall in https://github.com/MemMachine/MemMachine/pull/1495
- [Feat] add RaragQueryAgent, an optimized ChainOfQueryAgent for multi-hop retrieval by @junttang in https://github.com/MemMachine/MemMachine/pull/1477
- Fix a deadlock condition in short term memory by @malatewang in https://github.com/MemMachine/MemMachine/pull/1517
- fix: substitute the retrieval agent model in memmachine-compose.sh by @honggyukim in https://github.com/MemMachine/MemMachine/pull/1515
- Fix the ty static checks by @edwinyyyu in https://github.com/MemMachine/MemMachine/pull/1645
- Refresh the dependency lock, drop dependencies nothing needs, and move ruff to 0.16 by @edwinyyyu in https://github.com/MemMachine/MemMachine/pull/1646
- fix(config): let semantic memory be disabled with enabled: false alone by @marvinyu-memverge in https://github.com/MemMachine/MemMachine/pull/1651
- fix(vector-store): create payload indexes even when the collection exists (port of #1578 to main) by @wanghy73 in https://github.com/MemMachine/MemMachine/pull/1681
- fix(metrics): make Prometheus metrics correct with multiple workers, and wire the trackers up (port of #1523 to main) by @wanghy73 in https://github.com/MemMachine/MemMachine/pull/1678
- Make session creation to be idempotent by @malatewang in https://github.com/MemMachine/MemMachine/pull/1677
- Improve embedding fidelity by @edwinyyyu in https://github.com/MemMachine/MemMachine/pull/1449
- Add a deployment sizing calculator under tools/sizing (port of #1553 to main) by @wanghy73 in https://github.com/MemMachine/MemMachine/pull/1680
- Skip CI on draft pull requests by @edwinyyyu in ht
- v0.3.92026-05-18 · 2026-05-18 02:22 UTC
查看更新说明
What's Changed
- docs: clarify filter prefix requirements by @haosenwang1018 in https://github.com/MemMachine/MemMachine/pull/1352
- docs(common): add package readme metadata by @haosenwang1018 in https://github.com/MemMachine/MemMachine/pull/1338
- docs(client): prefer released pip install instructions by @haosenwang1018 in https://github.com/MemMachine/MemMachine/pull/1335
- fix(ts-client): include readme in published package by @haosenwang1018 in https://github.com/MemMachine/MemMachine/pull/1340
- feat(client+langgraph): raw filter strings and EpisodeType normalization by @sscargal in https://github.com/MemMachine/MemMachine/pull/1403
- Build(deps-dev): Bump ty from 0.0.32 to 0.0.35 by @dependabot[bot] in https://github.com/MemMachine/MemMachine/pull/1401
- Build(deps): Bump the npm_and_yarn group across 2 directories with 6 updates by @dependabot[bot] in https://github.com/MemMachine/MemMachine/pull/1393
- Wire EventMemory as backend for LongTermMemory by @edwinyyyu in https://github.com/MemMachine/MemMachine/pull/1395
- Add Agent skill by @malatewang in https://github.com/MemMachine/MemMachine/pull/1397
- docs: regenerate openapi.json by @github-actions[bot] in https://github.com/MemMachine/MemMachine/pull/1404
- docs: clarify filter field prefix requirements by @haosenwang1018 in https://github.com/MemMachine/MemMachine/pull/1333
- Build(deps): Bump the uv group across 1 directory with 2 updates by @dependabot[bot] in https://github.com/MemMachine/MemMachine/pull/1392
- fix: resolve ty type-check issues in packages/ by @edwinyyyu in https://github.com/MemMachine/MemMachine/pull/1405
- Build(deps): Bump pgvector from 0.4.1 to 0.4.2 by @dependabot[bot] in https://github.com/MemMachine/MemMachine/pull/1398
- Build(deps): Bump langchain-aws from 1.2.1 to 1.4.6 by @dependabot[bot] in https://github.com/MemMachine/MemMachine/pull/1400
- Build(deps): Bump uvicorn from 0.40.0 to 0.46.0 by @dependabot[bot] in https://github.com/MemMachine/MemMachine/pull/1399
New Contributors
- @haosenwang1018 made their first contribution in https://github.com/MemMachine/MemMachine/pull/1352
Full Changelog: https://github.com/MemMachine/MemMachine/compare/v0.3.8...v0.3.9
- v0.3.82026-05-08 · 2026-05-08 19:16 UTC
查看更新说明
What's Changed
- Embedded VectorStore Implementation(s) by @edwinyyyu in https://github.com/MemMachine/MemMachine/pull/1292
- docs: regenerate openapi.json by @github-actions[bot] in https://github.com/MemMachine/MemMachine/pull/1385
- Fix Installation Test CI by @edwinyyyu in https://github.com/MemMachine/MemMachine/pull/1389
- update legacy LoCoMo eval scripts to current MemMachine API by @1saac-k in https://github.com/MemMachine/MemMachine/pull/1272
- New long-term episodic memory (named EventMemory to differentiate) based on VectorStore and (new) SegmentStore by @edwinyyyu in https://github.com/MemMachine/MemMachine/pull/1205
- feat: support separate LLM models for agent, answer, and judge in ben… by @cudaMancpy in https://github.com/MemMachine/MemMachine/pull/1376
- Segmenter and Deriver should be async by @edwinyyyu in https://github.com/MemMachine/MemMachine/pull/1394
- Don't ensure ASCII in LLM-visible JSON strings by @edwinyyyu in https://github.com/MemMachine/MemMachine/pull/1378
New Contributors
- @cudaMancpy made their first contribution in https://github.com/MemMachine/MemMachine/pull/1376
Full Changelog: https://github.com/MemMachine/MemMachine/compare/v0.3.7...v0.3.8
- v0.3.72026-05-01 · 2026-05-01 23:50 UTC
查看更新说明
What's Changed
- Add strands-memmachine integration for Strands Agents by @Viranshu-30 in https://github.com/MemMachine/MemMachine/pull/1330
- fix(ts-client): Auto-select fetch adapter behind HTTPS proxies (#1269) by @alighazi288 in https://github.com/MemMachine/MemMachine/pull/1369
- Build(deps-dev): Bump ty from 0.0.24 to 0.0.32 by @dependabot[bot] in https://github.com/MemMachine/MemMachine/pull/1354
- Build(deps): Bump the npm_and_yarn group across 1 directory with 2 updates by @dependabot[bot] in https://github.com/MemMachine/MemMachine/pull/1368
- Improve vector store API again by @edwinyyyu in https://github.com/MemMachine/MemMachine/pull/1379
- Add SQL filter compilation for properties JSON by @edwinyyyu in https://github.com/MemMachine/MemMachine/pull/1291
- Implement QdrantVectorStore by @edwinyyyu in https://github.com/MemMachine/MemMachine/pull/1086
- Build(deps-dev): Bump complexipy from 5.3.0 to 5.4.0 by @dependabot[bot] in https://github.com/MemMachine/MemMachine/pull/1372
- Support batch size in embedder by @malatewang in https://github.com/MemMachine/MemMachine/pull/884
- Build(deps-dev): Bump ruff from 0.15.11 to 0.15.12 by @dependabot[bot] in https://github.com/MemMachine/MemMachine/pull/1373
- Delete session asynchronously by @malatewang in https://github.com/MemMachine/MemMachine/pull/1117
- Decrease frequency of macOS Intel CI timeout by @edwinyyyu in https://github.com/MemMachine/MemMachine/pull/1382
New Contributors
- @Viranshu-30 made their first contribution in https://github.com/MemMachine/MemMachine/pull/1330
- @alighazi288 made their first contribution in https://github.com/MemMachine/MemMachine/pull/1369
Full Changelog: https://github.com/MemMachine/MemMachine/compare/v0.3.6...v0.3.7
- v0.3.62026-04-24 · 2026-04-24 23:22 UTC
查看更新说明
What's Changed
- docs: regenerate openapi.json by @github-actions[bot] in https://github.com/MemMachine/MemMachine/pull/1351
- Build(deps): Bump the npm_and_yarn group across 2 directories with 5 updates by @dependabot[bot] in https://github.com/MemMachine/MemMachine/pull/1350
- Build(deps): Bump the npm_and_yarn group across 1 directory with 3 updates by @dependabot[bot] in https://github.com/MemMachine/MemMachine/pull/1353
- Build(deps-dev): Bump ruff from 0.15.10 to 0.15.11 by @dependabot[bot] in https://github.com/MemMachine/MemMachine/pull/1355
- Build(deps-dev): Bump complexipy from 5.2.0 to 5.3.0 by @dependabot[bot] in https://github.com/MemMachine/MemMachine/pull/1356
- Potential fix for code scanning alert no. 46: Prototype-polluting assignment by @sscargal in https://github.com/MemMachine/MemMachine/pull/1357
- add retry logic for LLM judge and semantic memory consolidation by @sscargal in https://github.com/MemMachine/MemMachine/pull/1361
- feat: add
deleteRUN_TYPE to retrieval-agent benchmarks by @sscargal in https://github.com/MemMachine/MemMachine/pull/1363 - fix(server): preserve original LLM error in ExternalServiceAPIError by @sscargal in https://github.com/MemMachine/MemMachine/pull/1362
- chore: add workflow to auto-close stale issues and PRs by @sscargal in https://github.com/MemMachine/MemMachine/pull/1358
- security: bump vulnerable dependencies (Dependabot batch) by @sscargal in https://github.com/MemMachine/MemMachine/pull/1366
- Increase complete integration test timeout by @edwinyyyu in https://github.com/MemMachine/MemMachine/pull/1367
- fix: use correct Neo4j config field name in sample configs by @sscargal in https://github.com/MemMachine/MemMachine/pull/1360
Full Changelog: https://github.com/MemMachine/MemMachine/compare/v0.3.5...v0.3.6
用户点评
登录用户的真实使用记录,可按版本和硬件筛选还没有人点评。第一个说出真实体验的人最有价值。
MemMachine

The open-source memory layer for AI agents.
Stop building stateless agents. Give your AI persistent memory with just 5 lines of code.
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:
| Framework | Description |
|---|---|
| LangChain | Memory provider for LangChain agents |
| LangGraph | Stateful memory for LangGraph workflows |
| CrewAI | Persistent memory for CrewAI multi-agent systems |
| LlamaIndex | Memory integration for LlamaIndex applications |
| AWS Strands | Memory for AWS Strands Agent SDK |
| n8n | No-code workflow automation integration |
| Dify | Memory backend for Dify AI applications |
| FastGPT | Integration 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

- Agents interact via the API Layer: Users interact with an agent, which connects to MemMachine through a RESTful API, Python SDK, or MCP Server.
- MemMachine manages memory: Processes interactions and stores them as Episodic Memory (conversational context) and Profile Memory (long-term user facts).
- 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:
| Agent | Description |
|---|---|
| CRM Agent | Recalls client history and deal stages to help sales teams close faster |
| Healthcare Navigator | Remembers medical history and tracks treatment progress |
| Personal Finance Advisor | Stores portfolio preferences and risk tolerance for personalized insights |
| Writing Assistant | Learns your style guide and terminology for consistent content |
Built with MemMachine
Are you using MemMachine in your project? We'd love to feature you!
- Share your project in GitHub Discussions → Showcase
- Drop a message in our Discord #showcase channel
Growing Community
MemMachine is a growing community of builders and developers. Help us grow by clicking the ⭐ Star button above!
Documentation
- Main Website – Learn about MemMachine
- Docs & API Reference – Full documentation
- Quick Start Guide – Get started in minutes
Community & Support
- Discord: Join our community for support, updates, and discussions: https://discord.gg/usydANvKqD
- Issues & Feature Requests: Use GitHub Issues
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.