Feature
core/semantic-caching
Lets an AI gateway answer a prompt from the replies it stored earlier when the prompt is close enough in meaning to one it answered before, rather than calling the model again. The gateway turns each prompt into a vector with embedding_model, serves a stored reply whose prompt is at least similarity_threshold alike, and keeps a reply for ttl_seconds. scope decides who shares a cache. With key, every caller presenting the same key to the gateway is served from one cache, so an end user behind that key can be served a reply generated for another, tool calls included. The default, end_user, keeps each end user the gateway identifies apart. A match on meaning suits single prompts: on multi-turn or agentic traffic consecutive turns read alike, so a reply to an earlier turn can be served for a later one. It does not meet core/data-masking on one component. The developer attaches it in the Aggregate, with its inputs in values; it takes no infra. core/gateway/litellm, azure-api-management, apisix and traefik-hub realize it, the last three keeping scope key alone, apisix and traefik-hub for the callers each Release declares; litellm, apisix and traefik-hub keep the replies in a core/datastore/redis wired to the gateway, litellm requiring its administrative key. On core/gateway/kong-enterprise and higress every attachment halts, naming the caller separation each cache lacks, and on agentgateway, naming the reply cache it lacks; on any component but these seven an attachment halts naming the type, rendering nothing.
出處
- 內容摘要
- sha256:bac81b4175f269b56678e2188d363229d5d8028c18c7928702a321bc90c751c1
- 發布時間
- 2026-11-10T10:17:27Z
- 簽署身分
- https://token.actions.githubusercontent.com/https://github.com/aggrega-ai/aggrega-hub/.github/workflows/catalog-publish-sign.yml@refs/heads/main
簽章
- 官方application/vnd.dev.sigstore.bundle.v0.3+json
https://token.actions.githubusercontent.com/https://github.com/aggrega-ai/aggrega-hub/.github/workflows/catalog-publish-sign.yml@refs/heads/main
sha256:f7c90cc58a5dd4682daeea38a0b260125ad4758a8f36a5b1811b67ff7cacdfb6
此版本的參照
oci://hub.aggrega.ai/feature/core/semantic-caching:1.0.0- 適用於
- gateway.aggrega.ai/intelligence=semantic
- 與其衝突
- —
開發者參數
開發者附加此功能時設定的值。
擴充 BaseComponents#/schemas/BaseFeatureParameter
| 名稱 | 型別 | 預設 | 必填 | 描述 |
|---|---|---|---|---|
| similarity_threshold | number (min 0, max 1) | — | 是 | How alike a prompt must be to one answered before for the stored reply to be served: the cosine similarity of their two vectors, from 0 to 1, where 1 is identical. A higher value serves fewer and closer matches; which value suits depends on embedding_model. |
| embedding_model | string (min 1) | — | 是 | The model that turns a prompt into the vector compared, named as the gateway knows it: an alias of the model map on an AI gateway, or on Azure API Management the id of a backend the instance holds for an embeddings model. Each realization refuses a name its gateway does not publish wherever the build can see what the gateway publishes; an instance's backends are not in the build, so the Azure API Management realization takes the id as written. |
| ttl_seconds | integer (min 1) | — | 是 | How long a stored reply stays usable, in seconds. |
| scope | string (key | end_user) | end_user | 否 | Who shares one cache. end_user, the default: each end user the gateway identifies has a cache of its own, so none is served a reply generated for another. key: every caller presenting the same key to the gateway shares one cache, so a reply generated for one end user behind that key can be served to another sending a similar prompt. Each realization says how its gateway identifies an end user and what it does with a request naming none, and refuses end_user where its gateway cannot keep end users apart. |
輸出契約
此功能向使用端發布的值。
未宣告任何輸出值。
註記
未宣告任何註記。
關係
與其他已發布實體之間具型別的邊。沒有已發布目標的參照,會渲染為中斷的邊,而不是連結。
使用
- 適用於適用於
gateway.aggrega.ai/intelligence=semantic
core/gateway/agentgateway v1.0.0 core/gateway/apisix v1.0.0 core/gateway/azure-api-management v1.0.0 core/gateway/cloudflare-ai-gateway v1.0.0 core/gateway/envoy-gateway v1.0.0 core/gateway/higress v1.0.0 core/gateway/kong-enterprise v1.0.0 core/gateway/litellm v1.0.0 core/gateway/traefik-hub v1.0.0 - $ref擴充結構描述(values)
BaseComponents#/schemas/BaseFeatureParameter
被使用於
與其衝突
實作
實作
實作
實作
實作
實作
實作