クイックスタート

5 分で最初のリコールを。

キーひとつ、インストール 1 行、呼び出し 3 つで、エージェントに記憶が備わります。このページのスニペットはすべて実際に実行したもので、レスポンスは原文のまま掲載しています。

1

API キーを取得

コンソールで作成します。wos-live- で始まる 155 文字のキーは一度だけ表示されます。環境変数に保管し、コードには決して書かないでください。

2

インストール

pip install wontopos        # Python
npm install wontopos        # TypeScript / JavaScript
cargo add wontopos          # Rust
# curl - nothing to install, just set WOS_API_KEY
# latest: SDK v2.2.37 · MCP v1.0.19
3

ストアを作成し、保存と呼び出しを

ストアとは、読み書きの単位となる user_id です。ストアは明示的で、まず作成し(下の呼び出し)、その中で保存・呼び出しを行います。保存 - 取り込み時に索引付け、LLM 呼び出しなし。呼び出し - 短期 + 長期 + コンテキストを 1 往復で。

from wontopos import Client

mem = Client(api_key="wos-live-...", user_id="alice")  # set the store once
mem.create_store()              # create it (stores are explicit)
mem.add("she prefers tea over coffee")  # no user_id needed

# one call → short-term + long-term + context
ctx = mem.recall("what does alice drink?")
import { Client } from "wontopos";

const mem = new Client({ apiKey: "wos-live-...", userId: "alice" });  // set the store once
await mem.createStore();            // create it (stores are explicit)
await mem.add("she prefers tea over coffee");  // no userId needed

// one call → short-term + long-term + context
const ctx = await mem.recall("what does alice drink?");
use wontopos::Client;

let mem = Client::new("wos-live-...").with_user("alice");  // set the store once
mem.create_store(None).await?;            // create it (stores are explicit)
mem.add("she prefers tea over coffee", None, json!({})).await?;

// one call → short-term + long-term + context
let ctx = mem.recall("what does alice drink?", None).await?;
# create the store once - stores are explicit
curl -X POST https://api.wontopos.com/api/v1/memory/collection \
  -H "X-API-Key: $WOS_API_KEY" -H "Content-Type: application/json" \
  -d '{"user_id":"alice"}'

# store - indexed on the way in, no LLM call
curl -X POST https://api.wontopos.com/api/v1/memory/store \
  -H "X-API-Key: $WOS_API_KEY" -H "Content-Type: application/json" \
  -d '{"user_id":"alice","content":"she prefers tea over coffee"}'

# one call → short-term + long-term + context
curl -X POST https://api.wontopos.com/api/v1/memory/recall \
  -H "X-API-Key: $WOS_API_KEY" -H "Content-Type: application/json" \
  -d '{"user_id":"alice","query":"what does alice drink?"}'
実際のレスポンス - create_store()
{"user_id": "alice", "status": "created"}
実際のレスポンス - add()
{"id": "576700aa-f0e0-4c26-99a0-10e2d5b0d624", "status": "stored (1 chunks)"}
ストアは一度だけ設定。クライアントに user_id を渡せば、以降のすべての呼び出しがそれを使うため、繰り返す必要はありません。個別の呼び出しに user_id を渡せば、その呼び出しだけ上書きできます。ストアは明示的:存在しないストアへの保存・呼び出しは 404 を返します - まず作成してください。すべてのアカウントには最初から default ストアがあるため、user_id を一切指定しないゼロ設定の経路もそのまま動きます。一覧と管理は ストア を参照してください。

recall() は 4 つのブロックを返します - short_term(直近のターン)、long_term(関連する記憶)、context(ベストマッチの前後)、そして LLM に使い方を伝える instruction。まるごとプロンプトに入れてください。

どの言語でも動きます。英語で保存し、韓国語・日本語・中国語で尋ねても、同じ記憶が返ってきます。70 の言語ペアで recall@5 95.2% です。

言語別の全メソッド →

クライアント1つを設定違いで使い回す

mem = Client.from_env()                 # reads WONTOPOS_API_KEY
scroll = mem.with_model("scroll-1.2")  # this copy only: another engine
alice  = mem.with_user("alice")       # this copy only: another default store
const alice = mem.withUser("alice");
const scroll = mem.withModel("scroll-1.2");
let alice = mem.with_user("alice");
let scroll = mem.with_model("scroll-1.2");
# curl has no copies — send model and user_id with each request
curl ... -d '{"user_id":"alice","model":"scroll-1.2","query":"…"}'