> For clean Markdown of any page, append .md to the page URL. > For a complete documentation index, see https://docs.forboc.ai/npm/memory/llms.txt. > For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.forboc.ai/_mcp/server. # Memory (RAG) Memory behavior in `sdk@0.6.3` is driven by protocol instructions and remote memory endpoints. ## Protocol Semantics During `processNPC`: * API can request recall via `memoryRecall` * API can request storage via `memoryStore` * If either is requested and no memory engine is configured, `processNPC` fails fast ## Remote Memory Thunks ```typescript import { createSDKStore, listMemoryRemoteThunk, recallMemoryRemoteThunk, storeMemoryRemoteThunk, clearMemoryRemoteThunk } from '@forbocai/core'; const store = createSDKStore(); const apiUrl = 'https://api.forboc.ai'; const apiKey = process.env.FORBOCAI_API_KEY; const listed = await store.dispatch(listMemoryRemoteThunk({ npcId: 'npc_1', apiUrl, apiKey })).unwrap(); const recalled = await store.dispatch(recallMemoryRemoteThunk({ npcId: 'npc_1', query: 'merchant key', apiUrl, apiKey })).unwrap(); await store.dispatch(storeMemoryRemoteThunk({ npcId: 'npc_1', observation: 'Player bought the old key', importance: 0.9, apiUrl, apiKey })).unwrap(); await store.dispatch(clearMemoryRemoteThunk({ npcId: 'npc_1', apiUrl, apiKey })).unwrap(); ``` ## CLI ```bash npx forbocai memory list npx forbocai memory recall npx forbocai memory store npx forbocai memory clear npx forbocai memory export ``` > Remote memory operations and protocol-driven local memory requirements