CM

coleam00/mcp-mem0

Developer tools

이 페이지는 AI로 자동 번역되었습니다. 기술적인 세부 사항은 원문을 확인하세요. 원문 보기

687 stars 234 forks 품질 69 트렌드 21MIT

Mem0을 이용한 장기 에이전트 메모리용 MCP 서버입니다. Python 사용으로 직접 MCP 서버를 구축하는 데 도움이 되는 템플릿으로도 유용합니다!

개요

MCP-Mem0: AI 에이전트를 위한 장기 기억 AI 에이전트에게 영구 메모리 기능을 제공하기 위해 Mem0과 통합된 모델 컨텍스트 프로토콜(MCP) 서버의 템플릿 구현체입니다. 이 점을 참고해 직접 MCP 서버를 구축하거나, AI 코딩 어시스턴트에게 구조와 코드 정확성을 위해 이 예시를 따르라고 지시하세요! 이 프로젝트는 AI 에이전트가 의미 탐색을 사용해 기억을 저장, 검색, 검색할 수 있도록 하는 MCP 서버를 구축하는 방법을 시연합니다. Mem0와 실용적인 예제를 사용해 직접 MCP 서버를 만들 수 있는 실용적인 템플릿 역할을 합니다. 이 구현은 Anthropic이 제시한 MCP 서버 구축 모범 사례를 따르며, 모든 MCP 호환 클라이언트와의 원활한 통합을 가능하게 합니다. 서버는 세 가지 필수 메모리 관리 도구를 제공합니다: 1. : 의미 색인을 통해 장기 기억에 모든 정보를 저장한다 2. : 포괄적인 맥락을 위해 저장된 모든 기억을 검색한다. 3.

개요(AI 번역)

MCP-Mem0: AI 에이전트를 위한 장기 기억

AI 에이전트에게 영구 메모리 기능을 제공하기 위해 Mem0과 통합된 모델 컨텍스트 프로토콜(MCP) 서버의 템플릿 구현체입니다.

이 점을 참고해 직접 MCP 서버를 구축하거나, AI 코딩 어시스턴트에게 구조와 코드 정확성을 위해 이 예시를 따르라고 지시하세요!

개요

이 프로젝트는 AI 에이전트가 의미 탐색을 사용해 기억을 저장, 검색, 검색할 수 있도록 하는 MCP 서버를 구축하는 방법을 시연합니다. Mem0와 실용적인 예제를 사용해 직접 MCP 서버를 만들 수 있는 실용적인 템플릿 역할을 합니다.

이 구현은 Anthropic이 제시한 MCP 서버 구축 모범 사례를 따르며, 모든 MCP 호환 클라이언트와의 원활한 통합을 가능하게 합니다.

특징

서버는 세 가지 필수 메모리 관리 도구를 제공합니다:

  1. save_memory: 의미 색인을 통해 장기 기억에 정보를 저장합니다
  2. get_all_memories: 포괄적인 맥락을 위해 저장된 모든 기억을 검색합니다.
  3. search_memories: 의미 검색을 이용해 관련 기억을 찾기

선수 조건

  • 파이썬 3.12+

이 페이지는 AI로 자동 번역되었습니다. 기술적인 세부 사항은 원문을 확인하세요.

README

원문 README의 일부입니다. 원문 보기.

MCP-Mem0: Long-Term Memory for AI Agents

A template implementation of the Model Context Protocol (MCP) server integrated with Mem0 for providing AI agents with persistent memory capabilities.

Use this as a reference point to build your MCP servers yourself, or give this as an example to an AI coding assistant and tell it to follow this example for structure and code correctness!

Overview

This project demonstrates how to build an MCP server that enables AI agents to store, retrieve, and search memories using semantic search. It serves as a practical template for creating your own MCP servers, simply using Mem0 and a practical example.

The implementation follows the best practices laid out by Anthropic for building MCP servers, allowing seamless integration with any MCP-compatible client.

Features

The server provides three essential memory management tools:

  1. save_memory: Store any information in long-term memory with semantic indexing
  2. get_all_memories: Retrieve all stored memories for comprehensive context
  3. search_memories: Find relevant memories using semantic search

Prerequisites

  • Python 3.12+
  • Supabase or any PostgreSQL database (for vector storage of memories)
  • API keys for your chosen LLM provider (OpenAI, OpenRouter, or Ollama)
  • Docker if running the MCP server as a container (recommended)

Installation

Using uv

  1. Install uv if you don’t have it:

    pip install uv
    
  2. Clone this repository:

    git clone https://github.com/coleam00/mcp-mem0.git
    cd mcp-mem0
    
  3. Install dependencies:

    uv pip install -e .
    
  4. Create a .env file based on .env.example:

    cp .env.example .env
    
  5. Configure your environment variables in the .env file (see Configuration section)

  1. Build the Docker image:

    docker build -t mcp/mem0 --build-arg PORT=8050 .
    
  2. Create a .env file based on .env.example and configure your environment variables

Configuration

The following environment variables can be configured in your .env file:

Variable Description Example
TRANSPORT Transport protocol (sse or stdio) sse
HOST Host to bind to when using SSE transport 0.0.0.0
PORT Port to listen on when using SSE transport 8050
LLM_PROVIDER LLM provider (openai, openrouter, or ollama) openai
LLM_BASE_URL Base URL for the LLM API https://api.openai.com/v1
LLM_API_KEY API key for the LLM provider sk-...
LLM_CHOICE LLM model to use gpt-4o-mini
EMBEDDING_MODEL_CHOICE Embedding model to use text-embedding-3-small
GitHub에서 전체 README 보기

설치

docker run --rm -i -e TRANSPORT -e LLM_PROVIDER -e LLM_BASE_URL -e LLM_API_KEY -e LLM_CHOICE -e EMBEDDING_MODEL_CHOICE -e DATABASE_URL mcp/mem0
MCP 초보자라면? mcpskill.org 가이드부터 시작하세요 →

설정

{ "mcpServers": { "mem0": { "transport": "sse", "url": "http://localhost:8050/sse" } } }