MemoryAPI
🧠 MemoryAPI
为 AI 智能体和 LLM 提供持久化记忆 — REST API + MCP 原生支持
MemoryAPI 为您的 AI 智能体提供跨会话的持久化、可搜索记忆。以自然语言存储记忆,并进行语义检索 — 无需精确关键词。
🌐 memoryapi.org | 📡 API: api.memoryapi.org
功能特性
🧠 语义搜索 — 按含义而非关键词查找记忆
🔌 MCP 原生 — 即插即用,支持 Claude、Cursor、Windsurf 等
⚡ REST API — 简单的 HTTP 端点,适用于任何编程语言
🔑 API 密钥认证 — 安全,按智能体命名空间隔离
📊 使用追踪 — 记忆计数和套餐限额
🌍 始终在线 — 托管于 api.memoryapi.org
快速开始
1. 获取 API 密钥
curl -X POST https://api.memoryapi.org/keys \
-H "Content-Type: application/json" \
-d '{"agent_id": "my-agent", "email": "you@example.com"}'返回:
{
"api_key": "mem_xxxxxxxx.yyyyyyyy",
"message": "Save this key securely — it will not be shown again."
}2. 存储记忆
curl -X POST https://api.memoryapi.org/memory \
-H "Content-Type: application/json" \
-H "x-api-key: mem_xxxxxxxx.yyyyyyyy" \
-d '{"content": "User prefers dark mode and React Native"}'3. 搜索记忆
curl "https://api.memoryapi.org/memory?query=what+does+the+user+prefer" \
-H "x-api-key: mem_xxxxxxxx.yyyyyyyy"MCP 集成
添加到您的 MCP 客户端配置中(Claude Desktop、Cursor、Windsurf 等):
{
"mcpServers": {
"memoryapi": {
"url": "https://api.memoryapi.org/mcp",
"headers": {
"x-api-key": "mem_xxxxxxxx.yyyyyyyy"
}
}
}
}可用 MCP 工具
工具 | 描述 |
| 以自然语言存储记忆 |
| 对记忆进行语义搜索 |
| 列出所有已存储的记忆 |
| 按 ID 删除记忆 |
REST API 参考
POST /memory
存储一条记忆。
请求头: x-api-key: your-key
请求体:
{
"content": "string (required, max 10,000 chars)",
"metadata": { "type": "preference" }
}GET /memory?query=...
对记忆进行语义搜索。
请求头: x-api-key: your-key
查询参数:
query(必填) — 自然语言搜索内容limit(可选,默认 10) — 最大结果数threshold(可选,默认 0.4) — 相似度阈值
GET /memory/list
列出该智能体的所有记忆。
查询参数:
limit(默认 50)offset(默认 0)
DELETE /memory/:id
删除特定记忆。
POST /keys
生成新的 API 密钥。
请求体:
{
"agent_id": "my-agent",
"email": "you@example.com",
"plan": "free"
}定价
套餐 | 价格 | 记忆容量 | 智能体数量 |
免费版 | $0/月 | 100 | 1 |
入门版 | $19/月 | 10,000 | 5 |
专业版 | $49/月 | 无限制 | 无限制 |
技术栈
运行时: Node.js + Express
数据库: Supabase (PostgreSQL + pgvector)
嵌入模型: OpenAI
text-embedding-3-small认证: bcrypt 哈希 API 密钥
协议: MCP 2024-11-05
许可证
MIT © 2026 Ocean Digital Group
Latest Blog Posts
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/heavysword1/memoryapi'
If you have feedback or need assistance with the MCP directory API, please join our Discord server