Quickstart
You’ll need a Memoturn API key and project slug. Get them from memoturn.ai → API keys in your project.
1. Pick a transport
Section titled “1. Pick a transport”pnpm add @memoturn/sdkimport { Memoturn } from "@memoturn/sdk";
const mt = new Memoturn({ apiKey: process.env.MEMOTURN_API_KEY!, projectId: "my-project",});
await mt.recordTurn({ role: "user", content: "deploying the worker tonight" });
const { hits } = await mt.searchMemory({ query: "deploy", k: 5 });console.log(hits);pnpm add -g @memoturn/climt init # one-time: store key + projectmt record "deploying the worker tonight"mt search "deploy"{ "mcpServers": { "memoturn": { "transport": "http", "url": "https://api.memoturn.ai/v1/mcp", "headers": { "Authorization": "Bearer ${MEMOTURN_API_KEY}", "X-Project-Id": "my-project" } } }}Restart Claude Code; the record_turn, search_memory, etc. tools will appear under the memoturn server.
2. Search modes
Section titled “2. Search modes”search_memory accepts a mode:
| mode | use it for |
|---|---|
auto (default) | Hybrid recall — dense + lexical + DO-hot fused via RRF. |
chunks | Same hybrid pipeline, but excludes rolling summaries. |
summaries | Only retrieve consolidated session summaries. “What did we figure out?” |
entities | Symbol/file/error-code lookup. Pair with the regular search for full text. |
code | Hybrid plus a fourth fusion leg that boosts turns matching extracted symbols. |
await mt.searchMemory({ query: "auth flow", mode: "summaries" });3. Subscribe to live activity
Section titled “3. Subscribe to live activity”for await (const event of mt.subscribe()) { console.log(event.kind, event.payload); // turn_recorded · memory_pinned · memory_forgotten · broadcast_set · presence_updated · consolidation_completed}- MCP tool reference — every tool, every input.
- SDK guide — typed methods + WebSocket subscribe.
- Architecture — what’s between you and Postgres.