/** * Lemma API v2 — BrainStore contract (Lane 0) * * The durable backing for the /v2 memory routes. Multi-tenant: every method is * scoped by `tenantId` and every query MUST filter by it. A store that leaks one * tenant's memories to another is a security failure, not a bug (Lane B tests it). * * Implementations: PostgresBrainStore (cloud, Lane B), FileBrainStore (wraps the * local NDJSON brain, Lane B). */ export interface Candidate { id: string; score: number; } export interface BrainStore { /** Persist a memory under `tenantId`; returns its id. */ put(tenantId: string, memory: unknown): Promise; /** Fetch one memory by id, scoped to the tenant. Resolves null if not owned. */ get(tenantId: string, id: string): Promise; /** * Ranked candidates by BM25-style relevance for a query, scoped to the tenant. * Must stay under the contractual p95 budget for the lane's backing impl. */ searchCandidates(tenantId: string, query: string, limit: number): Promise; /** Fetch many memories by id in one round trip; results scoped to the tenant. */ listByIds(tenantId: string, ids: string[]): Promise>; /** Hard delete (forget), scoped to the tenant. */ delete(tenantId: string, id: string): Promise; } //# sourceMappingURL=store.d.ts.map