MemMachine
MemMachine is an open-source long-term memory layer for AI agents that stores and recalls information across sessions using episodic (graph-based), profile (SQL), and working memory types. It exposes Python/TypeScript SDKs, a REST API, and an MCP server, and integrates with frameworks like LangChain, LangGraph, and CrewAI.
Apache-2.0Permissive — free to use in commercial and proprietary software, with attribution.View license →
Production readiness
4/5- Actively maintainedCommits in the last 6 months
- No known vulnerabilitiesNot yet scanned
- Clear, usable licenseApache-2.0 (permissive)
- Proven adoptionWidely used
- Has documentationDocumentation indexed
pip install memmachineOur analysis
A self-hostable memory backend for LLM-powered agents that captures conversational episodes in a graph database and user facts/preferences in SQL, so agents retain context across sessions, restarts, and model changes.
When to use MemMachine
Use it when you're building persistent, personalized AI agents (assistants, CRM bots, advisors) that need durable cross-session memory and you want a dedicated memory service rather than rolling your own retrieval logic. It fits well if you use frameworks like LangChain/LangGraph/CrewAI or want MCP access from Claude Desktop/Cursor.
When not to
Skip it for simple stateless chatbots or single-turn apps, or when a lightweight conversation buffer/vector store within your existing framework suffices. If you don't want to run extra infrastructure (Neo4j + SQL) or a separate server, a simpler embedded memory library or plain vector DB may be a better fit.
Strengths
- Multiple distinct memory types (working/episodic/profile) instead of a single undifferentiated store
- Broad integration surface: SDKs, REST, MCP server, and many agent frameworks
- LLM- and deployment-agnostic (OpenAI, Anthropic, Bedrock, Ollama; local/Docker/cloud)
- Graph-based episodic memory enables richer relational context than flat embeddings alone
Trade-offs
- Requires running a separate MemMachine server plus Neo4j and a SQL store, adding operational overhead
- Docs hint at a managed/cloud platform, suggesting potential open-core gating of some features
- Memory-extraction quality depends heavily on LLM calls, which adds latency and cost
- Relatively young project, so API stability and long-term retrieval accuracy are less proven
Maturity
An actively promoted, Apache-2.0 project with meaningful traction (~3k stars), documented SDKs, MCP support, and a managed platform offering. Still early-stage compared to established memory tools, so expect evolving APIs and a growing-but-young ecosystem.
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:
FrameworkDescriptionLangChainMemory provider for LangChain agentsLangGraphStateful memory for LangGraph workflowsCrewAIPersistent memory for CrewAI multi-agent systemsLlamaIndexMemory integration for LlamaIndex applicationsAWS StrandsMemory for AWS Strands Agent SDKn8nNo-code workflow automation integrationDifyMemory backend for Dify AI applicationsFastGPTIntegration 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:
AgentDescriptionCRM AgentRecalls client history and deal stages to help sales teams close fasterHealthcare NavigatorRemembers medical history and tracks treatment progressPersonal Finance AdvisorStores portfolio preferences and risk tolerance for personalized insightsWriting 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!
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.