跳转到主要内容

Node.js

安装官方 Node.js / TypeScript SDK:
npm install memorose-client
基础检索流程:
import { MemoroseClient } from "memorose-client";

const client = new MemoroseClient("http://127.0.0.1:3000", "your_api_key");
const streamId = "11111111-1111-1111-1111-111111111111";

await client.ingestEvent("user_123", streamId, {
  content: "Dylan prefers concise summaries.",
  org_id: "default",
});

const response = await client.retrieveMemory("user_123", streamId, {
  query: "What does Dylan prefer?",
  limit: 5,
  org_id: "default",
});

console.log(response.results);
服务端 reranker 模式,包括 arbitrator,在 Memorose 服务启动时配置。SDK 请求不会选择 reranker 模型。