<?php
namespace boru\ai\Embedding;

interface EmbeddingStoreInterface
{
    /**
     * Find a cached embedding result by stable cache key.
     *
     * @param string $cacheKey
     * @return EmbeddingResult|false
     */
    public function findResult($cacheKey);

    /**
     * Persist or update a cached embedding result.
     *
     * @param string $cacheKey
     * @param EmbeddingRequest $request
     * @param EmbeddingResult $result
     * @param int|null $ttlSeconds
     * @return EmbeddingResult
     */
    public function saveResult($cacheKey, EmbeddingRequest $request, EmbeddingResult $result, $ttlSeconds = null);
}
