Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
a11e50d
feat(retrieval): assemble auto-recall context server-side via /search…
t0saki Jul 27, 2026
425e63a
refactor(retrieval): give context tiers a per-category default
t0saki Jul 29, 2026
0868e8f
feat(codex): inject profile context on session start
t0saki Jul 31, 2026
ae33996
fix(retrieval): raise rewrite timeout default to 30s
t0saki Jul 31, 2026
c5e1916
docs(agents): document low-latency recall settings
t0saki Jul 31, 2026
40c6894
fix(codex): prefer luna as recall compressor fallback
t0saki Jul 31, 2026
38ded4c
refactor(plugins): unify recall compression setting
t0saki Jul 31, 2026
be0d8c6
feat(plugins): enable recall compression by default
t0saki Jul 31, 2026
20ddaf8
Merge remote-tracking branch 'origin/main' into feat/search-context-a…
t0saki Jul 31, 2026
bc868bb
docs(agents): use absolute links in image docs
t0saki Jul 31, 2026
cf34f2a
fix(retrieval): address context assembly review feedback
t0saki Aug 3, 2026
55d141a
test: trim redundant context assembly coverage
qin-ctx Aug 3, 2026
e7c8b99
Merge origin/main into feat/search-context-assembly
t0saki Aug 3, 2026
de8e1a5
fix(retrieval): address second-round context assembly review
t0saki Aug 4, 2026
a5d5a39
Merge remote-tracking branch 'origin/main' into feat/search-context-a…
t0saki Aug 4, 2026
fffa1d1
chore(plugins): sync shared modules into the zcode snapshot
t0saki Aug 4, 2026
e364d89
fix(retrieval): align context quotas and plugin defaults
t0saki Aug 4, 2026
2f0b401
fix(retrieval): preserve recall compatibility
t0saki Aug 4, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ jobs:
examples/codex-memory-plugin/scripts/ov-credentials.test.mjs \
examples/codex-memory-plugin/scripts/recall-compressor-profile.test.mjs \
examples/codex-memory-plugin/scripts/auto-recall.test.mjs \
examples/codex-memory-plugin/scripts/session-start-commit.test.mjs \
examples/claude-code-memory-plugin/scripts/marketplace.test.mjs \
examples/claude-code-memory-plugin/scripts/skill-experience.test.mjs \
examples/claude-code-memory-plugin/scripts/uri-guard.test.mjs \
Expand All @@ -48,6 +49,7 @@ jobs:
examples/memory-plugin-shared/install-opencode-jsonc.test.mjs \
examples/memory-plugin-shared/install-tui.test.mjs \
examples/memory-plugin-shared/sync.test.mjs \
examples/memory-plugin-shared/recall-compress-core.test.mjs \
examples/memory-plugin-shared/recall-core.test.mjs \
examples/memory-plugin-shared/workspace-peer.test.mjs \
examples/memory-plugin-shared/uri-guard.test.mjs \
Expand Down
35 changes: 35 additions & 0 deletions docs/en/agent-integrations/01-overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,38 @@ OpenViking can act as the long-term memory and context backend for many agent ru
## Prerequisite for all integrations

Every integration on this page connects to a running OpenViking server. If you don't have one yet, follow the [Quickstart Guide](../getting-started/02-quickstart.md). The default endpoint is `http://localhost:1933`; remote use requires an API key (see [Authentication](../guides/04-authentication.md)).

## Low-latency recall

Query expansion and recall-result compression are two independent, optional model calls. Disable both in the Agent plugin when response latency matters most; semantic retrieval, budgeting, tier degradation, and cross-turn dedup continue to work.

The same environment variables apply to both the Claude Code and Codex memory plugins:

```bash
export OPENVIKING_RECALL_QUERY_EXPANSION=off
export OPENVIKING_RECALL_COMPRESS=off
```

Both plugins have a local compression path, but expose it differently:

- Claude Code defaults to `recallCompress=auto`: it prefers local `claude -p` (Sonnet with low effort) and falls back to an OpenViking server digest when the local CLI is unavailable. `client` forces local-only compression, while `server` forces server-only compression.
- Codex calls local `codex exec` by default, trying `gpt-5.3-codex-spark` first and then `gpt-5.6-luna` with low effort. It does not enable server-side compression.

The shared default is `recallCompress=auto`. `OPENVIKING_RECALL_COMPRESS=off` disables compression in both plugins; Codex interprets `auto` or `client` as enabling its local compressor. The old Claude Code variable `OPENVIKING_RECALL_REWRITE` remains supported for compatibility, but new configurations should use the unified name.

The same settings can live in `~/.openviking/ovcli.conf`:

```json
{
"url": "https://openviking.example.com",
"api_key": "your-api-key",
"plugin": {
"recallQueryExpansion": "off",
"recallCompress": "off"
}
}
```

Environment variables take precedence over `ovcli.conf`. Restart the Agent after changing these settings so its hook processes reload the configuration. These are plugin-client settings; the server's `ov.conf` does not need to change.

When Claude Code asks the server for a digest, the context request waits longer than an ordinary request: the server's own rewrite fuse is `retrieval.recall_rewrite_timeout_s` (30s by default), and aborting earlier would discard the whole response rather than just the digest. Set `OPENVIKING_RECALL_CONTEXT_TIMEOUT_MS` (or `plugin.recallContextTimeoutMs`) to pin that deadline — keep it above the server's fuse and below the Agent's own hook timeout.
6 changes: 4 additions & 2 deletions docs/en/agent-integrations/02-claude-code.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,14 +80,16 @@ Configuration priority: Environment variables > `ovcli.conf` > `ov.conf` > Built
| Env Var | Default | Description |
|---------|---------|-------------|
| `OPENVIKING_AUTO_RECALL` | `true` | Auto-recall on every user prompt |
| `OPENVIKING_RECALL_LIMIT` | `6` | Max memories to inject per turn |
| `OPENVIKING_RECALL_TOKEN_BUDGET` | `2000` | Token budget for inline content |
| `OPENVIKING_RECALL_LIMIT` | `10` | Legacy width override converted to per-category coding quotas |
| `OPENVIKING_RECALL_TOKEN_BUDGET` | `2000` | Inline token budget for the final raw-find fallback |
| `OPENVIKING_AUTO_CAPTURE` | `true` | Auto-capture after each turn |
| `OPENVIKING_BYPASS_SESSION` | `false` | Skip all hooks for this session |
| `OPENVIKING_BYPASS_SESSION_PATTERNS` | `""` | CSV glob patterns to auto-bypass |
| `OPENVIKING_MEMORY_ENABLED` | (auto) | Force on/off |
| `OPENVIKING_DEBUG` | `false` | Write logs to `~/.openviking/logs/cc-hooks.log` |

If recall latency matters most, see [Low-latency recall](./01-overview.md#low-latency-recall) for the environment-variable and `ovcli.conf` settings that disable query expansion and result compression.

For multi-tenant deployments, configure `OPENVIKING_ACCOUNT` and `OPENVIKING_USER`. The complete list of environment variables is available in the [plugin README](https://github.com/volcengine/OpenViking/blob/main/examples/claude-code-memory-plugin/README.md#configuration).

</details>
Expand Down
10 changes: 7 additions & 3 deletions docs/en/agent-integrations/04-codex.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Codex Memory Plugin

Equip [Codex](https://developers.openai.com/codex) with persistent memory across sessions. Install it once, and memories will be automatically recalled with every prompt, captured after each turn, and committed before compaction. The plugin also connects Codex to OpenViking's `/mcp` endpoint, enabling the model to call tools such as `find`, `search`, `recall`, and `remember` directly.
Equip [Codex](https://developers.openai.com/codex) with persistent memory across sessions. Install it once, and your OpenViking profile and memory index are loaded at session start, relevant memories are recalled with every prompt, new turns are captured after each response, and sessions are committed before compaction. The plugin also connects Codex to OpenViking's `/mcp` endpoint, enabling the model to call tools such as `find`, `search`, `recall`, and `remember` directly.

Source: [examples/codex-memory-plugin](https://github.com/volcengine/OpenViking/tree/main/examples/codex-memory-plugin) | [Blog: Motivation & demo](https://blog.openviking.ai/post/openviking-coding-agent/)

Expand Down Expand Up @@ -44,11 +44,11 @@ Prerequisites: Node.js >= 22, Codex >= 0.130.0, and the `plugin_hooks` feature e

## Verify

Launch `codex`; the plugin should seamlessly recall memories on every prompt. Set `OPENVIKING_DEBUG=1` to write events to `~/.openviking/logs/codex-hooks.log`.
Launch `codex`; on the first prompt of a session, the `SessionStart` hook should load your profile, and the plugin should then recall relevant memories for every prompt. Set `OPENVIKING_DEBUG=1` to write events to `~/.openviking/logs/codex-hooks.log`.

## How it works

The plugin integrates with Codex's lifecycle by hooking into key events. It searches OpenViking and injects relevant memories before every prompt (`UserPromptSubmit`), appends new turns to the session after each response (`Stop`), and commits the full transcript before compaction (`PreCompact`) to ensure memory extraction processes the entire conversation. Upon starting a fresh session, it also cleans up any orphaned sessions from previous runs.
The plugin integrates with Codex's lifecycle by hooking into key events. On `SessionStart` (`startup`, `clear`, or `resume`), it injects `profile.md` plus URI and abstract indexes for `preferences/` and `entities/` through the same shared, CJK-aware profile builder used by the other coding-agent integrations. It then searches OpenViking and injects relevant memories before every prompt (`UserPromptSubmit`), appends new turns to the session after each response (`Stop`), and commits the full transcript before compaction (`PreCompact`) to ensure memory extraction processes the entire conversation. Upon starting a fresh session, it also cleans up any orphaned sessions from previous runs. A resumed session may combine the fixed profile block with its latest archive digest.

> **Known limitation**: Codex does not fire a hook upon `SIGTERM`, `Ctrl+C`, or `/exit`. Orphaned sessions are recovered during the next `SessionStart` via the idle-TTL sweep (30 minutes) or the active-window heuristic.

Expand All @@ -63,10 +63,14 @@ Credential source: active `ovcli.conf` wins by default (`OPENVIKING_CLI_CONFIG_F
| `OPENVIKING_API_KEY` | — | API key (sent as `Authorization: Bearer`) |
| `OPENVIKING_CLI_CONFIG_FILE` | `~/.openviking/ovcli.conf` | Active CLI config to use for hooks, MCP, and child `ov` commands |
| `OPENVIKING_CREDENTIAL_SOURCE` | `auto` | Set `env` to force env-var credentials instead of active ovcli config |
| `OPENVIKING_NO_AUTO_INJECT` | `false` | Disable fixed session-start profile/background injection without disabling per-prompt recall |
| `OPENVIKING_PROFILE_TOKEN_BUDGET` | `10000` | CJK-aware token budget for `profile.md` plus `preferences/` and `entities/` indexes |
| `OPENVIKING_CODEX_ACTIVE_WINDOW_MS` | `120000` | SessionStart active-window threshold |
| `OPENVIKING_CODEX_IDLE_TTL_MS` | `1800000` | SessionStart idle-TTL sweep threshold |
| `OPENVIKING_DEBUG` | `false` | Write logs to `~/.openviking/logs/codex-hooks.log` |

If recall latency matters most, see [Low-latency recall](./01-overview.md#low-latency-recall) for the environment-variable and `ovcli.conf` settings that disable query expansion and Codex's local result compression.

Additional tuning options (e.g., `OPENVIKING_RECALL_LIMIT`, `OPENVIKING_CAPTURE_ASSISTANT_TURNS`) are documented in the [plugin README](https://github.com/volcengine/OpenViking/blob/main/examples/codex-memory-plugin/README.md#tuning-the-plugin).

</details>
Expand Down
1 change: 0 additions & 1 deletion docs/en/agent-integrations/11-pi.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@ node ~/.pi/agent/extensions/openviking/scripts/setup.mjs

```json
{
"recallLimit": 6,
"scoreThreshold": 0.35,
"recallTokenBudget": 2000,
"profileTokenBudget": 10000,
Expand Down
4 changes: 2 additions & 2 deletions docs/en/api/01-overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -470,14 +470,14 @@ This catalog follows the routes actually mounted by the server. Each group headi
| POST | `/api/v1/sessions/{session_id}/messages` | Add one message |
| POST | `/api/v1/sessions/{session_id}/messages/batch` | Add messages in a batch |
| POST | `/api/v1/sessions/{session_id}/used` | Record context or skills actually used |
| POST | `/api/v1/search/recall` | Recall memory as injection-ready context |
| POST | `/api/v1/search/recall` | Deprecated: thin preset over the search endpoint with `mode="context"` |

### [Retrieval](06-retrieval.md) and [Relations](13-relations.md)

| Method | Path | Description |
|--------|------|-------------|
| POST | `/api/v1/search/find` | Semantic search |
| POST | `/api/v1/search/search` | Context-aware search |
| POST | `/api/v1/search/search` | Context-aware search; `mode="context"` returns assembled, injection-ready context |
| POST | `/api/v1/search/grep` | Content pattern search |
| POST | `/api/v1/search/glob` | File pattern matching |
| GET | `/api/v1/relations` | Get resource relations |
Expand Down
Loading
Loading