import { d as MemoryAdapterFactory } from '../../../types-B_kkAV7t.js'; /** * mem0 memory adapter — a thin `MemoryAdapter` over the mem0 REST API. * * mem0 already does per-user memory: extraction + consolidation happen * SERVER-SIDE, so `record` just passes the raw turn and mem0 extracts. The * mapping is almost 1:1, which validates the contract: * * retrieve({query,limit}) → POST /v1/memories/search (filters: user_id + agent_id) * record({messages}) → POST /v1/memories (mem0 extracts) * list() → GET /v1/memories (user_id + agent_id) * forget(id) → DELETE /v1/memories/:id * forgetAll() → DELETE /v1/memories (user_id + agent_id) * * The bound `userId` becomes mem0's `user_id`; the per-request factory is the * IDOR boundary; the agent namespace becomes mem0's `agent_id`. No extraction * model of our own — mem0 is the extractor. The API key is server-side only * (`server-only`), like the Supabase service-role key. * * NOTE: mem0's exact field names/paths vary by version; this client targets the * v1 REST shape and is intentionally tolerant when parsing responses. Adjust * `baseUrl`/paths for self-hosted mem0 (OSS) vs. the managed platform. */ interface Mem0Options { /** mem0 API key. Required. Server-side only. */ apiKey: string; /** Agent namespace → mem0's `agent_id`. Default 'default'. */ agentId?: string; /** API base URL. Defaults to the managed platform; override for self-host. */ baseUrl?: string; /** Optional fetch override (testing). */ fetch?: typeof fetch; /** Per-request timeout (ms) for the mem0 API. Defaults to 30s; `0` disables. */ timeoutMs?: number; } /** * Create a `MemoryAdapterFactory` backed by mem0. Because mem0 extracts * server-side, drop `extractionModel` — there's nothing to configure locally. * * adapter: createMem0Memory({ apiKey: process.env.MEM0_API_KEY, agentId: 'support-bot' }) */ declare function createMem0Memory(options: Mem0Options): MemoryAdapterFactory; export { type Mem0Options, createMem0Memory };