Self-evolving Context Database for AI Agents. Unify Agent Memory, Knowledge RAG and Skills.
Python agent-contextagent-memoryagent-pluginsagentic-ragcontext-databasedsh-pluginknowledge-basememorymemory-managementself-evolvingvector-database
fix(skills): 让 Experience 技能兼容没有 viking://~ 的旧服务端 (#4857)
t0saki3ae94afeea04
diff --git a/agent-plugins/plugin.json b/agent-plugins/plugin.jsonindex 34f1878cf..9226437c5 100644--- a/agent-plugins/plugin.json+++ b/agent-plugins/plugin.json@@ -1,7 +1,7 @@{"$schema": "https://agent-plugins.org/schemas/1.0.0/plugin.schema.json","name": "openviking",- "version": "0.1.0",+ "version": "0.1.1","description": "Semantic long-term memory and context engine for coding agents. Recall prior knowledge with the find/search/read MCP tools and persist durable facts with remember/write, backed by an OpenViking server.","author": {"name": "Volcano Engine",diff --git a/agent-plugins/skills/openviking-memory/SKILL.md b/agent-plugins/skills/openviking-memory/SKILL.mdindex cf46ff535..45a02f57e 100644--- a/agent-plugins/skills/openviking-memory/SKILL.md+++ b/agent-plugins/skills/openviking-memory/SKILL.md@@ -37,7 +37,12 @@ without memory.`limit` around 5-10. Use `search` when deeper intent analysis helps, or use`search` with `mode="context"` for a server-assembled, token-budgetedcontext block. In list mode, scope with `target_uri` when you know where to look, e.g.- `viking://~/memories/experiences` for prior task experience.+ `viking://~/memories/experiences` for prior task experience. `viking://~` is+ the home alias for your own user root; a server that predates the alias+ rejects every `viking://~` URI with `INVALID_URI`. Against such a server use+ the explicit `viking://user/<user_id>/...` root taken from a URI already+ visible in this session, or drop `target_uri` and keep the hits whose URI+ contains `/memories/experiences/`. Never guess a user ID.4. Judge results by task and environment fit, not title similarity. `read` theone to three exact file URIs likely to change how you execute. Ignoresidecar files such as `.abstract.md`, `.overview.md`, anddiff --git a/examples/claude-code-memory-plugin/.claude-plugin/plugin.json b/examples/claude-code-memory-plugin/.claude-plugin/plugin.jsonindex 5ad01512f..a64d33f42 100644--- a/examples/claude-code-memory-plugin/.claude-plugin/plugin.json+++ b/examples/claude-code-memory-plugin/.claude-plugin/plugin.json@@ -1,6 +1,6 @@{"name": "openviking-memory",- "version": "0.4.5",+ "version": "0.4.6","description": "Long-term semantic memory for Claude Code, powered by OpenViking. Auto-recall relevant memories at session start and capture important information during conversations.","author": {"name": "OpenViking",diff --git a/examples/claude-code-memory-plugin/package.json b/examples/claude-code-memory-plugin/package.jsonindex e9750dbc8..d4d7c2cbf 100644--- a/examples/claude-code-memory-plugin/package.json+++ b/examples/claude-code-memory-plugin/package.json@@ -1,6 +1,6 @@{"name": "claude-code-openviking-memory",- "version": "0.4.5",+ "version": "0.4.6","description": "OpenViking memory plugin for Claude Code — semantic long-term memory","type": "module","scripts": {diff --git a/examples/claude-code-memory-plugin/skills/ov-experience-memory/SKILL.md b/examples/claude-code-memory-plugin/skills/ov-experience-memory/SKILL.mdindex c70110027..7c6e030c8 100644--- a/examples/claude-code-memory-plugin/skills/ov-experience-memory/SKILL.md+++ b/examples/claude-code-memory-plugin/skills/ov-experience-memory/SKILL.md@@ -55,7 +55,8 @@ context or deeper intent analysis is useful.For tools using MCP-style parameters, set `target_uri` to this root. ForOpenClaw `ov_search`, set `uri` to this root. Never hardcode `default`,- `test`, or another user ID.+ `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 bytask, environment, preconditions, and likely effect; title similarity aloneis insufficient. If no result is relevant, continue without Experience and@@ -73,6 +74,26 @@ context or deeper intent analysis is useful.follow-up search using the failure evidence, then read only newly relevantExperience 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,diff --git a/examples/codex-memory-plugin/.codex-plugin/plugin.json b/examples/codex-memory-plugin/.codex-plugin/plugin.jsonindex 7225cd17e..de349c661 100644--- a/examples/codex-memory-plugin/.codex-plugin/plugin.json+++ b/examples/codex-memory-plugin/.codex-plugin/plugin.json@@ -1,6 +1,6 @@{"name": "openviking-memory",- "version": "0.8.1",+ "version": "0.8.2","description": "Long-term semantic memory for Codex, powered by OpenViking. Recall on UserPromptSubmit, incremental add_message on Stop (per turn), commit on SessionEnd (Codex >= 0.145) and on PreCompact, with an idle/ended sweep on SessionStart as the fallback for signals, crashes and older Codex builds. Includes a local stdio MCP proxy that reads OpenViking credentials from env/ovcli.conf.","author": {"name": "OpenViking",diff --git a/examples/codex-memory-plugin/skills/ov-experience-memory/SKILL.md b/examples/codex-memory-plugin/skills/ov-experience-memory/SKILL.mdindex c70110027..7c6e030c8 100644--- a/examples/codex-memory-plugin/skills/ov-experience-memory/SKILL.md+++ b/examples/codex-memory-plugin/skills/ov-experience-memory/SKILL.md@@ -55,7 +55,8 @@ context or deeper intent analysis is useful.For tools using MCP-style parameters, set `target_uri` to this root. ForOpenClaw `ov_search`, set `uri` to this root. Never hardcode `default`,- `test`, or another user ID.+ `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 bytask, environment, preconditions, and likely effect; title similarity aloneis insufficient. If no result is relevant, continue without Experience and@@ -73,6 +74,26 @@ context or deeper intent analysis is useful.follow-up search using the failure evidence, then read only newly relevantExperience 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,diff --git a/examples/memory-plugin-shared/sync.test.mjs b/examples/memory-plugin-shared/sync.test.mjsindex c93d162c0..aa3899ab1 100644--- a/examples/memory-plugin-shared/sync.test.mjs+++ b/examples/memory-plugin-shared/sync.test.mjs@@ -113,6 +113,30 @@ async function findSkillFiles(dir) {return found;}+// viking://~ is the home alias for the caller's own space, and a server older+// than the alias rejects it outright instead of searching. A skill that sends+// the agent to the Experience root therefore has to name the explicit+// viking://user/<user_id> root it falls back to, or the whole workflow stops+// against those servers.+test("skills scoping the Experience root document the explicit-root fallback", async () => {+ const files = [+ ...(await findSkillFiles(join(ROOT, "examples"))),+ ...(await findSkillFiles(join(ROOT, "agent-plugins"))),+ ];+ const scoped = [];+ for (const file of files) {+ const source = await readFile(file, "utf-8");+ if (!source.includes("viking://~/memories/experiences")) continue;+ scoped.push(file);+ assert.match(+ source,+ /viking:\/\/user\/<user_id>/,+ `${relative(ROOT, file)} scopes by viking://~ without naming the viking://user/<user_id> fallback`,+ );+ }+ assert.ok(scoped.length > 0, "expected at least one skill scoping the Experience root");+});+test("shipped skill descriptions stay within the loader limit", async () => {const files = await findSkillFiles(join(ROOT, "examples"));assert.ok(files.length > 0, "expected at least one SKILL.md");diff --git a/examples/openclaw-plugin/skills/ov-experience-memory/SKILL.md b/examples/openclaw-plugin/skills/ov-experience-memory/SKILL.mdindex c70110027..7c6e030c8 100644--- a/examples/openclaw-plugin/skills/ov-experience-memory/SKILL.md+++ b/examples/openclaw-plugin/skills/ov-experience-memory/SKILL.md@@ -55,7 +55,8 @@ context or deeper intent analysis is useful.For tools using MCP-style parameters, set `target_uri` to this root. ForOpenClaw `ov_search`, set `uri` to this root. Never hardcode `default`,- `test`, or another user ID.+ `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 bytask, environment, preconditions, and likely effect; title similarity aloneis insufficient. If no result is relevant, continue without Experience and@@ -73,6 +74,26 @@ context or deeper intent analysis is useful.follow-up search using the failure evidence, then read only newly relevantExperience 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,diff --git a/examples/skills/ov-experience-memory/SKILL.md b/examples/skills/ov-experience-memory/SKILL.mdindex c70110027..7c6e030c8 100644--- a/examples/skills/ov-experience-memory/SKILL.md+++ b/examples/skills/ov-experience-memory/SKILL.md@@ -55,7 +55,8 @@ context or deeper intent analysis is useful.For tools using MCP-style parameters, set `target_uri` to this root. ForOpenClaw `ov_search`, set `uri` to this root. Never hardcode `default`,- `test`, or another user ID.+ `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 bytask, environment, preconditions, and likely effect; title similarity aloneis insufficient. If no result is relevant, continue without Experience and@@ -73,6 +74,26 @@ context or deeper intent analysis is useful.follow-up search using the failure evidence, then read only newly relevantExperience 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,