package com.correx.core.talkie.l3

/**
 * Cross-session memory store interface for vector-based retrieval.
 * Vectors are pre-computed; this contract focuses on storage and similarity search.
 */
interface L3MemoryStore {
    /**
     * Store a memory entry with its vector.
     */
    suspend fun store(entry: L3MemoryEntry)

    /**
     * Query the store with a vector; returns top-k hits sorted by similarity score descending.
     */
    suspend fun query(query: L3Query): List<L3Hit>

    /**
     * Returns true if any stored entry has a [L3MemoryEntry.turnId] that starts with [prefix].
     */
    suspend fun existsByTurnIdPrefix(prefix: String): Boolean

    /**
     * Close the store and release resources.
     */
    suspend fun close()
}
