import { MemoryContract } from "../contracts/memory/memory.contract.mjs"; import { MemoryConfig } from "../contracts/memory/memory-config.type.mjs"; //#region ../ai/src/memory/memory.d.ts /** * Create an agent memory store (memory core M2). * * Wires up to four tiers behind the {@link MemoryContract}: **working** * (in-run scratch, recency), **semantic** (durable facts by cosine * similarity), **episodic** (durable events, similarity blended with * recency), and **procedural** (durable how-tos, similarity blended with * reinforcement). The working tier is on by default; the other three each * activate only when their config is supplied. The three vector tiers * mirror how `semanticCache` delegates similarity to the cache driver's * `.similar()`. * * Resolution happens once here, at construction (loud), rather than per * call (silent until first use): a vector-tier config with no `store` and * no `ai.config({ defaultStore })` throws now; enabling no tier at all * throws now. * * TTL-based decay / forgetting remains deferred. The working tier is * size-bounded (`working: { maxItems }`, default `1000`, oldest-written * evicted first) because it is the one tier that holds everything it is * told in process memory for the life of the instance; the durable tiers * delegate retention to their `CacheDriver`. * * **Isolation (4.15.0).** `remember({ scope })` / `recall(query, { scope })` * carry an opaque tenant / session key that every tier enforces as an * exact-equality filter before scoring — one scope's memories never * surface in another's recall, and identical text under two scopes stays * two entries. Unscoped writes form a shared pool that only an unscoped * recall can read; there is no "all scopes" query. `ai.orchestrator()` * derives this from the turn's `sessionId` automatically. * * @example * import { ai } from "@warlock.js/ai"; * import { MemoryCacheDriver } from "@warlock.js/cache"; * * const store = new MemoryCacheDriver(); * store.setOptions({}); * * const mem = ai.memory({ * semantic: { embedder, store }, * defaultTier: "semantic", * }); * * await mem.remember({ text: "User prefers concise answers." }); * const hits = await mem.recall("how should I respond?", { k: 3 }); */ declare function memory(config?: MemoryConfig): MemoryContract; //#endregion export { memory }; //# sourceMappingURL=memory.d.mts.map