Files
plugins/packages/respire-memory/page/settings.html
T
luodaoyi 21cbeeefe0 respire-memory 0.3.6: per-turn recall and policy reads, verified background archival (luodaoyi)
Adds the respire-memory gateway middleware (packages/respire-memory, 0.3.6) by luodaoyi, with its registry.json entry and README row. It recalls from a loopback Respire Runtime on each new turn, reads the engine policy each turn and puts it in the history once (again only when it changes), keeps turn state in an encrypted store, and optionally archives turns in a detached worker through a user-configured Chat Completions service. Diary writes are confirmed by a bounded fragment readback.

Run at 7aba754 on mote (Node 22.22.0, Bun 1.4.2):
- packages/respire-memory: `node scripts/check.mjs` ok (4 protocol, policy dedup/change/revert, byte-identical prefixes, failed read, diary readback); `bun test` 1 pass.
- root: `HOME=$(mktemp -d) bun test` 4187 pass, 9 skip, 0 fail (4196 tests, 328 files); `bun scripts/check.mjs` exit 0.
- Review probe (fake loopback Runtime, 2000-byte policy, six chat turns with a host restart at turn 3, a policy change, then the Runtime down), Bun and Node: per-turn overhead grows ~524 bytes a turn (the read receipt), not the policy; no earlier prefix changed; one policy read per turn; two policy blocks after the change; with the Runtime down the latest turn is unchanged. With no Runtime at all the body passes through unchanged.
- Capture probe: with capture on, a turn whose JSON exceeds the ~4000-char readback budget is written and then recorded unconfirmed, and archival skips it. The PR's check asserts this and the README documents it.
- Harm check: no new dependencies, install scripts or workflow changes; network only to the loopback Runtime and the user's own generation URL.

Not tried: a real Respire Runtime.
2026-10-31 21:36:56 +08:00

39 lines
4.3 KiB
HTML
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<!doctype html>
<html lang="zh-CN">
<head>
<meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1">
<title>respire-memory</title><link rel="icon" href="icon.svg" type="image/svg+xml"><link rel="stylesheet" href="style.css">
<script src="_magpie/bridge.js" defer></script><script src="settings.js" defer></script>
</head>
<body><main>
<header><img class="brand brand-light" src="icon-respire-ai-memory-light.svg" width="46" height="46" alt=""><img class="brand brand-dark" src="icon-respire-ai-memory.svg" width="46" height="46" alt=""><div><h1>respire-memory</h1><p>吸即存,呼即取——让 AI Agent 在实践中积累经验,持续自进化。</p></div></header>
<form id="form">
<label for="url">本地 Runtime 地址</label>
<input id="url" type="url" required value="http://127.0.0.1:15169" autocomplete="off" spellcheck="false" aria-describedby="url-help">
<small id="url-help">仅连接 127.0.0.1 或 [::1]。请先通过 rsrs 准备好账号、模型和 Runtime。</small>
<label for="project">项目名称(可选)</label>
<input id="project" maxlength="256" autocomplete="off" aria-describedby="project-help">
<small id="project-help">填写后只召回该项目,并为新记录设置此项目。留空使用整个当前记忆库;工作目录不会自动成为项目边界。</small>
<label class="check"><input id="remember" type="checkbox" checked>处理“记住:”“remember:”等显式存储请求</label>
<label class="check"><input id="readOnly" type="checkbox">插件只读:禁止显式存储、采集和后台归档</label>
<label class="check"><input id="showMemoryStatus" type="checkbox">向模型提供 Memory、Used 和上次保存状态提示</label>
<label class="check"><input id="capture" type="checkbox">将每轮完成的对话保存到日记</label>
<p class="disclosure">开启采集后,用户与助手消息、工具参数和结果中的文件内容、命令输出均可能进入 Respire。日记仍按你的同步设置同步;这不会自动提炼为长期结论。</p>
<fieldset><legend>后台记忆整理</legend>
<label class="check"><input id="archive" type="checkbox" checked>每个完成回合自动存过程日记,并提炼、查重和整理长期记忆</label>
<label for="generationBaseUrl">生成服务地址(兼容 Chat Completions)</label>
<input id="generationBaseUrl" type="url" placeholder="https://provider.example/v1" autocomplete="off" spellcheck="false">
<label for="generationModel">生成模型名称</label><input id="generationModel" autocomplete="off" spellcheck="false">
<label for="authorizationEnv">服务凭据所在的环境变量名称</label><input id="authorizationEnv" value="RESPIRE_MAGPIE_AUTHORIZATION" autocomplete="off" spellcheck="false">
<small>仅填变量名,不在此处输入密钥。变量应在 Magpie 启动环境中配置;插件不会读取客户端私有登录凭据。</small>
<label for="stateDir">状态目录(可选,填写绝对路径)</label><input id="stateDir" autocomplete="off" spellcheck="false">
<small>留空使用用户目录的 .rsrs/magpie。状态与待处理证据加密保存在此处;密钥同目录保存,应按敏感资料保护整个目录。</small>
<p class="disclosure">完整读存流程需要配置生成服务。每轮自动归档默认开启;关闭或模型未配置时不能视为满足每轮必存。消息、工具结果与相关记忆会发送给此服务,并产生额外模型用量。宿主只在回复完成后通知,不能保证回复发出前已存;缺失历史或入队前丢失通知仍会漏记。只读开关在后续请求同步给 worker,不会撤销已接受的写入。</p>
</fieldset>
<button id="save" type="submit" disabled>保存配置</button>
<p id="status" role="status" aria-live="polite">正在读取配置…</p>
</form>
<section><h2>使用方式</h2><p>召回自动执行。“/nomem”或“#nomem”只跳过本条召回;已开启的采集与后台归档仍可运行。存储是否成功以模型收到的引擎回执为准。</p><p>插件不安装或启动 Runtime。连接失败时原对话继续;共享网关的其他调用者无法使用此插件读取或保存记忆。</p></section>
</main></body>
</html>