@openviking/openclaw-plugin 2026.6.2 → 2026.6.17-dev.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/INSTALL-AGENT.md +4 -4
- package/INSTALL-ZH.md +68 -8
- package/INSTALL.md +12 -8
- package/README.md +45 -35
- package/adapters/http-transport.ts +3 -0
- package/adapters/resource-packager.ts +141 -0
- package/auto-recall.ts +258 -27
- package/client.ts +201 -177
- package/commands/setup.ts +200 -33
- package/config/feature-gates.json +10 -0
- package/config.ts +428 -85
- package/context-engine.ts +71 -1402
- package/dist/adapters/http-transport.js +1 -0
- package/dist/adapters/resource-packager.js +114 -0
- package/dist/auto-recall.js +201 -25
- package/dist/client.js +125 -161
- package/dist/commands/setup.js +170 -32
- package/dist/config.js +285 -64
- package/dist/context-engine.js +62 -1173
- package/dist/index.js +209 -1489
- package/dist/memory-ranking.js +35 -12
- package/dist/plugin/command-registration.js +5 -0
- package/dist/plugin/openviking-archive-tools.js +210 -0
- package/dist/plugin/openviking-bypass-runtime.js +8 -0
- package/dist/plugin/openviking-client-runtime.js +28 -0
- package/dist/plugin/openviking-command-args.js +146 -0
- package/dist/plugin/openviking-command-definitions.js +206 -0
- package/dist/plugin/openviking-context-engine-ref.js +11 -0
- package/dist/plugin/openviking-context-engine-registration.js +23 -0
- package/dist/plugin/openviking-feature-gates.js +250 -0
- package/dist/plugin/openviking-import-runtime.js +50 -0
- package/dist/plugin/openviking-import-tools.js +86 -0
- package/dist/plugin/openviking-lifecycle-hooks.js +33 -0
- package/dist/plugin/openviking-memory-recall-tools.js +233 -0
- package/dist/plugin/openviking-memory-tools.js +199 -0
- package/dist/plugin/openviking-query-config-command.js +203 -0
- package/dist/plugin/openviking-query-runtime.js +367 -0
- package/dist/plugin/openviking-query-tools.js +91 -0
- package/dist/plugin/openviking-recall-trace-runtime.js +387 -0
- package/dist/plugin/openviking-recall-trace-tools.js +38 -0
- package/dist/plugin/openviking-runtime-state.js +26 -0
- package/dist/plugin/openviking-runtime-utils.js +62 -0
- package/dist/plugin/openviking-services.js +20 -0
- package/dist/plugin/openviking-session-routing-runtime.js +61 -0
- package/dist/plugin/openviking-tool-result-tools.js +268 -0
- package/dist/plugin/recall-trace-routes.js +77 -0
- package/dist/plugin/tool-registration.js +23 -0
- package/dist/process-manager.js +1 -1
- package/dist/query-config.js +336 -0
- package/dist/recall-trace.js +309 -0
- package/dist/registries/recall-resource-types.js +58 -0
- package/dist/routing/identity-routing.js +152 -0
- package/dist/routing/memory-uri.js +7 -0
- package/dist/services/context-lifecycle-service.js +847 -0
- package/dist/services/context-message-adapter.js +340 -0
- package/dist/session-transcript-repair.js +0 -1
- package/dist/text-utils.js +14 -31
- package/index.ts +271 -1873
- package/install-manifest.json +10 -1
- package/memory-ranking.ts +46 -10
- package/openclaw.plugin.json +198 -36
- package/package.json +14 -4
- package/plugin/command-registration.ts +34 -0
- package/plugin/openviking-archive-tools.ts +301 -0
- package/plugin/openviking-bypass-runtime.ts +26 -0
- package/plugin/openviking-client-runtime.ts +74 -0
- package/plugin/openviking-command-args.ts +187 -0
- package/plugin/openviking-command-definitions.ts +294 -0
- package/plugin/openviking-context-engine-ref.ts +16 -0
- package/plugin/openviking-context-engine-registration.ts +97 -0
- package/plugin/openviking-feature-gates.ts +335 -0
- package/plugin/openviking-import-runtime.ts +105 -0
- package/plugin/openviking-import-tools.ts +133 -0
- package/plugin/openviking-lifecycle-hooks.ts +65 -0
- package/plugin/openviking-memory-recall-tools.ts +368 -0
- package/plugin/openviking-memory-tools.ts +299 -0
- package/plugin/openviking-query-config-command.ts +230 -0
- package/plugin/openviking-query-formatters.ts +108 -0
- package/plugin/openviking-query-runtime.ts +476 -0
- package/plugin/openviking-query-tools.ts +161 -0
- package/plugin/openviking-recall-trace-runtime.ts +482 -0
- package/plugin/openviking-recall-trace-tools.ts +99 -0
- package/plugin/openviking-runtime-state.ts +52 -0
- package/plugin/openviking-runtime-utils.ts +67 -0
- package/plugin/openviking-services.ts +49 -0
- package/plugin/openviking-session-routing-runtime.ts +105 -0
- package/plugin/openviking-tool-result-tools.ts +397 -0
- package/plugin/recall-trace-routes.ts +133 -0
- package/plugin/tool-registration.ts +51 -0
- package/process-manager.ts +1 -1
- package/query-config.ts +400 -0
- package/recall-trace.ts +442 -0
- package/registries/openviking-tools.ts +84 -0
- package/registries/recall-resource-types.ts +74 -0
- package/routing/identity-routing.ts +210 -0
- package/routing/memory-uri.ts +8 -0
- package/services/context-lifecycle-service.ts +1209 -0
- package/services/context-message-adapter.ts +375 -0
- package/services/setup/config-writer.ts +125 -0
- package/services/setup/exit-utils.ts +5 -0
- package/services/setup/package-metadata.ts +56 -0
- package/services/setup/probe-service.ts +143 -0
- package/services/setup/setup-flow.ts +306 -0
- package/services/setup/version-compatibility.ts +41 -0
- package/session-transcript-repair.ts +0 -2
- package/skills/install-openviking-memory/SKILL.md +123 -50
- package/skills/openviking-context-database/SKILL.md +286 -0
- package/text-utils.ts +15 -34
|
@@ -13,7 +13,7 @@ description: >
|
|
|
13
13
|
The user does NOT need to know any CLI commands — the agent runs everything and only asks for a few values.
|
|
14
14
|
This skill assumes the OpenViking server is already running. If the server is not ready, the skill
|
|
15
15
|
tells the user to contact their admin or set it up via the OpenViking docs — it does NOT install the server.
|
|
16
|
-
version:
|
|
16
|
+
version: 2026.6.5
|
|
17
17
|
metadata:
|
|
18
18
|
openclaw:
|
|
19
19
|
requires:
|
|
@@ -118,7 +118,7 @@ Send this message:
|
|
|
118
118
|
> I need 3 things (ask your admin if unsure):
|
|
119
119
|
> 1. **OpenViking server URL** — e.g. `https://ov.example.com` or `http://192.168.1.100:1933`. For a local server, just say "local".
|
|
120
120
|
> 2. **API Key** — for auth. Say "none" if the server has no auth.
|
|
121
|
-
> 3. **
|
|
121
|
+
> 3. **peer prefix** (optional) — used to namespace memories across agents. Leave blank for default.
|
|
122
122
|
>
|
|
123
123
|
> What's the server URL?
|
|
124
124
|
|
|
@@ -144,10 +144,10 @@ Collect 3 values through natural conversation. Be flexible: if the user gives se
|
|
|
144
144
|
- "no" / "none" / "没有" / "空" / empty → `API_KEY=""` (you will skip the flag later).
|
|
145
145
|
- Otherwise store as-is.
|
|
146
146
|
|
|
147
|
-
### 4c. `
|
|
147
|
+
### 4c. `PEER_PREFIX` (OPTIONAL)
|
|
148
148
|
|
|
149
149
|
> (CN) 想给这个 agent 一个记忆前缀吗?留空就用默认。只能用字母、数字、`_`、`-`。
|
|
150
|
-
> (EN) Want to set an
|
|
150
|
+
> (EN) Want to set an peer prefix? Leave blank for the default. Letters, digits, `_`, `-` only.
|
|
151
151
|
|
|
152
152
|
- Empty / "default" / "默认" → leave unset (plugin defaults to `""`).
|
|
153
153
|
- Otherwise validate against `/^[A-Za-z0-9_-]+$/`. If invalid, ask again.
|
|
@@ -262,14 +262,14 @@ Tell the user:
|
|
|
262
262
|
Run the installer with `npx` (no global install needed):
|
|
263
263
|
|
|
264
264
|
```bash
|
|
265
|
-
npx -y openclaw-openviking-setup-helper@latest --base-url BASE_URL [--api-key API_KEY] [--
|
|
265
|
+
npx -y openclaw-openviking-setup-helper@latest --base-url BASE_URL [--api-key API_KEY] [--peer-prefix PEER_PREFIX] [--account-id ACCOUNT_ID] [--user-id USER_ID]
|
|
266
266
|
```
|
|
267
267
|
|
|
268
268
|
Build the flag list according to what the user gave you:
|
|
269
269
|
|
|
270
270
|
- Always pass `--base-url BASE_URL`.
|
|
271
271
|
- Pass `--api-key API_KEY` only if `API_KEY` is non-empty.
|
|
272
|
-
- Pass `--
|
|
272
|
+
- Pass `--peer-prefix PEER_PREFIX` only if the user gave one.
|
|
273
273
|
- `--account-id` / `--user-id` only if the root-key path requires them.
|
|
274
274
|
|
|
275
275
|
`ov-install` will, in one shot:
|
|
@@ -290,14 +290,14 @@ If `ov-install` exits non-zero, capture the last 30 lines of its output, show th
|
|
|
290
290
|
Run the setup wizard non-interactively. Build flags from collected values:
|
|
291
291
|
|
|
292
292
|
```bash
|
|
293
|
-
openclaw openviking setup --base-url BASE_URL --json [--api-key API_KEY] [--
|
|
293
|
+
openclaw openviking setup --base-url BASE_URL --json [--api-key API_KEY] [--peer-prefix PEER_PREFIX] [--account-id ACCOUNT_ID] [--user-id USER_ID] [--allow-offline] [--force-slot]
|
|
294
294
|
```
|
|
295
295
|
|
|
296
296
|
Rules:
|
|
297
297
|
|
|
298
298
|
- `--base-url BASE_URL` is **required** under `--json`. Without it, the wizard prints `--json requires --base-url for non-interactive mode`.
|
|
299
299
|
- `--api-key` only if `API_KEY` is non-empty.
|
|
300
|
-
- `--
|
|
300
|
+
- `--peer-prefix` only if the user gave one. Use **`--peer-prefix`** for assistant peer prefixes; the old ID-style setup flag is no longer supported.
|
|
301
301
|
- `--account-id` / `--user-id` only after STEP 7 root-key detection (see below).
|
|
302
302
|
- `--allow-offline` only if the user explicitly approved it in STEP 5.
|
|
303
303
|
- `--force-slot` **never** in the first attempt. Add only after the user confirms (see slot_blocked handling below).
|
|
@@ -310,10 +310,10 @@ The wizard prints a single JSON object:
|
|
|
310
310
|
{
|
|
311
311
|
"success": true | false,
|
|
312
312
|
"action": "configured" | "existing" | "error" | "slot_blocked",
|
|
313
|
-
"config": { "mode": "remote", "baseUrl": "...", "apiKey": "...", "
|
|
314
|
-
"health": { "ok": true, "
|
|
315
|
-
"keyProbe": { "keyType": "user_key" | "root_key" | "
|
|
316
|
-
"slot": { "
|
|
313
|
+
"config": { "mode": "remote", "baseUrl": "...", "apiKey": "...", "peer_prefix": "...", "accountId": "...", "userId": "..." },
|
|
314
|
+
"health": { "ok": true, "version": "...", "compatibility": "compatible" | "server_too_old" | "server_too_new" | "unknown" },
|
|
315
|
+
"keyProbe": { "keyType": "user_key" | "root_key" | "no_key" | "unknown", "needsAccountId": false, "needsUserId": false, "detail": "..." },
|
|
316
|
+
"slot": { "activated": true, "replaced": false, "previousOwner": "openviking" },
|
|
317
317
|
"error": "..."
|
|
318
318
|
}
|
|
319
319
|
```
|
|
@@ -326,7 +326,7 @@ The wizard prints a single JSON object:
|
|
|
326
326
|
| `success: false` and `action: "slot_blocked"` | **Slot conflict — see below.** |
|
|
327
327
|
| `success: false` and `error` contains `"Server unreachable"` | Connectivity broke between STEP 5 and STEP 7. Offer `--allow-offline`; if accepted, retry. Otherwise back to STEP 4a. |
|
|
328
328
|
| `success: false` and `error` contains `"Root API key detected"` and `"Missing: --account-id, --user-id"` | **Root-key path — see below.** |
|
|
329
|
-
| `success: false` and `error` contains `"Invalid API key"` / `keyProbe.keyType: "
|
|
329
|
+
| `success: false` and `error` contains `"Invalid API key"` / `keyProbe.keyType: "unknown"` after auth failure detail | API key wrong. Back to STEP 4b. |
|
|
330
330
|
| `success: false` and any other `action: "error"` | Show `error` to the user, stop. Do NOT pretend success. |
|
|
331
331
|
|
|
332
332
|
### Slot conflict (`slot_blocked`)
|
|
@@ -397,7 +397,7 @@ Expected output:
|
|
|
397
397
|
"configured": true,
|
|
398
398
|
"slotActive": true,
|
|
399
399
|
"health": { "ok": true },
|
|
400
|
-
"config": { "baseUrl": "...", "
|
|
400
|
+
"config": { "baseUrl": "...", "peer_prefix": "..." }
|
|
401
401
|
}
|
|
402
402
|
```
|
|
403
403
|
|
|
@@ -413,22 +413,20 @@ Expected output:
|
|
|
413
413
|
> (CN) 🎉 全部搞定!OpenViking 长期记忆已经接好了。
|
|
414
414
|
>
|
|
415
415
|
> 工作方式:
|
|
416
|
-
> -
|
|
417
|
-
> -
|
|
418
|
-
> - **`/compact` 时**:待提交的 session 消息会被抽取成长期记忆,写到 `~/.openviking/data/` 下
|
|
416
|
+
> - **每一轮**:你的对话会被自动归档到 OpenViking session 里
|
|
417
|
+
> - **`/compact` 时**:归档消息会在 OpenViking 服务端被抽取成长期记忆
|
|
419
418
|
> - **后续会话**:每次回复前我都会自动搜一下相关记忆并带进上下文
|
|
420
419
|
>
|
|
421
|
-
>
|
|
420
|
+
> 想验证一下吗?跟我聊几句包含可记忆事实的话(例如"我的邮箱是 test@example.com"),然后调一下 `/compact`,再开新对话问"我的邮箱是?",应该就能召回了。
|
|
422
421
|
|
|
423
422
|
> (EN) 🎉 All set! OpenViking long-term memory is connected.
|
|
424
423
|
>
|
|
425
424
|
> How it works:
|
|
426
|
-
> - **Every turn**: our messages are
|
|
427
|
-
> - **
|
|
428
|
-
> - **On `/compact`**: pending session messages are extracted into long-term memories under `~/.openviking/data/`
|
|
425
|
+
> - **Every turn**: our messages are auto-archived into an OpenViking session
|
|
426
|
+
> - **On `/compact`**: archived messages are extracted into long-term memories on the OpenViking server
|
|
429
427
|
> - **Future sessions**: relevant memories are auto-retrieved and injected before my replies
|
|
430
428
|
>
|
|
431
|
-
> Want to verify?
|
|
429
|
+
> Want to verify? Tell me a few facts (e.g. "my email is test@example.com"), run `/compact`, then start a new chat and ask "what's my email?" — it should recall.
|
|
432
430
|
|
|
433
431
|
---
|
|
434
432
|
|
|
@@ -436,25 +434,15 @@ Expected output:
|
|
|
436
434
|
|
|
437
435
|
## How It Works
|
|
438
436
|
|
|
439
|
-
The context-engine pipeline has three distinct stages
|
|
437
|
+
The context-engine pipeline has three distinct stages — keep them apart, especially when telling users when memories become searchable long-term memory on the OpenViking server:
|
|
440
438
|
|
|
441
|
-
- **Archive / capture (context-engine `afterTurn`)**: at the end of a user turn, the plugin
|
|
442
|
-
- **Memory extraction (
|
|
439
|
+
- **Archive / capture (context-engine `afterTurn`)**: at the end of a user turn, the plugin commits user/assistant messages to the OpenViking session via `POST /api/v1/sessions/.../messages`. This is **archive only** — no memory extraction yet. You'll see session message counts grow on the server, but no new files under `viking://user/.../memories/`.
|
|
440
|
+
- **Memory extraction (on `/compact`)**: memory extraction runs when the user invokes OpenClaw's `/compact` command. The server-side extraction pipeline reads the archived session and writes new memories. The plugin's `after_compaction` hook is currently reserved; the extraction itself is driven by the server. **No `/compact`, no new memory files.**
|
|
443
441
|
- `captureMode: "semantic"` (default): server extraction pipeline filters all qualifying text.
|
|
444
442
|
- `captureMode: "keyword"`: only text matching trigger words (e.g. "remember", "preference") is considered.
|
|
445
443
|
- **Auto-Recall (context-engine `assemble()`)**: before prompt context is assembled, the plugin queries OpenViking for relevant memories and injects them into context. Recall works even when there are no extracted memories yet — you just won't see anything come back.
|
|
446
444
|
|
|
447
|
-
**Practical implication for testing**: if you write down a
|
|
448
|
-
|
|
449
|
-
### Explicit long-term memory writes
|
|
450
|
-
|
|
451
|
-
Auto-capture is best-effort and commit-dependent. When the user explicitly says to remember, save, or store an important long-term fact, preference, project, or decision, the agent should call `memory_store` instead of waiting for ordinary auto-capture.
|
|
452
|
-
|
|
453
|
-
Use `memory_store` as the integration-side reliable path for durable-memory intent:
|
|
454
|
-
|
|
455
|
-
- It writes the supplied text into an OpenViking session and calls `commit(wait=true)`.
|
|
456
|
-
- It complements auto-capture; it does not replace normal session capture.
|
|
457
|
-
- If it commits but extracts 0 memories, the explicit path has done its job. Treat that as a server-side extraction/model/configuration issue and check OpenViking logs.
|
|
445
|
+
**Practical implication for testing**: if you write down a fact and immediately try to recall it without `/compact`, the plugin will only retrieve it as recent session context (archived messages), not as a long-term memory. To verify long-term memory cross-session, you must run `/compact` first.
|
|
458
446
|
|
|
459
447
|
## Available Tools
|
|
460
448
|
|
|
@@ -467,7 +455,8 @@ These are the plugin tools the agent can call once installed.
|
|
|
467
455
|
| `query` | Yes | Search query text |
|
|
468
456
|
| `limit` | No | Maximum number of results (defaults to plugin config) |
|
|
469
457
|
| `scoreThreshold` | No | Minimum relevance score 0–1 (defaults to plugin config) |
|
|
470
|
-
| `targetUri` | No |
|
|
458
|
+
| `targetUri` | No | Exact search scope URI. If provided, only that URI is searched. |
|
|
459
|
+
| `resourceTypes` | No | Array of target types used when `targetUri` is omitted: `resource`, `user`, `agent`. Defaults to plugin `recallTargetTypes`. |
|
|
471
460
|
|
|
472
461
|
Example: user asks "What programming language did I say I like?"
|
|
473
462
|
|
|
@@ -479,8 +468,6 @@ Example: user asks "What programming language did I say I like?"
|
|
|
479
468
|
| `role` | No | Session role (default `user`) |
|
|
480
469
|
| `sessionId` | No | Existing OpenViking session ID |
|
|
481
470
|
|
|
482
|
-
Use this when the user explicitly asks to remember/save/store a long-term fact, preference, project, or decision.
|
|
483
|
-
|
|
484
471
|
Example: user says "Remember my email is xxx@example.com".
|
|
485
472
|
|
|
486
473
|
### `memory_forget` — Delete Memories
|
|
@@ -495,6 +482,87 @@ Example: user says "Remember my email is xxx@example.com".
|
|
|
495
482
|
|
|
496
483
|
Example: user says "Forget my phone number".
|
|
497
484
|
|
|
485
|
+
### `ov_archive_search` — Search Archived Original Messages
|
|
486
|
+
|
|
487
|
+
| Parameter | Required | Description |
|
|
488
|
+
|---|---|---|
|
|
489
|
+
| `query` | Yes | A single keyword or short phrase. Prefer concrete names, dates, commands, paths, or distinctive nouns. |
|
|
490
|
+
| `archiveId` | No | Optional archive ID such as `archive_002`. |
|
|
491
|
+
|
|
492
|
+
Use when `[Session History Summary]` is too coarse. Try at least two keyword variants before concluding the detail is unavailable.
|
|
493
|
+
|
|
494
|
+
### `ov_archive_expand` — Expand An Archive
|
|
495
|
+
|
|
496
|
+
| Parameter | Required | Description |
|
|
497
|
+
|---|---|---|
|
|
498
|
+
| `archiveId` | Yes | Archive ID from `[Archive Index]`, e.g. `archive_002`. |
|
|
499
|
+
|
|
500
|
+
### `add_resource` — Import Resource
|
|
501
|
+
|
|
502
|
+
The agent-visible `add_resource` tool is disabled by default (`enableAddResourceTool=false`). Use manual `/add-resource` for resource ingestion unless you explicitly opt in. Even when enabled, never use `add_resource` during search, retrieval, URI reading, or search-result optimization; use `ov_search` and `ov_read` for those flows.
|
|
503
|
+
|
|
504
|
+
| Parameter | Required | Description |
|
|
505
|
+
|---|---|---|
|
|
506
|
+
| `source` | Yes | Local path, OpenClaw media attachment path, directory path, public URL, or Git URL. |
|
|
507
|
+
| `to` | No | Exact target URI under `viking://resources`; mutually exclusive with `parent`. |
|
|
508
|
+
| `parent` | No | Parent URI under `viking://resources`; mutually exclusive with `to`. |
|
|
509
|
+
| `reason` | No | Reason or note for import. |
|
|
510
|
+
| `instruction` | No | Processing instruction for semantic extraction. |
|
|
511
|
+
| `wait` | No | Wait for processing completion. |
|
|
512
|
+
| `timeout` | No | Timeout in seconds when `wait=true`. |
|
|
513
|
+
|
|
514
|
+
### `add_skill` — Import Agent Skill
|
|
515
|
+
|
|
516
|
+
| Parameter | Required | Description |
|
|
517
|
+
|---|---|---|
|
|
518
|
+
| `source` | No | Local `SKILL.md` path or skill directory. Exactly one of `source` or `data` is required. |
|
|
519
|
+
| `data` | No | Raw `SKILL.md` content or MCP tool dict. Exactly one of `source` or `data` is required. |
|
|
520
|
+
| `wait` | No | Wait for processing completion. |
|
|
521
|
+
| `timeout` | No | Timeout in seconds when `wait=true`. |
|
|
522
|
+
|
|
523
|
+
Agent Skill best practice: verify frontmatter has a precise `name`, a trigger-oriented `description`, useful `tags`, explicit scope boundaries, and concrete execution steps. Do not include secrets in skill content.
|
|
524
|
+
|
|
525
|
+
### `ov_search` — Search Resources and Skills
|
|
526
|
+
|
|
527
|
+
| Parameter | Required | Description |
|
|
528
|
+
|---|---|---|
|
|
529
|
+
| `query` | Yes | Search query. |
|
|
530
|
+
| `uri` | No | Optional search URI. Defaults to resources plus agent skills. |
|
|
531
|
+
| `limit` | No | Max results per search scope. Default: 10. |
|
|
532
|
+
|
|
533
|
+
Important: `ov_search` result URIs are OpenViking virtual URIs, not local file paths. If full content is needed, call `ov_read` with the exact `viking://...` URI returned by search or trace results; do not use filesystem read tools.
|
|
534
|
+
|
|
535
|
+
### `ov_read` — Read OpenViking Content
|
|
536
|
+
|
|
537
|
+
| Parameter | Required | Description |
|
|
538
|
+
|---|---|---|
|
|
539
|
+
| `uri` | Yes | Exact `viking://...` URI returned by `ov_search` or recall trace results. Local file paths and `openviking://...` display aliases are refused. |
|
|
540
|
+
|
|
541
|
+
### `ov_recall_trace` — Query Recall Trace
|
|
542
|
+
|
|
543
|
+
| Parameter | Required | Description |
|
|
544
|
+
|---|---|---|
|
|
545
|
+
| `turn` | No | `latest` or `all`; default `latest`. |
|
|
546
|
+
| `traceId` | No | Exact trace ID. |
|
|
547
|
+
| `sessionId` / `sessionKey` / `ovSessionId` | No | Session filters. |
|
|
548
|
+
| `source` | No | `auto_recall`, `memory_recall`, `ov_search`, or `ov_archive_search`. |
|
|
549
|
+
| `resourceTypes` | No | Target type filters: `resource`, `user`, `agent`. |
|
|
550
|
+
| `since` / `until` | No | Unix timestamp bounds in milliseconds. |
|
|
551
|
+
| `includeContent` | No | Read selected/displayed URI content previews on demand. |
|
|
552
|
+
| `limit` | No | Maximum traces to return. Default: 20. |
|
|
553
|
+
|
|
554
|
+
Requires `traceRecall=true`; persisted lookup also requires `traceRecallPersist=true`.
|
|
555
|
+
|
|
556
|
+
### Externalized Tool Result Tools
|
|
557
|
+
|
|
558
|
+
Use these when a preview contains a `viking://session/<session_id>/tool-results/<tool_result_id>` ref.
|
|
559
|
+
|
|
560
|
+
| Tool | Parameters |
|
|
561
|
+
|---|---|
|
|
562
|
+
| `openviking_tool_result_list` | `tool_name?`, `limit?` (default 50) |
|
|
563
|
+
| `openviking_tool_result_search` | `tool_output_ref`, `query`, `limit?` (default 20), `context_chars?` (default 300) |
|
|
564
|
+
| `openviking_tool_result_read` | `tool_output_ref`, `offset?` (default 0), `limit?` (default 20000) |
|
|
565
|
+
|
|
498
566
|
## Configuration Schema
|
|
499
567
|
|
|
500
568
|
These are the keys under `plugins.entries.openviking.config` in `openclaw.json`. The setup wizard / `ov-install` sets the first few; the rest are tunables.
|
|
@@ -504,27 +572,32 @@ These are the keys under `plugins.entries.openviking.config` in `openclaw.json`.
|
|
|
504
572
|
| `mode` | `"remote"` (forced by plugin) | Always remote in this skill. Don't set manually. |
|
|
505
573
|
| `baseUrl` | `http://127.0.0.1:1933` | OpenViking server URL. |
|
|
506
574
|
| `apiKey` | — | API key. Optional if server has no auth. |
|
|
507
|
-
| `
|
|
575
|
+
| `peer_role` | `assistant` | Peer identity mode: `none`, `assistant`, or `person`. Session messages use body `peer_id`; data-plane recall/search uses `X-OpenViking-Actor-Peer`. |
|
|
576
|
+
| `peer_prefix` | `""` | Optional prefix for assistant `peer_id` / actor peer values when `peer_role=assistant`. Letters / digits / `_` / `-`. |
|
|
508
577
|
| `accountId` | — | Required when `apiKey` is a root key. |
|
|
509
578
|
| `userId` | — | Required when `apiKey` is a root key. |
|
|
510
579
|
| `targetUri` | `viking://user/memories` | Default search scope URI. |
|
|
511
580
|
| `timeoutMs` | (plugin default) | HTTP timeout for OpenViking calls. |
|
|
512
|
-
| `autoCapture` | `true` | Auto-
|
|
581
|
+
| `autoCapture` | `true` | Auto-archive turn messages to OpenViking session at `afterTurn` (extraction itself runs on `/compact`, not here). |
|
|
513
582
|
| `captureMode` | `"semantic"` | Filter mode used by the server-side extraction pipeline: `semantic` or `keyword`. |
|
|
514
583
|
| `captureMaxLength` | `24000` | Max text length per archived turn. |
|
|
515
584
|
| `autoRecall` | `true` | Auto-recall and inject memories before reply. |
|
|
585
|
+
| `recallTargetTypes` | `user,agent` | Default target types when `targetUri` is omitted. Allowed: `resource`, `user`, `agent`. |
|
|
586
|
+
| `recallResources` | `false` | Compatibility shortcut that appends `resource` to default recall targets when `recallTargetTypes` is unset. |
|
|
516
587
|
| `recallLimit` | `6` | Max memories injected per recall. |
|
|
517
588
|
| `recallScoreThreshold` | `0.15` | Min relevance score to inject. |
|
|
518
|
-
| `recallMaxInjectedChars` |
|
|
589
|
+
| `recallMaxInjectedChars` | `4000` | Hard cap on injected character count. Complete memories that do not fit are skipped, not truncated. |
|
|
519
590
|
| `recallPreferAbstract` | (plugin default) | Prefer abstract memories over raw. |
|
|
520
|
-
| `recallTokenBudget` |
|
|
521
|
-
| `
|
|
522
|
-
| `
|
|
523
|
-
| `agentScopeMode` | (plugin default) | Agent scope strategy. |
|
|
591
|
+
| `recallTokenBudget` | deprecated | Compatibility alias for `recallMaxInjectedChars`. |
|
|
592
|
+
| `commitTokenThreshold` | `20000` | Pending-token threshold for async commit after turns; `0` commits every turn. |
|
|
593
|
+
| `commitKeepRecentCount` | `10` | Recent messages kept live after afterTurn commit. Compact always uses `0`. |
|
|
524
594
|
| `bypassSessionPatterns` | — | Glob patterns for sessions skipped by capture. |
|
|
525
595
|
| `ingestReplyAssist` | (plugin default) | Reply-assist ingestion toggle. |
|
|
526
|
-
| `emitStandardDiagnostics` |
|
|
527
|
-
| `logFindRequests` |
|
|
596
|
+
| `emitStandardDiagnostics` | `false` | Emit structured `openviking: diag {...}` lines. |
|
|
597
|
+
| `logFindRequests` | `false` | Log routing for find/session writes. Also enabled by `OPENVIKING_LOG_ROUTING=1` or `OPENVIKING_DEBUG=1`. |
|
|
598
|
+
| `traceRecall` | `false` | Record recall traces in memory. |
|
|
599
|
+
| `traceRecallPersist` | `false` | Persist recall traces to JSONL files. |
|
|
600
|
+
| `traceRecallDir` | `~/.openclaw/openviking/recall-traces` | Recall trace directory. |
|
|
528
601
|
|
|
529
602
|
To change a value:
|
|
530
603
|
|
|
@@ -659,7 +732,7 @@ Match against actual stderr / JSON `error` strings.
|
|
|
659
732
|
| `Server unreachable: …. Use --allow-offline to save config anyway.` | Setup couldn't reach server | Offer `--allow-offline`. |
|
|
660
733
|
| `contextEngine slot is owned by "<x>". … Use --force-slot to replace.` | Slot conflict | Ask user, then retry with `--force-slot`. |
|
|
661
734
|
| `Root API key detected. Missing: --account-id, --user-id` | Multi-tenant key | Collect both, retry with `--account-id` `--user-id`. |
|
|
662
|
-
| `openviking: config parse failed` (in gateway log) | Bad value in `openclaw.json` | Show user; check `
|
|
735
|
+
| `openviking: config parse failed` (in gateway log) | Bad value in `openclaw.json` | Show user; check `peer_prefix` charset, URL format. |
|
|
663
736
|
| `extracted 0 memories` after a turn | Server VLM/embedding misconfigured | **Out of scope.** Tell user this is a server-side issue — ask their OpenViking admin to check VLM / embedding config. |
|
|
664
737
|
| `401` / `403` on plugin requests, but `/health` works | Server requires auth on API endpoints | Re-run STEP 7 with the correct `--api-key`. |
|
|
665
738
|
| Plugin doesn't appear in `openclaw plugins list` after Path A | Install didn't actually finish | Re-run Path A; use Path B only if the failure is registry/rate-limit related. |
|
|
@@ -671,7 +744,7 @@ Match against actual stderr / JSON `error` strings.
|
|
|
671
744
|
3. **Never silently use `--force-slot`.** Slot replacement disables another plugin — always confirm with the user first.
|
|
672
745
|
4. **Never invent values.** If the user can't provide a required value, stop and tell them what to ask their admin.
|
|
673
746
|
5. **Never claim success without STEP 10.** Only after `openclaw openviking status --json` shows `configured: true && slotActive: true && health.ok: true` may you tell the user it's done.
|
|
674
|
-
6. **Use `--
|
|
747
|
+
6. **Use `--peer-prefix` for assistant peer prefixes.** The old ID-style setup flag is no longer supported by the schema.
|
|
675
748
|
7. **For Windows, use PowerShell equivalents.** Don't rely on `nohup`, `&`, `mkdir -p`, `source`, etc.
|
|
676
749
|
8. **Switch to Path B (ov-install) only for ClawHub/rate-limit/registry availability failures.** Don't use it to hide version conflicts or package validation errors.
|
|
677
750
|
9. **Do NOT install or operate the OpenViking server.** This skill assumes the server is already running. If it isn't, tell the user to contact their admin or follow the OpenViking docs.
|
|
@@ -0,0 +1,286 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: openviking-context-database
|
|
3
|
+
description: >
|
|
4
|
+
Use OpenViking from OpenClaw through @openviking/openclaw-plugin: long-term memory,
|
|
5
|
+
session archives, resource and Agent Skill import, semantic recall, recall trace debugging,
|
|
6
|
+
and externalized tool-result recovery. Prefer this skill when the user wants to use, query,
|
|
7
|
+
debug, or operate OpenViking context from an OpenClaw agent. For first-time plugin installation,
|
|
8
|
+
use the install-openviking-memory skill instead.
|
|
9
|
+
version: 2026.6.5
|
|
10
|
+
metadata:
|
|
11
|
+
openclaw:
|
|
12
|
+
requires:
|
|
13
|
+
plugin: "@openviking/openclaw-plugin"
|
|
14
|
+
emoji: "🦣"
|
|
15
|
+
tags:
|
|
16
|
+
- openviking
|
|
17
|
+
- context-engine
|
|
18
|
+
- memory
|
|
19
|
+
- resources
|
|
20
|
+
- skills
|
|
21
|
+
- recall-trace
|
|
22
|
+
---
|
|
23
|
+
|
|
24
|
+
# OpenViking Context Database — OpenClaw Plugin Operator Skill
|
|
25
|
+
|
|
26
|
+
Use this skill after `@openviking/openclaw-plugin` is installed and configured. It describes the current OpenClaw plugin implementation, not the standalone OpenViking Python SDK.
|
|
27
|
+
|
|
28
|
+
## Scope and Safety Rules
|
|
29
|
+
|
|
30
|
+
- The plugin is **remote-only**. It talks to an existing OpenViking server through HTTP and does not start or manage `openviking-server`.
|
|
31
|
+
- Do not invent OpenViking REST endpoints. Use the registered OpenClaw tools and commands described below.
|
|
32
|
+
- The agent-visible `add_resource` tool is disabled by default (`enableAddResourceTool=false`). Do not use `add_resource` during search, retrieval, URI reading, or search-result optimization. Use `ov_search` and `ov_read` in those flows.
|
|
33
|
+
- Use manual `/add-resource`, or `add_resource` only when it is explicitly enabled and the user explicitly asks to import, add, upload, save, or index a resource.
|
|
34
|
+
- Use `add_skill` only when the user explicitly asks to import, add, install, or register an Agent Skill into OpenViking.
|
|
35
|
+
- For local files and directories, pass the local path to the plugin tool. The plugin uploads them through `/api/v1/resources/temp_upload`; do not send raw local filesystem paths to a remote server yourself.
|
|
36
|
+
- Never log or echo API keys. The plugin sends API keys as `X-API-Key` / setup probe headers and masks them in setup output.
|
|
37
|
+
|
|
38
|
+
## Current Architecture
|
|
39
|
+
|
|
40
|
+
OpenClaw owns agent execution, prompts, and tool invocation. OpenViking owns long-lived context:
|
|
41
|
+
|
|
42
|
+
| Layer | Current behavior |
|
|
43
|
+
|---|---|
|
|
44
|
+
| `assemble` | Rebuilds compressed session history from OpenViking and injects relevant recall into the latest user message. |
|
|
45
|
+
| `afterTurn` | Appends only the new turn to the OpenViking session; may trigger async commit when `pending_tokens >= commitTokenThreshold`. |
|
|
46
|
+
| `compact` | Runs `commit(wait=true)`, waits for archive/extraction completion, and reads back latest archive overview. |
|
|
47
|
+
| Tools | Memory recall/store/forget, archive search/expand, resource/skill import/search, recall trace query, tool-result list/search/read. |
|
|
48
|
+
|
|
49
|
+
Long-term memories are usually extracted on `/compact` or on threshold-triggered commit. A fact mentioned in a fresh conversation may still be present as recent session context before it becomes a long-term memory.
|
|
50
|
+
|
|
51
|
+
## Configuration Quick Reference
|
|
52
|
+
|
|
53
|
+
Read status first:
|
|
54
|
+
|
|
55
|
+
```bash
|
|
56
|
+
openclaw openviking status --json
|
|
57
|
+
openclaw config get plugins.entries.openviking.config
|
|
58
|
+
openclaw config get plugins.slots.contextEngine
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
Core config lives under `plugins.entries.openviking.config`:
|
|
62
|
+
|
|
63
|
+
| Field | Default | Purpose |
|
|
64
|
+
|---|---:|---|
|
|
65
|
+
| `baseUrl` | `http://127.0.0.1:1933` | OpenViking HTTP endpoint. Can also come from `OPENVIKING_BASE_URL` / `OPENVIKING_URL`. |
|
|
66
|
+
| `apiKey` | empty | Optional API key. Can also come from `OPENVIKING_API_KEY`. |
|
|
67
|
+
| `peer_role` | `assistant` | Peer identity mode: `none`, `assistant`, or `person`. Session messages use body `peer_id`; data-plane recall/search uses `X-OpenViking-Actor-Peer`. |
|
|
68
|
+
| `peer_prefix` | empty | Optional prefix for assistant `peer_id` / actor peer values when `peer_role=assistant`. |
|
|
69
|
+
| `accountId` / `userId` | empty | Advanced tenant identity headers for root-key or trusted deployments. |
|
|
70
|
+
| `targetUri` | `viking://user/memories` | Default search scope for legacy targeted memory search. |
|
|
71
|
+
| `autoCapture` | `true` | Append sanitized turn text to OpenViking sessions. |
|
|
72
|
+
| `captureMode` | `semantic` | `semantic` or `keyword`; affects server-side extraction filtering. |
|
|
73
|
+
| `captureMaxLength` | `24000` | Max sanitized text length per captured turn. |
|
|
74
|
+
| `autoRecall` | `true` | Run recall before replies and inject relevant context. |
|
|
75
|
+
| `recallTargetTypes` | `user,agent` | Default target types when `targetUri` is omitted. Allowed: `resource`, `user`, `agent`. |
|
|
76
|
+
| `recallResources` | `false` | Compatibility shortcut that appends `resource` to default recall targets when `recallTargetTypes` is unset. |
|
|
77
|
+
| `recallLimit` | `6` | Max selected recall items. |
|
|
78
|
+
| `recallScoreThreshold` | `0.15` | Min score after post-processing. |
|
|
79
|
+
| `recallMaxInjectedChars` | `4000` | Total injected character cap; complete memories that do not fit are skipped. |
|
|
80
|
+
| `commitTokenThreshold` | `20000` | Pending-token threshold for async commit after turns; `0` commits every turn. |
|
|
81
|
+
| `commitKeepRecentCount` | `10` | Recent messages kept live after afterTurn commit. Compact always uses `0`. |
|
|
82
|
+
| `bypassSessionPatterns` | empty | Glob-like session keys that completely bypass OpenViking (`*` segment, `**` multi-segment). |
|
|
83
|
+
| `emitStandardDiagnostics` | `false` | Emit structured `openviking: diag {...}` lines. |
|
|
84
|
+
| `logFindRequests` | `false` | Log routing for find/session writes. Also enabled by `OPENVIKING_LOG_ROUTING=1` or `OPENVIKING_DEBUG=1`. |
|
|
85
|
+
| `traceRecall` | `false` | Record recall traces in memory. |
|
|
86
|
+
| `traceRecallPersist` | `false` | Persist recall traces as local JSONL files. |
|
|
87
|
+
| `traceRecallDir` | `~/.openclaw/openviking/recall-traces` | Recall trace directory when persistence is enabled. |
|
|
88
|
+
|
|
89
|
+
Normal setup command:
|
|
90
|
+
|
|
91
|
+
```bash
|
|
92
|
+
openclaw openviking setup --base-url <OPENVIKING_URL> --api-key <API_KEY> --json
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
Useful variants:
|
|
96
|
+
|
|
97
|
+
```bash
|
|
98
|
+
openclaw openviking setup --base-url <URL> --api-key <KEY> --peer-prefix openclaw-prod --json
|
|
99
|
+
openclaw openviking setup --base-url <URL> --api-key <ROOT_KEY> --account-id <ACCOUNT_ID> --user-id <USER_ID> --json
|
|
100
|
+
openclaw openviking setup --base-url <URL> --api-key <KEY> --recall-target-types resource --json
|
|
101
|
+
openclaw openviking setup --base-url <URL> --api-key <KEY> --allow-offline --json
|
|
102
|
+
openclaw openviking setup --base-url <URL> --api-key <KEY> --force-slot --json
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
## Tool Selection Guide
|
|
106
|
+
|
|
107
|
+
| User intent | Use |
|
|
108
|
+
|---|---|
|
|
109
|
+
| “What did I say before?”, preferences, decisions, known facts | `memory_recall` |
|
|
110
|
+
| “Remember this now” | `memory_store` |
|
|
111
|
+
| “Forget X” | `memory_forget` |
|
|
112
|
+
| Summary lacks an exact command/path/snippet from old chat | `ov_archive_search`, then `ov_archive_expand` if needed |
|
|
113
|
+
| Import docs, PDFs, local dirs, URLs, Git repos, media attachments | manual `/add-resource`; `add_resource` only if `enableAddResourceTool=true` |
|
|
114
|
+
| Import/register an Agent Skill | `add_skill` |
|
|
115
|
+
| Search imported resources or skills | `ov_search` |
|
|
116
|
+
| Read an exact `viking://...` hit from `ov_search` or recall trace | `ov_read` |
|
|
117
|
+
| Explain why recall/search returned something | `ov_recall_trace` |
|
|
118
|
+
| A previous tool result shows only a preview/ref | `openviking_tool_result_list`, `openviking_tool_result_search`, `openviking_tool_result_read` |
|
|
119
|
+
|
|
120
|
+
## Tool Interface Reference
|
|
121
|
+
|
|
122
|
+
### `memory_recall`
|
|
123
|
+
|
|
124
|
+
Semantic search over memories/resources. Use archive tools for session history.
|
|
125
|
+
|
|
126
|
+
| Parameter | Required | Description |
|
|
127
|
+
|---|---|---|
|
|
128
|
+
| `query` | Yes | Search query. |
|
|
129
|
+
| `limit` | No | Max selected results. Defaults to `recallLimit`. |
|
|
130
|
+
| `scoreThreshold` | No | Score threshold `0..1`. Defaults to `recallScoreThreshold`. |
|
|
131
|
+
| `targetUri` | No | Exact search URI. If set, only this URI is searched. |
|
|
132
|
+
| `resourceTypes` | No | Array of `resource`, `user`, `agent`; used only when `targetUri` is omitted. |
|
|
133
|
+
|
|
134
|
+
Notes: when `targetUri` is omitted, the plugin resolves a search plan from `resourceTypes` or configured `recallTargetTypes`, fetches more candidates than requested, deduplicates, filters leaf memories, reranks, and respects `recallMaxInjectedChars`.
|
|
135
|
+
|
|
136
|
+
### `memory_store`
|
|
137
|
+
|
|
138
|
+
Persist text immediately by writing a session and committing with `wait=true`.
|
|
139
|
+
|
|
140
|
+
| Parameter | Required | Description |
|
|
141
|
+
|---|---|---|
|
|
142
|
+
| `text` | Yes | Information source text. |
|
|
143
|
+
| `role` | No | Session role, default `user`. |
|
|
144
|
+
| `sessionId` | No | Existing OpenViking/OpenClaw session reference. If omitted, a temporary `memory-store-*` session is created. |
|
|
145
|
+
|
|
146
|
+
### `memory_forget`
|
|
147
|
+
|
|
148
|
+
Delete a memory.
|
|
149
|
+
|
|
150
|
+
| Parameter | Required | Description |
|
|
151
|
+
|---|---|---|
|
|
152
|
+
| `uri` | No | Exact `viking://user/.../memories/...` memory URI. Non-memory URIs are refused. |
|
|
153
|
+
| `query` | No | Search query when `uri` is unknown. |
|
|
154
|
+
| `targetUri` | No | Search scope URI, default `targetUri`. |
|
|
155
|
+
| `limit` | No | Search limit, default `5`. |
|
|
156
|
+
| `scoreThreshold` | No | Search threshold, default `recallScoreThreshold`. |
|
|
157
|
+
|
|
158
|
+
If query mode finds multiple candidates, report candidates and ask the user to choose the exact URI; do not delete ambiguous memories.
|
|
159
|
+
|
|
160
|
+
### `ov_archive_search`
|
|
161
|
+
|
|
162
|
+
Keyword grep across archived original conversation messages of the current session.
|
|
163
|
+
|
|
164
|
+
| Parameter | Required | Description |
|
|
165
|
+
|---|---|---|
|
|
166
|
+
| `query` | Yes | Single keyword or short phrase; prefer names, dates, file paths, commands, or distinctive nouns. |
|
|
167
|
+
| `archiveId` | No | Restrict to one archive, e.g. `archive_002`. |
|
|
168
|
+
|
|
169
|
+
Try at least two concrete keyword variants before concluding archived detail is unavailable.
|
|
170
|
+
|
|
171
|
+
### `ov_archive_expand`
|
|
172
|
+
|
|
173
|
+
| Parameter | Required | Description |
|
|
174
|
+
|---|---|---|
|
|
175
|
+
| `archiveId` | Yes | Archive ID from `[Archive Index]`, e.g. `archive_002`. |
|
|
176
|
+
|
|
177
|
+
Use after an archive search or when the `[Archive Index]` already identifies the archive likely to contain exact detail.
|
|
178
|
+
|
|
179
|
+
### `add_resource`
|
|
180
|
+
|
|
181
|
+
Import resources into `viking://resources/...`.
|
|
182
|
+
|
|
183
|
+
This agent tool is disabled by default. Prefer manual `/add-resource` for resource ingestion. If `enableAddResourceTool=true` exposes the tool, use it only for explicit import/index requests and never as part of search/retrieval optimization.
|
|
184
|
+
|
|
185
|
+
| Parameter | Required | Description |
|
|
186
|
+
|---|---|---|
|
|
187
|
+
| `source` | Yes | Local path, OpenClaw media attachment path, directory path, public URL, or Git URL. |
|
|
188
|
+
| `to` | No | Exact target URI, e.g. `viking://resources/project-docs`. Mutually exclusive with `parent`. |
|
|
189
|
+
| `parent` | No | Parent URI under `viking://resources`. Mutually exclusive with `to`. |
|
|
190
|
+
| `reason` | No | Reason/note for import. |
|
|
191
|
+
| `instruction` | No | Processing instruction for semantic extraction. |
|
|
192
|
+
| `wait` | No | Wait for processing completion. |
|
|
193
|
+
| `timeout` | No | Timeout in seconds when `wait=true`. |
|
|
194
|
+
|
|
195
|
+
The current OpenClaw tool exposes the parameters above. The underlying client also supports server-facing resource options such as `strict`, `ignore_dirs`, `include`, `exclude`, and `preserve_structure` for command/internal paths; do not pass them to the tool unless the registered schema exposes them.
|
|
196
|
+
|
|
197
|
+
### `add_skill`
|
|
198
|
+
|
|
199
|
+
Import Agent Skills into `viking://user/skills/...`.
|
|
200
|
+
|
|
201
|
+
| Parameter | Required | Description |
|
|
202
|
+
|---|---|---|
|
|
203
|
+
| `source` | No | Local `SKILL.md` path or skill directory. Exactly one of `source` or `data` is required. |
|
|
204
|
+
| `data` | No | Raw `SKILL.md` content or an MCP tool dict. Exactly one of `source` or `data` is required. |
|
|
205
|
+
| `wait` | No | Wait for processing completion. |
|
|
206
|
+
| `timeout` | No | Timeout in seconds when `wait=true`. |
|
|
207
|
+
|
|
208
|
+
Agent Skill best practice: a skill should have precise frontmatter (`name`, trigger-oriented `description`, useful `tags`), clear scope boundaries, explicit “when not to use” guidance if needed, and executable steps with concrete parameters. Keep secrets out of skill content.
|
|
209
|
+
|
|
210
|
+
### `ov_search`
|
|
211
|
+
|
|
212
|
+
| Parameter | Required | Description |
|
|
213
|
+
|---|---|---|
|
|
214
|
+
| `query` | Yes | Search query. |
|
|
215
|
+
| `uri` | No | Search URI. Defaults to resources plus agent skills. |
|
|
216
|
+
| `limit` | No | Max results per scope, default `10`. |
|
|
217
|
+
|
|
218
|
+
Use after importing resources/skills, or when the user asks to search OpenViking-managed knowledge.
|
|
219
|
+
|
|
220
|
+
Important: `ov_search` returns OpenViking virtual URIs such as `viking://resources/project-docs/api.md#chunk-3`. These are not local file paths. Do not use filesystem read tools for them; call `ov_read` with the exact URI when full content is needed.
|
|
221
|
+
|
|
222
|
+
### `ov_read`
|
|
223
|
+
|
|
224
|
+
Read full content for one exact OpenViking virtual URI through `/api/v1/content/read`.
|
|
225
|
+
|
|
226
|
+
| Parameter | Required | Description |
|
|
227
|
+
|---|---|---|
|
|
228
|
+
| `uri` | Yes | Exact `viking://...` URI returned by `ov_search` or recall trace results. `openviking://...` aliases and local file paths are refused. |
|
|
229
|
+
|
|
230
|
+
### `ov_recall_trace`
|
|
231
|
+
|
|
232
|
+
| Parameter | Required | Description |
|
|
233
|
+
|---|---|---|
|
|
234
|
+
| `turn` | No | `latest` or `all`, default `latest`. |
|
|
235
|
+
| `traceId` | No | Exact trace ID. |
|
|
236
|
+
| `sessionId` / `sessionKey` / `ovSessionId` | No | Filter by OpenClaw/OpenViking session. |
|
|
237
|
+
| `source` | No | `auto_recall`, `memory_recall`, `ov_search`, or `ov_archive_search`. |
|
|
238
|
+
| `resourceTypes` | No | Array/string containing `resource`, `user`, `agent`. |
|
|
239
|
+
| `since` / `until` | No | Unix timestamp bounds in milliseconds. |
|
|
240
|
+
| `includeContent` | No | Read selected/displayed URI content previews on demand. |
|
|
241
|
+
| `limit` | No | Maximum traces to return, default `20`. |
|
|
242
|
+
|
|
243
|
+
Trace records exist only when `traceRecall=true`; persisted lookup requires `traceRecallPersist=true` and accessible trace files.
|
|
244
|
+
|
|
245
|
+
### Externalized tool-result tools
|
|
246
|
+
|
|
247
|
+
Use when a preview contains `viking://session/<session_id>/tool-results/<tool_result_id>`.
|
|
248
|
+
|
|
249
|
+
| Tool | Parameters |
|
|
250
|
+
|---|---|
|
|
251
|
+
| `openviking_tool_result_list` | `tool_name?`, `limit?` (default `50`) |
|
|
252
|
+
| `openviking_tool_result_search` | `tool_output_ref`, `query`, `limit?` (default `20`), `context_chars?` (default `300`) |
|
|
253
|
+
| `openviking_tool_result_read` | `tool_output_ref`, `offset?` (default `0`), `limit?` (default `20000`, `-1` accepted by server path for all remaining content) |
|
|
254
|
+
|
|
255
|
+
The plugin refuses to read/search a tool-result ref from another session.
|
|
256
|
+
|
|
257
|
+
## Slash Commands
|
|
258
|
+
|
|
259
|
+
```text
|
|
260
|
+
/add-resource ./README.md --to viking://resources/openviking-readme --wait
|
|
261
|
+
/add-skill ./skills/install-openviking-memory --wait --timeout=30
|
|
262
|
+
/ov-search "OpenViking install" --uri viking://resources/openviking-readme --limit=5
|
|
263
|
+
/ov-recall-trace --turn latest --source auto_recall --include-content
|
|
264
|
+
```
|
|
265
|
+
|
|
266
|
+
Command parsers support quoted args and flags. Resource-only flags are rejected for skill imports.
|
|
267
|
+
|
|
268
|
+
## Troubleshooting
|
|
269
|
+
|
|
270
|
+
| Symptom | Likely cause | First action |
|
|
271
|
+
|---|---|---|
|
|
272
|
+
| `configured=false` | Setup did not persist config | Re-run `openclaw openviking setup ... --json`; branch on JSON `error`. |
|
|
273
|
+
| `slotActive=false` | Another context engine owns the slot or gateway has stale state | Inspect `plugins.slots.contextEngine`; use `--force-slot` only after user confirms. |
|
|
274
|
+
| `health.ok=false` | Server unreachable or wrong `baseUrl` / key | Check `baseUrl`, network, `/health`, and auth. |
|
|
275
|
+
| No long-term memory after a fresh fact | `/compact` or commit/extraction has not run, or server extraction failed | Run `/compact`; check OpenViking server logs. |
|
|
276
|
+
| Recall misses shared documents | `resource` target is not enabled | Use `memory_recall` with `resourceTypes:["resource"]` or configure `recallTargetTypes: ["resource"]`. |
|
|
277
|
+
| Summary lacks exact detail | Archive summary is too coarse | Use `ov_archive_search` with concrete keywords, then `ov_archive_expand`. |
|
|
278
|
+
| Large tool output preview is insufficient | Tool result was externalized | Use `openviking_tool_result_search/read` with the ref. |
|
|
279
|
+
| Need to explain recall behavior | Trace disabled or no trace for that turn | Enable `traceRecall`; optionally `traceRecallPersist`; query `ov_recall_trace`. |
|
|
280
|
+
|
|
281
|
+
## Reference Docs in This Repo
|
|
282
|
+
|
|
283
|
+
- `README.md` / `README_CN.md`: feature overview and quick start.
|
|
284
|
+
- `INSTALL.md` / `INSTALL-ZH.md`: install, upgrade, uninstall, and JSON setup handling.
|
|
285
|
+
- `INSTALL-AGENT.md`: agent-oriented installation workflow.
|
|
286
|
+
- `docs/openviking-openclaw-plugin-guide.md`: comprehensive Chinese operator/developer guide.
|