npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

openmemory-mcp-vista8

v2.0.0

Published

OpenMemory MCP Server - 智能记忆存储和检索服务

Downloads

23

Readme

OpenMemory MCP for Raycast AI

基于 mem0 的智能记忆系统,为 Raycast AI 提供 MCP (Model Context Protocol) 支持。

项目概述

本项目将 mem0 的 OpenMemory 系统配置为远程 MCP 服务器,使 Raycast AI 能够:

  • 🧠 智能记忆存储: 自动存储用户的偏好、工作信息和个人详情
  • 🔍 语义检索: 基于向量相似度的智能记忆检索
  • 🔄 上下文感知: 在对话中提供相关的历史记忆
  • 🛡️ 数据隔离: 每个用户的记忆数据完全隔离

架构组件

核心服务

  1. Qdrant 向量数据库 (端口 6333)

    • 存储记忆的向量嵌入
    • 支持高效的语义搜索
  2. OpenMemory MCP 服务器 (端口 8765)

    • 提供 MCP 协议接口
    • 处理记忆的创建、检索和管理
    • 支持 RESTful API 和 SSE
  3. OpenMemory UI (端口 3000)

    • 可选的 Web 管理界面
    • 用于查看和管理存储的记忆

技术栈

  • 后端: FastAPI + Python
  • 向量数据库: Qdrant
  • 前端: Next.js + React
  • 容器化: Docker + Docker Compose
  • 协议: MCP (Model Context Protocol)

快速开始

本地开发

  1. 克隆项目

    git clone https://github.com/mem0ai/mem0.git
    cd mem0/openmemory
  2. 配置环境变量

    cp api/.env.example api/.env
    cp ui/.env.example ui/.env
  3. 编辑 API 配置 (api/.env)

    OPENAI_API_KEY=your_openai_api_key_here
    USER=raycast_user
  4. 编辑 UI 配置 (ui/.env)

    NEXT_PUBLIC_API_URL=http://localhost:8765
    NEXT_PUBLIC_USER_ID=raycast_user
  5. 启动服务

    make build
    make up
  6. 验证服务

    • API 文档: http://localhost:8765/docs
    • UI 界面: http://localhost:3000
    • Qdrant 控制台: http://localhost:6333/dashboard

生产部署

  1. 准备服务器

    • 安装 Docker 和 Docker Compose
    • 确保端口 80, 443 开放
  2. 使用部署脚本

    chmod +x deploy/deploy.sh
    ./deploy/deploy.sh
  3. 配置域名和 SSL

    • 修改 deploy/nginx.conf 中的域名
    • 配置 SSL 证书(建议使用 Let's Encrypt)

Raycast AI 配置

MCP 服务器配置

在 Raycast AI 中添加 MCP 服务器:

{
  "name": "OpenMemory",
  "description": "智能记忆存储和检索服务",
  "url": "https://your-domain.com/mcp/raycast/sse/your_user_id",
  "type": "sse",
  "headers": {
    "Content-Type": "application/json",
    "User-Agent": "Raycast-AI/1.0"
  },
  "timeout": 30000,
  "retry": 3
}

使用示例

配置完成后,您可以在 Raycast AI 中:

用户: 请记住我喜欢喝咖啡,特别是拿铁
AI: 好的,我已经记住您喜欢喝咖啡,特别是拿铁。

用户: 我的工作是什么?
AI: 根据我的记忆,您是一名软件工程师。

用户: 推荐一些饮品
AI: 基于您喜欢咖啡的偏好,我推荐一些优质的拿铁...

API 端点

MCP 端点

  • GET /mcp/{client_name}/sse/{user_id} - SSE 连接端点
  • POST /mcp/messages/ - MCP 消息处理端点

REST API 端点

  • GET /api/v1/memories/ - 列出记忆
  • POST /api/v1/memories/ - 创建记忆
  • GET /api/v1/memories/{memory_id} - 获取特定记忆
  • PUT /api/v1/memories/{memory_id} - 更新记忆
  • DELETE /api/v1/memories/ - 删除记忆

管理端点

  • GET /docs - API 文档
  • GET /openapi.json - OpenAPI 规范

配置选项

环境变量

| 变量名 | 描述 | 默认值 | |--------|------|--------| | OPENAI_API_KEY | OpenAI API 密钥 | 必需 | | USER | 默认用户 ID | raycast_user | | QDRANT_URL | Qdrant 连接 URL | http://localhost:6333 | | DATABASE_URL | 数据库连接 URL | sqlite:///./openmemory.db |

自定义配置

  • 用户 ID: 可以为不同用户配置不同的 ID
  • 客户端名称: 支持多个客户端应用
  • 记忆分类: 自动分类和标签管理
  • 访问控制: 细粒度的权限管理

故障排除

常见问题

  1. 连接超时

    • 检查服务器状态: docker-compose ps
    • 查看日志: docker-compose logs -f
  2. 记忆创建失败

    • 验证 OpenAI API 密钥
    • 检查 Qdrant 连接状态
  3. 用户不存在错误

    • MCP 端点会自动创建用户
    • REST API 需要预先存在的用户

日志查看

# 查看所有服务日志
docker-compose logs -f

# 查看特定服务日志
docker-compose logs -f openmemory-mcp
docker-compose logs -f mem0_store

安全注意事项

  1. API 密钥安全: 妥善保管 OpenAI API 密钥
  2. 网络安全: 使用 HTTPS 和防火墙
  3. 数据备份: 定期备份向量数据和数据库
  4. 访问控制: 配置适当的用户权限

贡献

欢迎提交 Issue 和 Pull Request!

许可证

本项目基于 mem0 项目,遵循相应的开源许可证。


注意: 这是一个基于 mem0 的扩展项目,用于为 Raycast AI 提供 MCP 支持。确保遵循 mem0 项目的使用条款和限制。