Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
1 change: 1 addition & 0 deletions examples/claude-code-memory-plugin/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,7 @@ Upgrading from the path-derived peer needs no action: memories written under the
| `OPENVIKING_RECALL_PEER_SCOPE` | `all` | `all` can recall other project memories with a score penalty; `actor` only sees global plus the current project |
| `OPENVIKING_RECALL_MAX_TOKENS` | `1600` | Token budget for the server-assembled context block (independent of local compression limits) |
| `OPENVIKING_RECALL_DEDUP_TURNS` | `5` | Cross-turn cooldown: URIs served in the last N turns are skipped |
| `OPENVIKING_RECALL_EVENTS_DECAY_PROTECTION` | (off) | Event memories keep their score for this period (`7d`, `12h`) and decay after it, so older events stop outranking recent ones. Sent as `events_time_decay_protection`. |
| `OPENVIKING_RECALL_QUERY_EXPANSION` | `auto` | `auto` lets the server widen short prompts using session context; `off` disables it |
| `OPENVIKING_RECALL_COMPRESS` | `auto` | Digest compression: `off`, `client` (host CLI), `server`, or `auto` (local first, server fallback) |
| `OPENVIKING_RECALL_COMPRESS_MAX_BULLETS` | `6` | Digest bullet ceiling |
Expand Down
1 change: 1 addition & 0 deletions examples/claude-code-memory-plugin/README_CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,7 @@ claude
| `OPENVIKING_LOG_RANKING_DETAILS` | `false` | 每候选打分日志(很啰嗦) |
| `OPENVIKING_RECALL_MAX_TOKENS` | `1600` | 服务端组装上下文块的 token 预算(与本地压缩输入上限相互独立) |
| `OPENVIKING_RECALL_DEDUP_TURNS` | `5` | 跨轮冷却:最近 N 轮已注入过的 URI 本轮跳过 |
| `OPENVIKING_RECALL_EVENTS_DECAY_PROTECTION` | (关) | 事件记忆在此期限内(`7d`、`12h`)保持原分,之后衰减,较早的事件不再压过新的。以 `events_time_decay_protection` 发送。 |
| `OPENVIKING_RECALL_QUERY_EXPANSION` | `auto` | `auto` 让服务端结合会话上下文扩展短提问;`off` 关闭 |
| `OPENVIKING_RECALL_COMPRESS` | `auto` | digest 压缩:`off`、`client`(本地宿主 CLI)、`server`、`auto`(本地优先、失败回落服务端) |
| `OPENVIKING_RECALL_COMPRESS_MAX_BULLETS` | `6` | digest 条数上限 |
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions examples/codex-memory-plugin/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -357,6 +357,7 @@ Config knobs:
| `OPENVIKING_RECALL_COMPRESS_DETECT_TTL_MS` | `604800000` | Cache TTL used by `UserPromptSubmit` when reading the latest profile. |
| `OPENVIKING_RECALL_MAX_TOKENS` | `1600` | Token budget the server assembles the context block within, independent of the local compressor input limit. |
| `OPENVIKING_RECALL_DEDUP_TURNS` | `5` | Cross-turn cooldown: URIs served in the last N turns are skipped. |
| `OPENVIKING_RECALL_EVENTS_DECAY_PROTECTION` | (off) | Event memories keep their score for this period (`7d`, `12h`) and decay after it, so older events stop outranking recent ones. Sent as `events_time_decay_protection`. |
| `OPENVIKING_RECALL_QUERY_EXPANSION` | `auto` | `auto` lets the server widen short prompts using session context; `off` disables it. |
| `OPENVIKING_RECALL_QUERY_FILTERS` | `""` | Comma-separated regex rules applied to the prompt before it becomes a query — see [Input filters](#input-filters). |

Expand Down
3 changes: 3 additions & 0 deletions examples/codex-memory-plugin/scripts/shared/config-schema.mjs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions examples/codex-memory-plugin/scripts/shared/recall-core.mjs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions examples/memory-plugin-shared/lib/config-schema.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,9 @@ export const KNOBS = [
{ name: "recallMaxContentChars", type: "int", default: 500, min: 100, max: 5000, env: "OPENVIKING_RECALL_MAX_CONTENT_CHARS", capability: "recall" },
{ name: "recallPreferAbstract", type: "bool", default: true, env: "OPENVIKING_RECALL_PREFER_ABSTRACT", capability: "recall" },
{ name: "recallPeerScope", type: "enum", values: ["all", "actor"], default: "all", env: "OPENVIKING_RECALL_PEER_SCOPE", workspace: "recall.peer_scope", capability: "recall" },
// Sent as events_time_decay_protection ("7d", "12h"): event memories keep their score for
// that long and decay afterwards. Empty leaves decay off, as the server does by default.
{ name: "recallEventsDecayProtection", type: "string", default: "", env: "OPENVIKING_RECALL_EVENTS_DECAY_PROTECTION", capability: "recall" },
{ name: "recallDedupTurns", type: "int", default: 5, min: 0, max: 20, env: "OPENVIKING_RECALL_DEDUP_TURNS", workspace: "recall.dedup_turns", capability: "recall" },
{ name: "recallMaxTokens", type: "int", default: 1600, min: 64, max: 200000, env: "OPENVIKING_RECALL_MAX_TOKENS", sendOnlyWhenConfigured: true, capability: "recall" },
{ name: "recallQueryExpansion", type: "enum", values: ["auto", "off"], default: "auto", env: "OPENVIKING_RECALL_QUERY_EXPANSION", sendOnlyWhenConfigured: true, capability: "recall" },
Expand Down
2 changes: 2 additions & 0 deletions examples/memory-plugin-shared/lib/recall-core.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,8 @@ export function buildContextSearchBody(cfg = {}, options = {}) {
if (limitConfigured) body.quotas = codingQuotas(limit);
if (maxTokensConfigured) body.max_tokens = maxTokens;
if (cfg.recallPeerScope === "actor") body.peer_scope = "actor";
const decayProtection = String(cfg.recallEventsDecayProtection || "").trim();
if (decayProtection) body.events_time_decay_protection = decayProtection;

const sessionId = String(options.sessionId || "").trim();
if (sessionId) {
Expand Down
6 changes: 6 additions & 0 deletions examples/memory-plugin-shared/recall-core.test.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,12 @@ test("context requests preserve the configured recall width and server budget",
assert.equal(body.purpose, "coding");
});

test("context requests send an event decay window only when one is configured", () => {
assert.equal(buildContextSearchBody({}).events_time_decay_protection, undefined);
assert.equal(buildContextSearchBody({ recallEventsDecayProtection: " " }).events_time_decay_protection, undefined);
assert.equal(buildContextSearchBody({ recallEventsDecayProtection: "7d" }).events_time_decay_protection, "7d");
});

test("context requests omit defaults owned by the server", () => {
const body = buildContextSearchBody({
recallLimit: 10,
Expand Down
2 changes: 2 additions & 0 deletions examples/openclaw-plugin/shared/recall-core.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,8 @@ export function buildContextSearchBody(cfg = {}, options = {}) {
if (limitConfigured) body.quotas = codingQuotas(limit);
if (maxTokensConfigured) body.max_tokens = maxTokens;
if (cfg.recallPeerScope === "actor") body.peer_scope = "actor";
const decayProtection = String(cfg.recallEventsDecayProtection || "").trim();
if (decayProtection) body.events_time_decay_protection = decayProtection;

const sessionId = String(options.sessionId || "").trim();
if (sessionId) {
Expand Down