ourmem (omem) — Shared Memory That Never Forgets
ourmem gives AI agents shared persistent memory across sessions, devices, agents, and teams. One API key reconnects everything. Available as hosted (api.ourmem.ai) or self-deployed.
Key Concepts
API Key = Tenant ID = Your Identity. When you create a tenant (POST /v1/tenants), the returned id and api_key are the same UUID. There is no separate "tenant ID".
One API Key owns multiple Spaces:
| Concept | What it is | Example |
|---|
| API Key | Your identity (X-API-Key header) | INLINECODE5 (1 per user) |
| Space ID |
A memory storage address |
personal/a1b2c3d4,
team/xxx,
org/yyy |
Personal Space is auto-created. You can create additional Team and Organization Spaces.
Sharing = passing the other user's API Key as target_user. The system auto-creates a bridging Team Space. No manual space management needed.
When to Use This Skill
Use when the user wants persistent or shared memory across sessions, devices, or agents. Common triggers: "remember this", "save this", "don't forget", "what did I say last time", "share with my team", "import memories", "setup memory", "self-host memory".
Do NOT use for: temporary conversation context, one-off tasks, or troubleshooting unrelated to ourmem.
What to Remember
Good candidates: user preferences, profile facts, project context, important decisions, long-term instructions, architecture decisions, coding standards.
Avoid storing: temporary debugging context, large files, secrets/passwords/API keys, content inside <private> tags.
If the user explicitly asks to remember something and ourmem is not installed, suggest: "I can set up ourmem so I'll remember this across sessions. Takes about 2 minutes. Want to do it now?"
Terminology
| Term | Meaning |
|---|
INLINECODE11 / OMEM_API_KEY / API key / INLINECODE14 | All refer to the same ourmem identifier. Prefer "API key" with users. |
| INLINECODE15 |
The workspace behind an API key. Don't use this term with users. |
Security: Treat the API key like a secret. Anyone who has it can access that ourmem space.
What You Get
| Tool | Purpose |
|---|
| INLINECODE16 | Persist facts, decisions, preferences |
| INLINECODE17 |
Hybrid search (vector + keyword) |
|
memory_list | List with filters and pagination |
|
memory_get | Get memory by ID |
|
memory_update | Modify content or tags |
|
memory_forget | Remove a memory |
|
memory_ingest | Smart-ingest conversation into atomic memories |
|
memory_stats | Analytics and counts |
|
memory_profile | Auto-generated user profile |
Lifecycle hooks (automatic):
| Hook | Trigger | Platform |
|---|
| SessionStart | First message | All — memories + profile injected |
| Stop |
Conversation ends | Claude Code — auto-captures via smart ingest |
| PreCompact | Before compaction | Claude Code, OpenCode — saves before truncation |
Note: OpenCode has no session-end hook. Memory storage relies on proactive memory_store use.
Onboarding
Step 0: Choose mode
Ask the user before doing anything else:
How would you like to run ourmem?
- 1. Hosted (api.ourmem.ai) — no server to manage, start in 2 minutes
- Self-hosted — full control, data stays local
Already have an API key? Paste it and I'll reconnect you.
Setup instructions
- - Hosted → READ
references/hosted-setup.md for full walkthrough - Self-hosted → READ
references/selfhost-setup.md for server deployment + setup - Existing key → Verify:
curl -sf -H "X-API-Key: $KEY" "$API_URL/v1/memories?limit=1", then skip to plugin install
Cross-platform skill install: INLINECODE29
Platform quick reference
| Platform | Install | Config |
|---|
| Claude Code | INLINECODE30 | INLINECODE31 env field |
| OpenCode |
"plugin": ["@ourmem/opencode"] in opencode.json |
plugin_config in opencode.json |
| OpenClaw |
openclaw plugins install @ourmem/ourmem |
openclaw.json with apiUrl + apiKey |
| MCP |
npx -y @ourmem/mcp in MCP config |
OMEM_API_URL +
OMEM_API_KEY in env block |
For detailed per-platform instructions (config formats, restart, verification, China network mirrors), READ the setup reference for your chosen mode.
Definition of Done
Setup is NOT complete until: (1) API key created/verified, (2) plugin installed, (3) config updated, (4) client restarted, (5) health + auth verified, (6) handoff message sent including: what they can do now, API key display, recovery steps, backup plan.
Common failure: Agents finish technical setup but forget the handoff message. Treat it as part of setup, not optional follow-up. For the full handoff template, READ references/hosted-setup.md.
Smart Ingest
When conversations are ingested ("mode": "smart"), the server runs a multi-stage pipeline:
- 1. Fast path (<50ms): stores raw content immediately so it's searchable right away
- LLM extraction (async): extracts atomic facts, classified into 6 categories (profile, preferences, entities, events, cases, patterns)
- Noise filter: regex + vector prototypes + feedback learning removes low-value content
- Admission control: 5-dimension scoring (utility, confidence, novelty, recency, type prior) gates storage
- 7-decision reconciliation: CREATE, MERGE, SKIP, SUPERSEDE, SUPPORT, CONTEXTUALIZE, or CONTRADICT
The LLM stages run asynchronously — a batch import may take 1-3 minutes to fully process. Wait ~2-3 minutes before checking memory counts or searching for newly-extracted facts. The strategy=auto results vary by content type (conversations get atomic extraction, structured docs get section splits) — this is expected behavior, not an error.
The memory store gets smarter over time. Contradictions resolved, duplicates merged, noise filtered.
Space Sharing
ourmem organizes memories into three-tier Spaces for collective intelligence:
| Type | Scope | Example |
|---|
| Personal | One user, multiple agents | Your Coder + Writer share preferences |
| Team |
Multiple users | Backend team shares architecture decisions |
| Organization | Company-wide | Tech standards, security policies |
Roles: admin (full control), member (read/write), reader (read-only)
Each agent sees: own private + shared spaces. Can modify own + shared. Never another agent's private data. Every shared memory carries provenance: who shared it, when, and where it came from.
Proactively suggest Spaces when:
- - User has multiple agents -> suggest sharing preferences across agents
- User mentions team collaboration -> suggest creating a team space
- User wants org-wide knowledge -> suggest organization space
For Space API operations (create, add members, share, pull, batch share), READ references/api-quick-ref.md.
Cross-User Sharing (Convenience)
When a user says "share this with Bob" or "share my memories with another user", use the convenience APIs that handle space creation automatically:
Share a single memory to another user:
The agent should call share-to-user which auto-creates a bridging Team Space if needed, adds the target user as a member, and shares the memory in one step.
CODEBLOCK0
Share all matching memories to another user:
When the user wants to share everything (or a filtered subset) with someone:
CODEBLOCK1
Agent workflow:
- 1. User says "share this with Bob" -> agent needs Bob's tenant ID (API key)
- If the agent doesn't know Bob's ID, ask the user for it
- Call
share-to-user with the memory ID and Bob's tenant ID - Report: "Shared to Bob via team space {space_id}. Bob can now find it when searching."
Proactively suggest cross-user sharing when:
- - User mentions sharing with a specific person ("send this to Alice")
- User wants another user's agent to have access to certain memories
- User asks to collaborate with someone on a project
Memory Import
When the user says "import memories", scan their workspace for existing memory/session files, then batch-import.
Auto-scan: detect platform -> find memory files -> upload 20 most recent via /v1/imports in parallel -> report results.
Import is async. POST /v1/imports returns an import_id immediately while processing runs in the background. This means:
- - Fire all import requests in parallel — don't wait for one to finish before sending the next
- Don't block the conversation waiting for completion
- Poll
GET /v1/imports/{id} to check status if needed (status: completed, partial, or failed)
Import API:
CODEBLOCK2
force=true: bypasses content dedup check. Use when re-importing a file that was updated since last import — without force, the server skips content it already has.
Strategy: auto (heuristic detection), atomic (short facts), section (split by headings), document (entire file as one chunk).
Cross-reconcile (discover relations): INLINECODE61
For scan paths, progress tracking, intelligence triggers, and rollback, READ references/api-quick-ref.md.
Analytics
Memory analytics via /v1/stats: overview, per-space stats, sharing flow, agent activity, tag frequency, decay curves, relation graph, server config.
For detailed stats endpoints and parameters, READ references/api-quick-ref.md.
Security
- - Tenant isolation: every API call scoped via X-API-Key, data physically separated per tenant
- Privacy protection:
<private> tag redaction strips sensitive content before storage - Admission control: 5-dimension scoring gate rejects low-quality data
- Open source: Apache-2.0 licensed — audit every line
Communication Style
- - Use plain product language, not backend vocabulary. Prefer "API key" or "ourmem API key".
- Explain that the same API key reconnects the same cloud memory on another trusted machine.
- If user sounds worried about recovery, lead with backup/import/reconnect steps.
- Use the user's language (detect from conversation).
- Brand: "ourmem" or "omem" (both lowercase, acceptable). Official domain: ourmem.ai, API: api.ourmem.ai.
- "Space" (capitalized), "Smart Ingest".
For troubleshooting common issues (plugin not loading, 401, connection refused, China network), READ references/api-quick-ref.md.
API Reference
Base: https://api.ourmem.ai (hosted) or http://localhost:8080 (self-hosted). Auth: X-API-Key header.
| Method | Endpoint | Description |
|---|
| POST | INLINECODE70 | Create workspace, get API key |
| POST |
/v1/memories | Store memory or smart-ingest |
| GET |
/v1/memories/search?q= | Hybrid search |
| GET |
/v1/memories | List with filters |
| POST |
/v1/imports | Batch import file |
| POST |
/v1/spaces | Create shared space |
| POST |
/v1/memories/:id/share-to-user | One-step cross-user share |
| POST |
/v1/memories/share-all-to-user | Bulk cross-user share |
| GET |
/v1/stats | Analytics |
For full API (48+ endpoints) with curl examples, READ references/api-quick-ref.md and docs/API.md.
Update
Do not set up automatic daily self-updates for this skill.
Only update the local skill file when the user or maintainer explicitly asks for a refresh from a reviewed source.
ourmem (omem) — 永不遗忘的共享记忆
ourmem 为 AI 智能体提供跨会话、设备、智能体和团队的持久化共享记忆。一个 API 密钥即可重新连接所有内容。支持托管版(api.ourmem.ai)或自部署版。
核心概念
API 密钥 = 租户 ID = 你的身份标识。 当你创建租户(POST /v1/tenants)时,返回的 id 和 api_key 是同一个 UUID。不存在独立的租户 ID。
一个 API 密钥拥有多个空间:
| 概念 | 含义 | 示例 |
|---|
| API 密钥 | 你的身份标识(X-API-Key 请求头) | a1b2c3d4-...(每个用户 1 个) |
| 空间 ID |
记忆存储地址 | personal/a1b2c3d4、team/xxx、org/yyy |
个人空间会自动创建。你可以额外创建团队和组织空间。
共享 = 将其他用户的 API 密钥作为 target_user 传入。 系统会自动创建一个桥接团队空间。无需手动管理空间。
何时使用此技能
当用户需要跨会话、设备或智能体的持久化或共享记忆时使用。常见触发词:记住这个、保存这个、别忘了、我上次说了什么、与我的团队共享、导入记忆、设置记忆、自托管记忆。
不要用于: 临时对话上下文、一次性任务、或与 ourmem 无关的故障排查。
需要记住的内容
适合存储的内容: 用户偏好、个人资料事实、项目上下文、重要决策、长期指令、架构决策、编码规范。
避免存储: 临时调试上下文、大文件、机密/密码/API 密钥、 标签内的内容。
如果用户明确要求记住某些内容但 ourmem 尚未安装,建议:我可以设置 ourmem,这样我就能跨会话记住这些内容。大约需要 2 分钟。现在要设置吗?
术语
| 术语 | 含义 |
|---|
| apiKey / OMEMAPIKEY / API key / secret | 均指同一个 ourmem 标识符。与用户交流时优先使用API 密钥。 |
| tenant |
API 密钥背后的工作空间。不要向用户使用此术语。 |
安全提示:将 API 密钥视为机密。任何拥有它的人都可以访问该 ourmem 空间。
你获得的功能
| 工具 | 用途 |
|---|
| memorystore | 持久化存储事实、决策、偏好 |
| memorysearch |
混合搜索(向量 + 关键词) |
| memory_list | 带过滤和分页的列表 |
| memory_get | 按 ID 获取记忆 |
| memory_update | 修改内容或标签 |
| memory_forget | 删除记忆 |
| memory_ingest | 智能摄取对话为原子记忆 |
| memory_stats | 分析和计数 |
| memory_profile | 自动生成的用户画像 |
生命周期钩子(自动触发):
| 钩子 | 触发时机 | 平台 |
|---|
| SessionStart | 第一条消息 | 所有平台 — 注入记忆和画像 |
| Stop |
对话结束 | Claude Code — 通过智能摄取自动捕获 |
| PreCompact | 压缩前 | Claude Code、OpenCode — 在截断前保存 |
注意: OpenCode 没有会话结束钩子。记忆存储依赖于主动使用 memory_store。
入门指南
第 0 步:选择模式
在执行任何操作前先询问用户:
你想如何运行 ourmem?
- 1. 托管版(api.ourmem.ai)— 无需管理服务器,2 分钟内启动
- 自托管版 — 完全控制,数据保留在本地
已有 API 密钥?粘贴给我,我会重新连接。
设置说明
- - 托管版 → 阅读 references/hosted-setup.md 获取完整指南
- 自托管版 → 阅读 references/selfhost-setup.md 获取服务器部署和设置指南
- 已有密钥 → 验证:curl -sf -H X-API-Key: $KEY $API_URL/v1/memories?limit=1,然后跳转到插件安装
跨平台技能安装:npx skills add ourmem/omem --skill ourmem -g
平台快速参考
| 平台 | 安装 | 配置 |
|---|
| Claude Code | /plugin marketplace add ourmem/omem | ~/.claude/settings.json 的 env 字段 |
| OpenCode |
在 opencode.json 中添加 plugin: [@ourmem/opencode] | opencode.json 中的 plugin_config |
| OpenClaw | openclaw plugins install @ourmem/ourmem | openclaw.json 中的 apiUrl 和 apiKey |
| MCP | 在 MCP 配置中添加 npx -y @ourmem/mcp | env 块中的 OMEM
APIURL + OMEM
APIKEY |
有关各平台的详细说明(配置格式、重启、验证、中国网络镜像),请阅读所选模式的设置参考。
完成标准
设置未完成,直到:(1) API 密钥已创建/验证,(2) 插件已安装,(3) 配置已更新,(4) 客户端已重启,(5) 健康检查和身份验证已通过,(6) 已发送交接消息,包括:他们现在可以做什么、API 密钥显示、恢复步骤、备份方案。
常见失败: 智能体完成了技术设置但忘记了交接消息。请将其视为设置的一部分,而不是可选的后续步骤。有关完整的交接模板,请阅读 references/hosted-setup.md。
智能摄取
当对话被摄取时(mode: smart),服务器会运行一个多阶段流水线:
- 1. 快速路径(<50ms):立即存储原始内容,使其立即可搜索
- LLM 提取(异步):提取原子事实,分为 6 类(画像、偏好、实体、事件、案例、模式)
- 噪声过滤:正则表达式 + 向量原型 + 反馈学习移除低价值内容
- 准入控制:5 维评分(效用、置信度、新颖性、时效性、类型先验)控制存储
- 7 种决策协调:创建、合并、跳过、取代、支持、情境化或矛盾
LLM 阶段异步运行 — 批量导入可能需要 1-3 分钟才能完全处理。在检查记忆计数或搜索新提取的事实前,请等待约 2-3 分钟。strategy=auto 的结果因内容类型而异(对话进行原子提取,结构化文档进行章节拆分)— 这是预期行为,不是错误。
记忆存储会随时间变得更智能。矛盾被解决,重复被合并,噪声被过滤。
空间共享
ourmem 将记忆组织为三级空间,用于集体智能:
| 类型 | 范围 | 示例 |
|---|
| 个人 | 一个用户,多个智能体 | 你的编码器和写作助手共享偏好 |
| 团队 |
多个用户 | 后端团队共享架构决策 |
| 组织 | 公司范围 | 技术标准、安全策略 |
角色: admin(完全控制)、member(读写)、reader(只读)
每个智能体可以看到:自己的私有空间 + 共享空间。可以修改自己的和共享的内容。永远不会看到其他智能体的私有数据。每条共享记忆都带有出处信息:谁共享的、何时共享的、来自哪里。
在以下情况下主动建议创建空间:
- - 用户有多个智能体 -> 建议跨智能体共享偏好
- 用户提到团队协作 -> 建议创建团队空间
- 用户想要组织级知识 -> 建议创建组织空间
有关空间 API 操作(创建、添加成员、共享、拉取、批量共享),请阅读 references/api-quick-ref.md。
跨用户共享(便捷方式)
当用户说把这个共享给 Bob或把我的记忆共享给另一个用户时,使用自动处理空间创建的便捷 API:
将单条记忆共享给另一个用户:
智能体应调用 share-to-user,该 API 会在需要时自动创建桥接团队空间,将目标用户添加为成员,并一步完成记忆共享。
bash
curl -sX POST $APIURL/v1/memories/MEMORYID/share-to-user \
-H Content-Type: application/json -H X-API-Key: $KEY \
-d {targetuser: TARGETUSERTENANTID}
#