janiussyafiq opened a new pull request, #13632:
URL: https://github.com/apache/apisix/pull/13632

   ### Description
   
   Adds the optional **semantic (L2)** cache layer to `ai-cache`. On an exact 
(L1) miss, the request prompt is embedded and matched against a RediSearch 
cosine vector index; a hit above `similarity_threshold` is served and 
backfilled into L1. The layer is strictly opt-in via `layers: ["exact", 
"semantic"]`, so the default exact-only path is unchanged.
   
   - Embedding providers: `openai` and `azure_openai`.
   - Per effective-model and per-tenant (`cache_key`) partition isolation of 
the vector index.
   - Fail-open: any embedding or vector-store error degrades to a MISS, never a 
5xx.
   - Response status reported as `HIT-L1` / `HIT-L2` (with 
`X-AI-Cache-Similarity`).
   
   #### Which issue(s) this PR fixes:
   Fixes #
   
   ### Checklist
   
   - [x] I have explained the need for this PR and the problem it solves
   - [x] I have explained the changes or the new features added to this PR
   - [x] I have added tests corresponding to this change
   - [x] I have updated the documentation to reflect this change
   - [x] I have verified that this change is backward compatible (If not, 
please discuss on the [APISIX mailing 
list](https://github.com/apache/apisix/tree/master#community) first)
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to