Skip to content

docs(adr): ADR-0049 AI semantic response caching - #16

Open
usernane wants to merge 2 commits into
mainfrom
adr/0049-ai-semantic-cache
Open

docs(adr): ADR-0049 AI semantic response caching#16
usernane wants to merge 2 commits into
mainfrom
adr/0049-ai-semantic-cache

Conversation

@usernane

Copy link
Copy Markdown
Member

Summary

Adds ADR-0049 documenting the decision to add semantic (similarity-based) response caching, layered on top of the existing exact-match cache (ADR-0033) and backed by RagProviderInterface (ADR-0045).

Key decisions recorded

  • SemanticCache is a standalone component, not a CacheInterface implementation (different lookup model: text similarity vs. string-key equality).
  • Tiered lookup: exact (safe, free) → semantic (approximate, opt-in) → provider.
  • Semantic caching is off by default; conservative 0.95 similarity threshold; single-turn only initially.
  • Requires ChatResponse/value-object serialization (toArray()/fromArray()) as a prerequisite, since responses are stored in vector-store metadata.
  • Multi-turn embedding strategy explicitly deferred.

Tracking

Implementation tracked under milestone v0.7.3 - Semantic Caching in WebFiori/ai: issues #143–#149.

Notes

  • Numbered 0049 (0047 and 0048 already exist locally: agent-profile-inheritance, context-usage-tracking).
  • Status: Proposed.

Ibrahim BinAlshikh added 2 commits August 30, 2026 17:16
…cking)

- 0047: AgentProfile inheritance via 'extends' + inheritance_strategy
- 0048: ContextUsage snapshot + ContextWindowConfig model table
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant