360 Secure SkillHub
360 安全技能中心

mem0

该 Skill 通过 MEM0 云 API 为 agent 提供跨会话的外部记忆持久化,支持添加记忆、列出全部记忆、语义搜索、按 ID 获取以及删除记忆;主要使用 curl 调用 REST 接口,需要 MEM0 Token 和网络连接,记忆内容会发送至外部服务。

分类:知识
147258xuan
147258xuan
热度 2.72
最近更新 2026-11-13 18:46:45

安装

发给 Agent
帮我安装这个技能:npx secure-skills-cli add 147258xuan/mem0
兼容性
通用兼容
联网要求
需要联网
数据出网
必须出网
Metadata
name
mem0
description
MEM0 API external memory for agents — store, search, list, and delete agent memories.

MEM0 Memory Skill

External memory persistence via MEM0 API.
Store and retrieve agent memories across sessions using a cloud memory backend.

Token

Stored in TOOLS.md under Credentials → Token 2.
Key: m0-0fQwyLV4aoVA4JeFGJd5WkkzPiP5XQU2htOonEwI

API

  • Base: https://api.mem0.ai/v1/
  • Auth: Authorization: Token <key>
  • Content-Type: application/json

Agent ID

Use agent_id=gugagu for this agent's memory namespace.

Usage

Store a memory (add)

# Single message
curl.exe -s -X POST "https://api.mem0.ai/v1/memories/" `
  -H "Authorization: Token <MEM0_TOKEN>" `
  -H "Content-Type: application/json" `
  -d '{"agent_id": "gugagu", "messages": [{"role": "user", "content": "memory text here"}]}'

# Returns: [{"message":"...","status":"PENDING","event_id":"..."}]

Retrieve all memories

curl.exe -s "https://api.mem0.ai/v1/memories/?agent_id=gugagu" `
  -H "Authorization: Token <MEM0_TOKEN>"

Search memories (semantic)

curl.exe -s "https://api.mem0.ai/v1/memories/search/?agent_id=gugagu&query=<search-term>" `
  -H "Authorization: Token <MEM0_TOKEN>"

Get a single memory by ID

curl.exe -s "https://api.mem0.ai/v1/memories/<memory-id>/?agent_id=gugagu" `
  -H "Authorization: Token <MEM0_TOKEN>"

Delete a memory

curl.exe -s -X DELETE "https://api.mem0.ai/v1/memories/<memory-id>/" `
  -H "Authorization: Token <MEM0_TOKEN>"

Quick Reference

Action Method Endpoint Key Param
Add POST /memories/ agent_id, messages[]
List GET /memories/ agent_id
Search GET /memories/search/ agent_id, query
Get GET /memories/{id}/ agent_id
Delete DELETE /memories/{id}/ —

Batch tips

  • Write JSON body to a temp file to avoid PowerShell quoting issues: @C:\path\to\body.json
  • Token can be read from env var or TOOLS.md lookup.