SDKs

TypeScript SDKs

Use @memexai/sdk for the service or @memexai/core as an in-process runtime.

MemexAI has two TypeScript packages. Choose based on how your app connects to memory storage:

@memexai/sdk connects to the containerized MemexAI service over HTTP. Recommended for most apps.

npm install @memexai/sdk
import { MemexAI } from '@memexai/sdk'

const memex = new MemexAI({
  url: 'http://localhost:8080',
  apiKey: 'dev-agent-key',
})

const memory = memex.forUser({
  userId: 'demo_user',
  actor: 'assistant',
})

const result = await memory.find('What does this user prefer?')
console.log(result.results)

Toolsets

const system = await memory.getSystemPrompt('You are a helpful assistant with durable user memory.')
const memorySubagentTools = memory.createMemorySubagentToolset()
const rawTools = memory.createRawToolset()

Use system in your model call alongside the toolset. For lower-level control, memory.getPromptBlock() returns only the MemexAI memory section so you can compose the final system prompt yourself.

Framework adapters

FrameworkPackagePage
Vercel AI SDK@memexai/sdk, @memexai/coreVercel AI SDK adapter
Anthropic SDK@memexai/coreAnthropic adapter
LangChain@memexai/sdk, @memexai/coreLangChain adapter
OpenAI SDK@memexai/sdkOpenAI adapter

On this page