Scoria.SemanticCache (scoria v0.1.3)

Copy Markdown View Source

Scoria.SemanticCache is the public context for tenant-scoped semantic cache lookup, admission, reuse evidence, and invalidation.

Use it only for explicitly safe read-only work after the default runtime path is green. The host app owns identity, tenant scope, policy values, and the decision that a profile is safe to reuse; Scoria owns compatibility checks, lifecycle state, and reviewer trace evidence for hit, miss, bypass, and reject outcomes.

See guides/capabilities/semantic-cache.md for setup, profile vocabulary, verification, and troubleshooting. Semantic cache is not a knowledge base: it reuses compatible answers, while the optional knowledge base owns retrieval, citations, and grounding.

Summary

Functions

admit(attrs)

invalidate_by_policy(attrs)

invalidate_by_prompt(attrs)

invalidate_by_source(attrs)

invalidate_entry(entry, reason_code, metadata \\ %{})

list_events(entry_id)

lookup(attrs)

mark_stale(entry, reason_code, metadata \\ %{})

record_reuse(entry, attrs \\ %{})

record_writeback_rejection(attrs)

record_writeback_rejection(entry, attrs)

revoke_entry(entry, metadata \\ %{})