Skip to content

Self-evolving Context Database for AI Agents. Unify Agent Memory, Knowledge RAG and Skills.

feat(agent-plugins): ship the ov-experience-memory skill (#5172)

t0saki3c6e3d456b45
diff --git a/agent-plugins/README.md b/agent-plugins/README.md
index 134ceb47b..25493c418 100644
--- a/agent-plugins/README.md
+++ b/agent-plugins/README.md
@@ -13,11 +13,14 @@ servers/mcp-proxy.mjs # stdio -> streamable-HTTP proxy to the OV
servers/shared/ # generated from examples/memory-plugin-shared/lib (do not edit)
skills/openviking-memory/SKILL.md # teaches the model the recall + persist loop
skills/ov-memory-troubleshoot/ # read-only extraction troubleshooting
+skills/ov-experience-memory/ # retrieve and apply prior task Experience
plugin.test.mjs # node --test conformance checks
```
Use `ov-memory-troubleshoot` to trace backward from a memory file to its archive diff and, when needed, session messages. Diagnosis is read-only.
+`ov-experience-memory` has the model search `viking://~/memories/experiences` with `find` or `search` before executable work and `read` the one to three Experience files that apply. In this package it is retrieval-only: without hooks nothing commits the conversation as a session, so its reads are not linked back to the Experience they used and produce no new trajectories. The Experience it retrieves comes from harnesses that do capture sessions, such as Claude Code and Codex.
+
Zero npm dependencies; the proxy and tests run on the Node.js standard library (Node 18+ for global `fetch`).
## Install
@@ -25,7 +28,7 @@ Zero npm dependencies; the proxy and tests run on the Node.js standard library (
1. Have an OpenViking server reachable (see the [quickstart](../docs/en/getting-started/02-quickstart.md)); default local endpoint is `http://127.0.0.1:1933`.
2. Point your Agent-Plugins-conforming client at this directory (each client has its own install command or plugin directory; consult its docs). The client will:
- register the `openviking` MCP server from `mcp.json` — it runs `node <plugin>/servers/mcp-proxy.mjs` over stdio;
- - discover the `openviking-memory` and `ov-memory-troubleshoot` skills from `skills/`.
+ - discover the `openviking-memory`, `ov-memory-troubleshoot`, and `ov-experience-memory` skills from `skills/`.
3. Configure credentials (next section) and start a session. The model gains `find` / `search` / `read` / `remember` / `write` and the other OpenViking MCP tools. Use `search` with `mode="context"` for server-assembled context.
## Why a stdio proxy instead of a `streamable-http` entry
diff --git a/agent-plugins/skills/ov-experience-memory/SKILL.md b/agent-plugins/skills/ov-experience-memory/SKILL.md
new file mode 100644
index 000000000..7c6e030c8
--- /dev/null
+++ b/agent-plugins/skills/ov-experience-memory/SKILL.md
@@ -0,0 +1,136 @@
+---
+name: ov-experience-memory
+description: Retrieve and apply OpenViking Experience memories through the Agent runtime's generic OpenViking search and read tools. Use before or during executable, multi-step, or tool-based work such as coding, file or data changes, configuration, deployment, workflow execution, and failure recovery when prior operational guidance could improve reliability. Do not use for casual chat or simple factual questions.
+---
+
+# OpenViking Experience Memory
+
+Use prior task Experience as advisory operational guidance. Keep the current
+user request, current environment, and verified tool results authoritative.
+Experience retrieval supplements normal context retrieval; it does not replace
+user memory, events, preferences, session archives, resources, or Agent Skills.
+
+## Preconditions
+
+- Use only OpenViking tools that are actually registered in the current Agent
+ runtime.
+- Require both a semantic search capability and an exact URI read capability.
+- If either capability is unavailable, continue without Experience. Do not
+ invent a tool call, fabricate a ToolPart, or replace the Agent tool call with
+ direct HTTP or CLI access.
+- Do not substitute broad memory `recall` for a search scoped to the Experience
+ root. Continue using the runtime's normal recall and retrieval flows when the
+ task also needs user facts, events, decisions, prior conversation, or domain
+ resources.
+
+## Select Runtime Tools
+
+Choose the registered names that match the current runtime:
+
+| Runtime | Search | Read |
+| --- | --- | --- |
+| OpenViking MCP, Codex, Claude Code | `find` or `search` | `read` |
+| OpenCode | `openviking_find` or `openviking_search` | `openviking_read` |
+| OpenClaw | `ov_search` | `ov_read` or `ov_multi_read` |
+
+The host may display MCP names with a namespace such as
+`mcp__openviking__find`. Use the exact registered name and schema shown by the
+runtime. Prefer `find` for a fast task-start lookup and `search` when session
+context or deeper intent analysis is useful.
+
+## Retrieval Workflow
+
+1. Decide whether the request is an executable task. Retrieve Experience for
+ planning, tool use, environment changes, multi-step workflows, or recovery
+ from a failed attempt. Skip retrieval for casual conversation and simple
+ knowledge answers.
+2. Build one concise query containing the task goal, domain object, intended
+ operation, and important constraints. After a failure, include the failed
+ operation and stable error signature.
+3. Search only the current user's Experience root:
+
+ ```text
+ viking://~/memories/experiences
+ ```
+
+ For tools using MCP-style parameters, set `target_uri` to this root. For
+ OpenClaw `ov_search`, set `uri` to this root. Never hardcode `default`,
+ `test`, or another user ID. If the server rejects the URI, resolve the root
+ as described in *Servers Without the Home Alias* and retry once.
+4. Start with `limit=5` and the tool's normal score threshold. Judge results by
+ task, environment, preconditions, and likely effect; title similarity alone
+ is insufficient. If no result is relevant, continue without Experience and
+ do not broaden the search to unrelated memory directories.
+5. Select only the one to three Experience files likely to change execution.
+ Require an exact file URI without a query or fragment. Ignore directories,
+ unrelated memory types, and sidecars such as `.abstract.md` and `.overview.md`.
+6. Read every selected canonical `viking://.../memories/experiences/...` URI
+ with the runtime's OpenViking read tool. Search abstracts help selection but
+ are not a substitute for reading the Experience body.
+7. Apply relevant steps and checks while executing the task. Do not repeat the
+ Experience verbatim to the user unless its content is directly needed in the
+ answer.
+8. If execution fails for a materially new reason, perform at most one focused
+ follow-up search using the failure evidence, then read only newly relevant
+ Experience files.
+
+## Servers Without the Home Alias
+
+`viking://~` is the home alias for the caller's own space. A server released
+before the alias (OpenViking v0.4.16) does not resolve it and rejects the
+request with `INVALID_URI` (HTTP 400) instead of searching. Retry once against
+the caller's explicit root, resolved from evidence rather than guessed:
+
+- If a canonical `viking://user/<user_id>/...` URI is already visible in this
+ session — injected memory context, or an earlier OpenViking tool result —
+ reuse that `<user_id>` and search
+ `viking://user/<user_id>/memories/experiences`.
+- Otherwise repeat the same query with no target scope, narrowed to memories
+ with `context_type` when the tool accepts it, and keep only hits whose URI
+ contains `/memories/experiences/`. Those hits carry the canonical user ID;
+ reuse it for the reads and for any later Experience search in this task.
+
+Do not fall back to the uid-less `viking://user/memories/experiences`: only
+some older servers and roles expand it, and current servers reject it. If no
+explicit root can be resolved, continue without Experience.
+
+## Applying Retrieved Experience
+
+- Treat Experience as reusable procedure, not as a user profile, user intent,
+ security policy, or proof that an action succeeded.
+- Follow priority in this order: system and developer instructions, current
+ user request, current environment and tool evidence, then Experience.
+- Ignore stale, incompatible, unsafe, or conflicting guidance. Verify commands,
+ paths, APIs, versions, and destructive actions against the current task.
+- Preserve confirmation requirements and permission boundaries. Prior success
+ never authorizes a destructive or external action in the current session.
+- When multiple Experience files conflict, prefer the one whose preconditions
+ match the current environment; otherwise proceed conservatively and surface
+ the ambiguity when it affects the user.
+
+## Session Evidence
+
+Use real Agent tool calls so the committed OpenViking session retains their
+ToolParts:
+
+- A completed generic OpenViking `find`, `search`, or `list` result containing
+ an Experience URI records recall for that Experience.
+- A completed generic OpenViking `read` or `multi_read` of an Experience URI
+ records injection and can associate the resulting trajectory with that
+ Experience.
+- Failed, cancelled, or incomplete calls do not count.
+
+Do not edit, summarize away, or synthesize these ToolParts before the session
+is committed.
+
+## Example
+
+For a request to fix a deployment failure:
+
+1. Search the Experience root with a query such as
+ `Kubernetes deployment image pull failure private registry`.
+2. Read the most relevant exact Experience URI.
+3. Check that its registry, credential, and rollout assumptions match the
+ current cluster.
+4. Apply the compatible diagnostic steps, verify the live result, and continue
+ the user's task.
diff --git a/docs/en/agent-integrations/15-agent-plugins.md b/docs/en/agent-integrations/15-agent-plugins.md
index 0e0a0fac1..92917dadf 100644
--- a/docs/en/agent-integrations/15-agent-plugins.md
+++ b/docs/en/agent-integrations/15-agent-plugins.md
@@ -14,6 +14,7 @@ agent-plugins/
│ ├── mcp-proxy.mjs # stdio -> streamable-HTTP proxy to the server's /mcp
│ └── shared/ # generated from examples/memory-plugin-shared/lib
├── skills/openviking-memory/SKILL.md # teaches the model the recall + persist loop
+├── skills/ov-experience-memory/SKILL.md # retrieve and apply prior task Experience
└── plugin.test.mjs # node --test conformance checks
```
@@ -24,7 +25,7 @@ Zero npm dependencies — the proxy and the tests run on the Node.js standard li
1. Have an OpenViking server reachable. If you don't, follow the [Quickstart](../getting-started/02-quickstart.md); the default local endpoint is `http://127.0.0.1:1933`.
2. Point your Agent-Plugins-conforming client at the `agent-plugins/` directory. Each client has its own install command or plugin directory — consult its docs. On load the client will:
- register the `openviking` MCP server from `mcp.json`, running `node <plugin>/servers/mcp-proxy.mjs` over stdio;
- - discover the `openviking-memory` skill from `skills/`.
+ - discover the `openviking-memory` and `ov-experience-memory` skills from `skills/`.
3. Configure credentials (below) and start a session. The model gains `find` / `search` / `read` / `list` / `grep` / `glob` / `remember` / `add_resource` / `forget` / `health`, plus `tree` / `write` / `edit` on recent servers.
## Why a stdio proxy instead of a `streamable-http` entry
@@ -63,6 +64,8 @@ Agent Plugins 1.0 covers skills and MCP servers only — hooks, commands, and ag
The bundled `openviking-memory` skill compensates by teaching the model the full loop itself — recall at task start with `find` / `search` + `read` (using `search` with `mode="context"` when assembled context is useful), then persist durable facts with `remember` / `write` / `edit`, with priority and safety rules for using retrieved memory.
+The bundled `ov-experience-memory` skill has the model search `viking://~/memories/experiences` before executable work and read the Experience files that apply. Here it is retrieval-only: with no session capture, its reads are not linked back to the Experience they used and produce no new trajectories. The Experience it finds comes from harnesses that do capture sessions.
+
**If your harness has its own hook system, prefer the dedicated plugin.** Hook-driven recall and capture happen without the model spending tool calls or deciding to remember, which is both cheaper and more reliable than the skill-driven loop. Use this Agent Plugins package for harnesses that have no hooks, or when you want one package that works across many clients.
One installer covers Claude Code, Codex, Cursor, TRAE / TRAE CN, ZCode, OpenCode, and pi. It asks for your language, which harnesses to install, the download source, and your OpenViking credentials, and every step is idempotent:
diff --git a/docs/zh/agent-integrations/15-agent-plugins.md b/docs/zh/agent-integrations/15-agent-plugins.md
index 04f23816e..ffe70f71b 100644
--- a/docs/zh/agent-integrations/15-agent-plugins.md
+++ b/docs/zh/agent-integrations/15-agent-plugins.md
@@ -14,6 +14,7 @@ agent-plugins/
│ ├── mcp-proxy.mjs # stdio -> streamable-HTTP 代理,转发到服务端 /mcp
│ └── shared/ # 由 examples/memory-plugin-shared/lib 生成
├── skills/openviking-memory/SKILL.md # 教模型完成「召回 + 沉淀」闭环
+├── skills/ov-experience-memory/SKILL.md # 检索并应用以往任务的 Experience
└── plugin.test.mjs # node --test 规范一致性校验
```
@@ -24,7 +25,7 @@ agent-plugins/
1. 准备一个可访问的 OpenViking 服务。还没有的话,先按 [快速开始](../getting-started/02-quickstart.md) 部署;本地默认端点是 `http://127.0.0.1:1933`。
2. 让你的 Agent Plugins 客户端指向 `agent-plugins/` 目录。各客户端的安装命令或插件目录不同,请查阅其文档。加载时客户端会:
- 按 `mcp.json` 注册名为 `openviking` 的 MCP server,以 stdio 方式运行 `node <plugin>/servers/mcp-proxy.mjs`;
- - 从 `skills/` 发现 `openviking-memory` 技能。
+ - 从 `skills/` 发现 `openviking-memory` 和 `ov-experience-memory` 技能。
3. 配置凭据(见下节)后开始会话。模型即可使用 `find` / `search` / `read` / `list` / `grep` / `glob` / `remember` / `add_resource` / `forget` / `health`,较新的服务端还提供 `tree` / `write` / `edit`。
## 为什么用 stdio 代理,而不是 `streamable-http`
@@ -63,6 +64,8 @@ Agent Plugins 1.0 只覆盖 skills 和 MCP servers;hooks、commands、agents
作为补偿,内置的 `openviking-memory` 技能直接把这套闭环教给模型 —— 任务开始时用 `find` / `search` + `read` 召回(需要组装上下文时使用 `search` 的 `mode="context"`),过程中和结束后用 `remember` / `write` / `edit` 沉淀,并给出使用召回内容时的优先级与安全规则。
+内置的 `ov-experience-memory` 技能让模型在执行类任务前检索 `viking://~/memories/experiences`,并读取适用的 Experience 文件。在这个包里它只做检索:没有会话捕获,这些读取不会关联回所用的 Experience,也不会产生新的轨迹。它检索到的 Experience 来自会捕获会话的 harness。
+
**如果你的 harness 支持 hooks 机制,推荐使用专属插件。** hook 驱动的召回与捕获不需要模型花费工具调用、也不依赖模型「想起来要记」,比技能驱动的闭环更省 token、也更可靠。本 Agent Plugins 包适用于没有 hooks 的 harness,或你希望用同一个包覆盖多个客户端的场景。
Claude Code、Codex、Cursor、TRAE / TRAE CN、ZCode、OpenCode、pi 共用同一个安装脚本。它会依次询问界面语言、要安装的 harness、下载源和 OpenViking 凭据,所有步骤幂等,重复运行安全:
diff --git a/examples/memory-plugin-shared/sync.mjs b/examples/memory-plugin-shared/sync.mjs
index 43d34bcf0..92b7b5bbe 100644
--- a/examples/memory-plugin-shared/sync.mjs
+++ b/examples/memory-plugin-shared/sync.mjs
@@ -104,7 +104,9 @@ export const SKILL_TARGETS = [
dir: join(ROOT, "examples", "dsh-memory-plugin", "skills"),
committed: true,
},
- // Only the two harnesses that ship the experience workflow today.
+ // The harnesses that ship the experience workflow today. agent-plugins has
+ // no hooks and so no session capture: its copy only retrieves and applies
+ // Experience, and its reads feed no trajectory back to the server.
{
skill: "ov-experience-memory",
dir: join(ROOT, "examples", "codex-memory-plugin", "skills"),
@@ -115,6 +117,11 @@ export const SKILL_TARGETS = [
dir: join(ROOT, "examples", "claude-code-memory-plugin", "skills"),
committed: true,
},
+ {
+ skill: "ov-experience-memory",
+ dir: join(ROOT, "agent-plugins", "skills"),
+ committed: true,
+ },
];
const SOURCE_EXTENSIONS = new Set([".mjs", ".js", ".cjs", ".ts", ".mts"]);