Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up

The Memory layer for AI Agents

License

NotificationsYou must be signed in to change notification settings

mem0ai/mem0

Repository files navigation

Mem0 - The Memory Layer for Personalized AI

mem0ai%2Fmem0 | TrendshiftLaunch YC: Mem0 - Open Source Memory Layer for AI Apps

Learn more ·Join Discord ·Demo

Mem0 DiscordMem0 PyPI - DownloadsGitHub commit activityPackage versionNpm packageY Combinator S24

Introduction

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

Features & Use Cases

Core Capabilities:

  • Multi-Level Memory: User, Session, and AI Agent memory retention with adaptive personalization
  • Developer-Friendly: Simple API integration, cross-platform consistency, and hassle-free managed service

Applications:

  • AI Assistants: Seamless conversations with context and personalization
  • Learning & Support: Tailored content recommendations and context-aware customer assistance
  • Healthcare & Companions: Patient history tracking and deeper relationship building
  • Productivity & Gaming: Streamlined workflows and adaptive environments based on user behavior

Get Started

Get started quickly withMem0 Platform - our fully managed solution that provides automatic updates, advanced analytics, enterprise security, and dedicated support.Create a free account to begin.

For complete control, you can self-host Mem0 using our open-source package. See theQuickstart guide below to set up your own instance.

Quickstart Guide

Install the Mem0 package via pip:

pip install mem0ai

Install the Mem0 package via npm:

npm install mem0ai

Basic Usage

Mem0 requires an LLM to function, withgpt-4o-mini from OpenAI as the default. However, it supports a variety of LLMs; for details, refer to ourSupported LLMs documentation.

First step is to instantiate the memory:

fromopenaiimportOpenAIfrommem0importMemoryopenai_client=OpenAI()memory=Memory()defchat_with_memories(message:str,user_id:str="default_user")->str:# Retrieve relevant memoriesrelevant_memories=memory.search(query=message,user_id=user_id,limit=3)memories_str="\n".join(f"-{entry['memory']}"forentryinrelevant_memories["results"])# Generate Assistant responsesystem_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-4o-mini",messages=messages)assistant_response=response.choices[0].message.content# Create new memories from the conversationmessages.append({"role":"assistant","content":assistant_response})memory.add(messages,user_id=user_id)returnassistant_responsedefmain():print("Chat with AI (type 'exit' to quit)")whileTrue:user_input=input("You: ").strip()ifuser_input.lower()=='exit':print("Goodbye!")breakprint(f"AI:{chat_with_memories(user_input)}")if__name__=="__main__":main()

See the example forNode.js.

For more advanced usage and API documentation, visit ourdocumentation.

Tip

For a hassle-free experience, try ourhosted platform with automatic updates and enterprise features.

Demos

  • Mem0 - ChatGPT with Memory: A personalized AI chat app powered by Mem0 that remembers your preferences, facts, and memories.
Mem0.Demo.mp4

Try livedemo



  • AI Companion: Experience personalized conversations with an AI that remembers your preferences and past interactions
AI.companion.mp4



  • Enhance your AI interactions by storing memories across ChatGPT, Perplexity, and Claude using our browser extension. Getchrome extension.
Chrome.extension.video.mp4



  • Customer support bot usingLanggraph and Mem0. Get the complete code fromhere
customer_support_demo.py.mp4



  • Use Mem0 with CrewAI to get personalized results. Full examplehere
crewai_demo.mp4

Documentation

For detailed usage instructions and API reference, visit ourdocumentation. You'll find:

  • Complete API reference
  • Integration guides
  • Advanced configuration options
  • Best practices and examples
  • More details about:

Support

Join our community for support and discussions. If you have any questions, feel free to reach out to us using one of the following methods:

License

This project is licensed under the Apache 2.0 License - see theLICENSE file for details.


[8]ページ先頭

©2009-2025 Movatter.jp