跳转到内容

使用示例

memory({ mode: "add", content: "Project uses microservices architecture" });
memory({ mode: "search", query: "architecture decisions" });
memory({ mode: "search", query: "architecture decisions", scope: "all-projects" });
memory({ mode: "profile" });
memory({ mode: "list", limit: 10 });
memory({ mode: "list-shards" });
memory({ mode: "migrate", fromPath: "/old/path/to/project" });
memory({ mode: "export", outputPath: "./memories.json" });
memory({ mode: "import", inputPath: "./memories.json" });

在 http://127.0.0.1:4747 访问 Web 界面,进行可视化的记忆浏览与管理。

网络绑定安全: 除非你有意暴露 UI,否则请将 webServerHost 保持在 127.0.0.1。绑定到 0.0.0.0(或任何非回环主机)需要 webServerApiToken;所有 /api/* 请求随后必须发送 Authorization: Bearer <token> 或 X-Opencode-Mem-Token。使用 ?apiToken=<token> 打开 UI,以便浏览器存储并发送它。

维度迁移会先生成每个新嵌入,将它们导入临时索引分片,验证行数,然后才替换原始文件。失败的迁移会保持源分片不变。