Skip to main content

CacheSemanticMatch

Type Alias CacheSemanticMatch 

Source
pub type CacheSemanticMatch = SemanticMatch;
Expand description

Best-match result returned by semantic cache lookups.

Aliased Type§

pub struct CacheSemanticMatch {
    pub key: Vec<u8>,
    pub value: Bytes,
    pub governance: Option<Bytes>,
    pub score: f32,
}

Fields§

§key: Vec<u8>

Cache key that produced the match.

§value: Bytes

Cached value stored for key.

§governance: Option<Bytes>

Opaque governance metadata stored with the semantic cache entry, when present.

Applications can encode tenant, subject, ACL, policy version, source document IDs, or other authorization context here and validate it before serving a cross-user semantic cache hit. Entries written through the default semantic APIs return None.

§score: f32

Cosine similarity score between the query and stored embedding.