import type { ForgetInput, MemoryProvider, MemoryRecord, MemoryStatus, RecallInput, RememberInput } from "../types.js"; /** * Configuration shape for a single mem0 sub-component (embedder / vectorStore / llm). * Passed through verbatim to `new Memory({ ... })`. */ export interface Mem0ComponentConfig { provider: string; config: Record; } export interface Mem0BackendConfig { /** When true, mem0 runs its LLM-driven fact extraction on `add`. Default false (raw store). */ inferOnWrite: boolean; /** SQLite history db path (passed to mem0 as `historyDbPath`). */ historyDbPath: string; embedder?: Mem0ComponentConfig; vectorStore?: Mem0ComponentConfig; llm?: Mem0ComponentConfig; } /** * Thin adapter over `mem0ai/oss`'s Memory class. * * The actual `mem0ai` module is loaded once via the factory's dynamic import * and passed into the constructor here. That keeps the optional peer dep out * of the load path for users on `backend: "local"`. */ export declare class Mem0MemoryProvider implements MemoryProvider { readonly backend: "mem0"; private readonly memory; private readonly inferOnWrite; private readonly embedderInfo; constructor(args: { memory: any; inferOnWrite: boolean; embedder?: Mem0ComponentConfig; }); remember(input: RememberInput): Promise; recall(input: RecallInput): Promise; forget(input: ForgetInput): Promise<{ removed: number; }>; status(namespace: string): Promise; recent(namespace: string, limit?: number): Promise; } /** * Build a Mem0MemoryProvider. Loads `mem0ai/oss` dynamically so users on the * `local` backend never pay for it. Applies smart-defaults for the embedder * when the user has not configured one explicitly. */ export declare function createMem0Provider(args: { config: Mem0BackendConfig; }): Promise; /** * Embedder auto-detection used when `config.memory.mem0.embedder` is not set. * * Order (matches plan): * 1. Ollama if http://localhost:11434/api/tags responds within 200 ms. * 2. OpenAI if OPENAI_API_KEY is set. * 3. Throw a clear error pointing the user at docs/memory.md. */ export declare function detectEmbedder(opts?: { ollamaUrl?: string; fetchImpl?: typeof fetch; timeoutMs?: number; hasOpenAIKey?: boolean; }): Promise; //# sourceMappingURL=provider.d.ts.map