After my talk at OutSystems ONE in Amsterdam, someone asked whether the native semantic search I built had any caching. It didn't. Every search hit the embedding API, so the same query a hundred times a day meant a hundred API calls.
So I added a cache to the RAG Knowledge Base Forge component, and wrote up how it works.
The short version: it caches both the query vector and the search result inside ODC entities, with no external vector database. A per-call parameter decides whether the full result is cached or just the vector. On a repeat query you can skip the embedding call entirely, and optionally skip the vector scan too. Expiry is handled by a timer, each record carries its own TTL, and there are a few cache management actions for invalidation.
I wrote it as a decision walkthrough rather than a feature list. Each choice has a tradeoff, and I tried to be honest about where this works and where you'd want an external vector database instead.
Full articleForge component
I'd like to hear how others are approaching this. Are you caching semantic search in ODC? Caching the result, the vector, or something else? How are you handling the freshness problem when documents change?