Catalog PyPI
Back to packageRELEASE DETAILS

0.0.12

PyPI

agentrun-mem0ai

Long-term memory for AI Agents with Aliyun TableStore support

Published26 Jan 2026
Direct dependencies52
Transitive dependenciesNot calculated

README

Version 0.0.12 documentation

Mem0 - The Memory Layer for Personalized AI

mem0ai%2Fmem0 | Trendshift

Learn more · Join Discord · Demo · OpenMemory

Mem0 Discord Mem0 PyPI - Downloads GitHub commit activity Package version Npm package Y Combinator S24

📄 Building Production-Ready AI Agents with Scalable Long-Term Memory →

⚡ +26% Accuracy vs. OpenAI Memory • 🚀 91% Faster • 💰 90% Fewer Tokens

🎉 mem0ai v1.0.0 is now available! This major release includes API modernization, improved vector store support, and enhanced GCP integration. See migration guide →

🔥 Research Highlights

  • +26% Accuracy over OpenAI Memory on the LOCOMO benchmark
  • 91% Faster Responses than full-context, ensuring low-latency at scale
  • 90% Lower Token Usage than full-context, cutting costs without compromise
  • Read the full paper

Introduction

Mem0 ("mem-zero") enhances AI assistants and agents with an intelligent memory layer, enabling personalized AI interactions. It remembers user preferences, adapts to individual needs, and continuously learns over time—ideal for customer support chatbots, AI assistants, and autonomous systems.

Key Features & Use Cases

Core Capabilities:

  • Multi-Level Memory: Seamlessly retains User, Session, and Agent state with adaptive personalization
  • Developer-Friendly: Intuitive API, cross-platform SDKs, and a fully managed service option

Applications:

  • AI Assistants: Consistent, context-rich conversations
  • Customer Support: Recall past tickets and user history for tailored help
  • Healthcare: Track patient preferences and history for personalized care
  • Productivity & Gaming: Adaptive workflows and environments based on user behavior

🚀 Quickstart Guide

Choose between our hosted platform or self-hosted package:

Hosted Platform

Get up and running in minutes with automatic updates, analytics, and enterprise security.

  1. Sign up on Mem0 Platform
  2. Embed the memory layer via SDK or API keys

Self-Hosted (Open Source)

✨ agentrun-mem0ai:基于 mem0ai 的扩展版本,增加了阿里云 TableStore (OTS) 支持。

重要:使用独立的模块名 agentrun_mem0,与官方 mem0 包无冲突,可以共存!

Install the sdk via pip:

# 使用扩展版本(支持阿里云 OTS)
pip install agentrun-mem0ai

官方版本:

# 官方 Python SDK
pip install mem0ai

# 官方 npm SDK
npm install mem0ai

Basic Usage

Mem0 requires an LLM to function, with `gpt-4.1-nano-2025-04-14 from OpenAI as the default. However, it supports a variety of LLMs; for details, refer to our Supported LLMs documentation.

First step is to instantiate the memory:

from openai import OpenAI
from agentrun_mem0 import Memory

openai_client = OpenAI()
memory = Memory()

def chat_with_memories(message: str, user_id: str = "default_user") -> str:
    # Retrieve relevant memories
    relevant_memories = memory.search(query=message, user_id=user_id, limit=3)
    memories_str = "\n".join(f"- {entry['memory']}" for entry in relevant_memories["results"])

    # Generate Assistant response
    system_prompt = f"You are a helpful AI. Answer the question based on query and memories.\nUser Memories:\n{memories_str}"
    messages = [{"role": "system", "content": system_prompt}, {"role": "user", "content": message}]
    response = openai_client.chat.completions.create(model="gpt-4.1-nano-2025-04-14", messages=messages)
    assistant_response = response.choices[0].message.content

    # Create new memories from the conversation
    messages.append({"role": "assistant", "content": assistant_response})
    memory.add(messages, user_id=user_id)

    return assistant_response

def main():
    print("Chat with AI (type 'exit' to quit)")
    while True:
        user_input = input("You: ").strip()
        if user_input.lower() == 'exit':
            print("Goodbye!")
            break
        print(f"AI: {chat_with_memories(user_input)}")

if __name__ == "__main__":
    main()

For detailed integration steps, see the Quickstart and API Reference.

🔗 Integrations & Demos

  • ChatGPT with Memory: Personalized chat powered by Mem0 (Live Demo)
  • Browser Extension: Store memories across ChatGPT, Perplexity, and Claude (Chrome Extension)
  • Langgraph Support: Build a customer bot with Langgraph + Mem0 (Guide)
  • CrewAI Integration: Tailor CrewAI outputs with Mem0 (Example)

📚 Documentation & Support

Citation

We now have a paper you can cite:

@article{mem0,
  title={Mem0: Building Production-Ready AI Agents with Scalable Long-Term Memory},
  author={Chhikara, Prateek and Khant, Dev and Aryan, Saket and Singh, Taranjeet and Yadav, Deshraj},
  journal={arXiv preprint arXiv:2504.19413},
  year={2025}
}

📦 PyPI 自动发布

使用自动化脚本快速发布到 PyPI:

1. 安装发布工具

pip install --upgrade build twine

2. 运行发布脚本

./publish.sh

脚本会自动完成以下步骤:

  • 清理旧的构建文件
  • 构建新的发行包
  • 检查包的完整性
  • 可选:先上传到测试环境验证
  • 上传到正式 PyPI

发布 PyPI 所需 Token 可查看文件 .pypirc

⚖️ License

Apache 2.0 — see the LICENSE file for details.

Downloads & popularity

Awaiting observations

No metric observations yet

Download counts and popularity will appear here as the collector receives them.

Declared dependencies 56

Native requirements
52 direct targetsNot calculated transitive count
Package / targetRequirementRelationship
mysql-connector-python
Environment
{
  "extras": "",
  "marker": null,
  "requires_python": "<4.0,>=3.9",
  "evaluation": "NOT_EVALUATED"
}
mysql-connector-python==9.3.0runtime
openai
Environment
{
  "extras": "",
  "marker": null,
  "requires_python": "<4.0,>=3.9",
  "evaluation": "NOT_EVALUATED"
}
openai>=1.90.0runtime
posthog
Environment
{
  "extras": "",
  "marker": null,
  "requires_python": "<4.0,>=3.9",
  "evaluation": "NOT_EVALUATED"
}
posthog>=3.5.0runtime
protobuf
Environment
{
  "extras": "",
  "marker": null,
  "requires_python": "<4.0,>=3.9",
  "evaluation": "NOT_EVALUATED"
}
protobuf<6.0.0,>=5.29.0runtime
pydantic
Environment
{
  "extras": "",
  "marker": null,
  "requires_python": "<4.0,>=3.9",
  "evaluation": "NOT_EVALUATED"
}
pydantic>=2.7.3runtime
pytz
Environment
{
  "extras": "",
  "marker": null,
  "requires_python": "<4.0,>=3.9",
  "evaluation": "NOT_EVALUATED"
}
pytz>=2024.1runtime
qdrant-client
Environment
{
  "extras": "",
  "marker": null,
  "requires_python": "<4.0,>=3.9",
  "evaluation": "NOT_EVALUATED"
}
qdrant-client>=1.9.1runtime
sqlalchemy
Environment
{
  "extras": "",
  "marker": null,
  "requires_python": "<4.0,>=3.9",
  "evaluation": "NOT_EVALUATED"
}
sqlalchemy>=2.0.31runtime
tablestore-for-agent-memory
Environment
{
  "extras": "",
  "marker": null,
  "requires_python": "<4.0,>=3.9",
  "evaluation": "NOT_EVALUATED"
}
tablestore-for-agent-memory>=1.0.1runtime
isort
Environment
{
  "extras": "",
  "marker": "extra == \"dev\"",
  "requires_python": "<4.0,>=3.9",
  "evaluation": "NOT_EVALUATED"
}
isort>=5.13.2; extra == "dev"runtime
pytest
Environment
{
  "extras": "",
  "marker": "extra == \"dev\"",
  "requires_python": "<4.0,>=3.9",
  "evaluation": "NOT_EVALUATED"
}
pytest>=8.2.2; extra == "dev"runtime
ruff
Environment
{
  "extras": "",
  "marker": "extra == \"dev\"",
  "requires_python": "<4.0,>=3.9",
  "evaluation": "NOT_EVALUATED"
}
ruff>=0.6.5; extra == "dev"runtime
boto3
Environment
{
  "extras": "",
  "marker": "extra == \"extras\"",
  "requires_python": "<4.0,>=3.9",
  "evaluation": "NOT_EVALUATED"
}
boto3>=1.34.0; extra == "extras"runtime
elasticsearch
Environment
{
  "extras": "",
  "marker": "extra == \"extras\"",
  "requires_python": "<4.0,>=3.9",
  "evaluation": "NOT_EVALUATED"
}
elasticsearch<9.0.0,>=8.0.0; extra == "extras"runtime
langchain-community
Environment
{
  "extras": "",
  "marker": "extra == \"extras\"",
  "requires_python": "<4.0,>=3.9",
  "evaluation": "NOT_EVALUATED"
}
langchain-community>=0.0.0; extra == "extras"runtime
opensearch-py
Environment
{
  "extras": "",
  "marker": "extra == \"extras\"",
  "requires_python": "<4.0,>=3.9",
  "evaluation": "NOT_EVALUATED"
}
opensearch-py>=2.0.0; extra == "extras"runtime
sentence-transformers
Environment
{
  "extras": "",
  "marker": "extra == \"extras\"",
  "requires_python": "<4.0,>=3.9",
  "evaluation": "NOT_EVALUATED"
}
sentence-transformers>=5.0.0; extra == "extras"runtime
kuzu
Environment
{
  "extras": "",
  "marker": "extra == \"graph\"",
  "requires_python": "<4.0,>=3.9",
  "evaluation": "NOT_EVALUATED"
}
kuzu>=0.11.0; extra == "graph"runtime
langchain-aws
Environment
{
  "extras": "",
  "marker": "extra == \"graph\"",
  "requires_python": "<4.0,>=3.9",
  "evaluation": "NOT_EVALUATED"
}
langchain-aws>=0.2.23; extra == "graph"runtime
langchain-memgraph
Environment
{
  "extras": "",
  "marker": "extra == \"graph\"",
  "requires_python": "<4.0,>=3.9",
  "evaluation": "NOT_EVALUATED"
}
langchain-memgraph>=0.1.0; extra == "graph"runtime
langchain-neo4j
Environment
{
  "extras": "",
  "marker": "extra == \"graph\"",
  "requires_python": "<4.0,>=3.9",
  "evaluation": "NOT_EVALUATED"
}
langchain-neo4j>=0.4.0; extra == "graph"runtime
neo4j
Environment
{
  "extras": "",
  "marker": "extra == \"graph\"",
  "requires_python": "<4.0,>=3.9",
  "evaluation": "NOT_EVALUATED"
}
neo4j>=5.23.1; extra == "graph"runtime
rank-bm25
Environment
{
  "extras": "",
  "marker": "extra == \"graph\"",
  "requires_python": "<4.0,>=3.9",
  "evaluation": "NOT_EVALUATED"
}
rank-bm25>=0.2.2; extra == "graph"runtime
google-genai
Environment
{
  "extras": "",
  "marker": "extra == \"llms\"",
  "requires_python": "<4.0,>=3.9",
  "evaluation": "NOT_EVALUATED"
}
google-genai>=1.0.0; extra == "llms"runtime
google-generativeai
Environment
{
  "extras": "",
  "marker": "extra == \"llms\"",
  "requires_python": "<4.0,>=3.9",
  "evaluation": "NOT_EVALUATED"
}
google-generativeai>=0.3.0; extra == "llms"runtime
groq
Environment
{
  "extras": "",
  "marker": "extra == \"llms\"",
  "requires_python": "<4.0,>=3.9",
  "evaluation": "NOT_EVALUATED"
}
groq>=0.3.0; extra == "llms"runtime
litellm
Environment
{
  "extras": "",
  "marker": "extra == \"llms\"",
  "requires_python": "<4.0,>=3.9",
  "evaluation": "NOT_EVALUATED"
}
litellm>=1.74.0; extra == "llms"runtime
ollama
Environment
{
  "extras": "",
  "marker": "extra == \"llms\"",
  "requires_python": "<4.0,>=3.9",
  "evaluation": "NOT_EVALUATED"
}
ollama>=0.1.0; extra == "llms"runtime
openai
Environment
{
  "extras": "",
  "marker": "extra == \"llms\"",
  "requires_python": "<4.0,>=3.9",
  "evaluation": "NOT_EVALUATED"
}
openai>=1.90.0; extra == "llms"runtime
together
Environment
{
  "extras": "",
  "marker": "extra == \"llms\"",
  "requires_python": "<4.0,>=3.9",
  "evaluation": "NOT_EVALUATED"
}
together>=0.2.10; extra == "llms"runtime
vertexai
Environment
{
  "extras": "",
  "marker": "extra == \"llms\"",
  "requires_python": "<4.0,>=3.9",
  "evaluation": "NOT_EVALUATED"
}
vertexai>=0.1.0; extra == "llms"runtime
pytest-asyncio
Environment
{
  "extras": "",
  "marker": "extra == \"test\"",
  "requires_python": "<4.0,>=3.9",
  "evaluation": "NOT_EVALUATED"
}
pytest-asyncio>=0.23.7; extra == "test"runtime
pytest-mock
Environment
{
  "extras": "",
  "marker": "extra == \"test\"",
  "requires_python": "<4.0,>=3.9",
  "evaluation": "NOT_EVALUATED"
}
pytest-mock>=3.14.0; extra == "test"runtime
pytest
Environment
{
  "extras": "",
  "marker": "extra == \"test\"",
  "requires_python": "<4.0,>=3.9",
  "evaluation": "NOT_EVALUATED"
}
pytest>=8.2.2; extra == "test"runtime
azure-identity
Environment
{
  "extras": "",
  "marker": "extra == \"vector-stores\"",
  "requires_python": "<4.0,>=3.9",
  "evaluation": "NOT_EVALUATED"
}
azure-identity>=1.24.0; extra == "vector-stores"runtime
azure-search-documents
Environment
{
  "extras": "",
  "marker": "extra == \"vector-stores\"",
  "requires_python": "<4.0,>=3.9",
  "evaluation": "NOT_EVALUATED"
}
azure-search-documents>=11.4.0b8; extra == "vector-stores"runtime
chromadb
Environment
{
  "extras": "",
  "marker": "extra == \"vector-stores\"",
  "requires_python": "<4.0,>=3.9",
  "evaluation": "NOT_EVALUATED"
}
chromadb>=0.4.24; extra == "vector-stores"runtime
databricks-sdk
Environment
{
  "extras": "",
  "marker": "extra == \"vector-stores\"",
  "requires_python": "<4.0,>=3.9",
  "evaluation": "NOT_EVALUATED"
}
databricks-sdk>=0.63.0; extra == "vector-stores"runtime
dbutils
Environment
{
  "extras": "",
  "marker": "extra == \"vector-stores\"",
  "requires_python": "<4.0,>=3.9",
  "evaluation": "NOT_EVALUATED"
}
dbutils>=3.0.3; extra == "vector-stores"runtime
elasticsearch
Environment
{
  "extras": "",
  "marker": "extra == \"vector-stores\"",
  "requires_python": "<4.0,>=3.9",
  "evaluation": "NOT_EVALUATED"
}
elasticsearch<9.0.0,>=8.0.0; extra == "vector-stores"runtime
faiss-cpu
Environment
{
  "extras": "",
  "marker": "extra == \"vector-stores\"",
  "requires_python": "<4.0,>=3.9",
  "evaluation": "NOT_EVALUATED"
}
faiss-cpu>=1.7.4; extra == "vector-stores"runtime
langchain-aws
Environment
{
  "extras": "",
  "marker": "extra == \"vector-stores\"",
  "requires_python": "<4.0,>=3.9",
  "evaluation": "NOT_EVALUATED"
}
langchain-aws>=0.2.23; extra == "vector-stores"runtime
pinecone-text
Environment
{
  "extras": "",
  "marker": "extra == \"vector-stores\"",
  "requires_python": "<4.0,>=3.9",
  "evaluation": "NOT_EVALUATED"
}
pinecone-text>=0.10.0; extra == "vector-stores"runtime
pinecone
Environment
{
  "extras": "",
  "marker": "extra == \"vector-stores\"",
  "requires_python": "<4.0,>=3.9",
  "evaluation": "NOT_EVALUATED"
}
pinecone<=7.3.0; extra == "vector-stores"runtime
psycopg-pool
Environment
{
  "extras": "",
  "marker": "extra == \"vector-stores\"",
  "requires_python": "<4.0,>=3.9",
  "evaluation": "NOT_EVALUATED"
}
psycopg-pool<4.0.0,>=3.2.6; extra == "vector-stores"runtime
psycopg
Environment
{
  "extras": "",
  "marker": "extra == \"vector-stores\"",
  "requires_python": "<4.0,>=3.9",
  "evaluation": "NOT_EVALUATED"
}
psycopg>=3.2.8; extra == "vector-stores"runtime
pymilvus
Environment
{
  "extras": "",
  "marker": "extra == \"vector-stores\"",
  "requires_python": "<4.0,>=3.9",
  "evaluation": "NOT_EVALUATED"
}
pymilvus<2.6.0,>=2.4.0; extra == "vector-stores"runtime
pymochow
Environment
{
  "extras": "",
  "marker": "extra == \"vector-stores\"",
  "requires_python": "<4.0,>=3.9",
  "evaluation": "NOT_EVALUATED"
}
pymochow>=2.2.9; extra == "vector-stores"runtime
pymongo
Environment
{
  "extras": "",
  "marker": "extra == \"vector-stores\"",
  "requires_python": "<4.0,>=3.9",
  "evaluation": "NOT_EVALUATED"
}
pymongo>=4.13.2; extra == "vector-stores"runtime
pymysql
Environment
{
  "extras": "",
  "marker": "extra == \"vector-stores\"",
  "requires_python": "<4.0,>=3.9",
  "evaluation": "NOT_EVALUATED"
}
pymysql>=1.1.0; extra == "vector-stores"runtime
redis
Environment
{
  "extras": "",
  "marker": "extra == \"vector-stores\"",
  "requires_python": "<4.0,>=3.9",
  "evaluation": "NOT_EVALUATED"
}
redis<6.0.0,>=5.0.0; extra == "vector-stores"runtime
redisvl
Environment
{
  "extras": "",
  "marker": "extra == \"vector-stores\"",
  "requires_python": "<4.0,>=3.9",
  "evaluation": "NOT_EVALUATED"
}
redisvl<1.0.0,>=0.1.0; extra == "vector-stores"runtime
upstash-vector
Environment
{
  "extras": "",
  "marker": "extra == \"vector-stores\"",
  "requires_python": "<4.0,>=3.9",
  "evaluation": "NOT_EVALUATED"
}
upstash-vector>=0.1.0; extra == "vector-stores"runtime
valkey
Environment
{
  "extras": "",
  "marker": "extra == \"vector-stores\"",
  "requires_python": "<4.0,>=3.9",
  "evaluation": "NOT_EVALUATED"
}
valkey>=6.0.0; extra == "vector-stores"runtime
vecs
Environment
{
  "extras": "",
  "marker": "extra == \"vector-stores\"",
  "requires_python": "<4.0,>=3.9",
  "evaluation": "NOT_EVALUATED"
}
vecs>=0.4.0; extra == "vector-stores"runtime
weaviate-client
Environment
{
  "extras": "",
  "marker": "extra == \"vector-stores\"",
  "requires_python": "<4.0,>=3.9",
  "evaluation": "NOT_EVALUATED"
}
weaviate-client<4.15.0,>=4.4.0; extra == "vector-stores"runtime

Distribution files

2 collected
agentrun_mem0ai-0.0.12-py3-none-any.whl

bdist_wheel · 275.42 KB · Python py3

Source file
agentrun_mem0ai-0.0.12.tar.gz

sdist · 180.29 KB · Python source

Source file

Metadata history

Meaningful changes
Current collected state Current

Observed since 20 Oct, 23:14 UTC

No superseded metadata states collected. Unchanged observations do not create new revisions.

Record identity

package_version:fab20af069c8a6b646c1c4fdfd1eb95a72c4177cfb0ac88fd92aff0ab6aeb891

Other collected versions

View all collected versions →