{"type":"post","id":"ai-semantic-caching-semantic-caching-with-redis-for-0c0c80","slug":"ai-semantic-caching-semantic-caching-with-redis-for-0c0c80","title":"ai-semantic-caching: Semantic Caching with Redis for cheaper and faster responses","description":"A Redis-based semantic-caching example shows how a matching prompt can reuse a stored answer and remove an LLM request from the critical path.","retrieval_nugget":"A Redis-based semantic-caching example shows how a matching prompt can reuse a stored answer and remove an LLM request from the critical path.","published_at":"2026-11-28","updated_at":"2026-11-28","record_date":"2026-11-28","date_kind":"published_at","topics":["inference","ai-infrastructure"],"entities":["ai-semantic-caching","Redis","all-MiniLM-L6-v2"],"related_patterns":[],"novelty_label":"new_fact","what_changed":"This example describes a Redis-based semantic cache that matches incoming prompts by vector similarity and reuses prior responses above a threshold.","prior_refs":[],"source_url":"https://github.com/botextractai/ai-semantic-caching","source_urls":["https://github.com/botextractai/ai-semantic-caching"],"production":{"schema":"newruntime-production-v1","desk":"newsroom","first_seen_at":"2026-11-28T07:00:26.480Z","independent_sources":1,"notes_synthesized":null,"writer_model":"gpt-6-luna","critic":null,"checks":["primary_source_verified","source_fresh","one_story","copy_contract"],"novelty":{"label":"new_fact","confidence":"medium"},"editorial_value":"medium","human_review":"selective"},"citations":[{"claim":"","quotes":["About Semantic Caching with Redis for cheaper and faster responses Resources Readme Activity Stars 3 stars Watchers 0 watching Forks 0 forks Report repository Releases Packages Contributors Languages Footer &copy; 2026 GitHub, Inc.","A semantic cache embeds each … demonstrated by this caching example."],"cite_url":"https://github.com/botextractai/ai-semantic-caching#:~:text=About%20Semantic%20Caching%20with%20Redis%20for%20cheaper%20and%20faster%20responses%20Resources%20Readme%20Activity%20Stars%203%20stars%20Watchers%200%20watching%20Forks%200%20forks%20Report%20repository%20Releases%20Packages%20Contributors%20Languages%20Footer%20%26copy%3B%202026%20GitHub%2C%20Inc.&text=A%20semantic%20cache%20embeds%20each,demonstrated%20by%20this%20caching%20example.","source_url":"https://github.com/botextractai/ai-semantic-caching","publisher":"github.com"},{"claim":"It embeds each incoming prompt, searches stored prompt vectors and returns the previous response if the nearest match clears a configured distance threshold.","quotes":["This example simulates a Semantic … product questions, and account issues."],"cite_url":"https://github.com/botextractai/ai-semantic-caching#:~:text=This%20example%20simulates%20a%20Semantic,product%20questions%2C%20and%20account%20issues.","source_url":"https://github.com/botextractai/ai-semantic-caching","publisher":"github.com"},{"claim":"It uses the all-MiniLM-L6-v2 model, with 384-dimensional embeddings.","quotes":["A semantic cache embeds each … demonstrated by this caching example."],"cite_url":"https://github.com/botextractai/ai-semantic-caching#:~:text=A%20semantic%20cache%20embeds%20each,demonstrated%20by%20this%20caching%20example.","source_url":"https://github.com/botextractai/ai-semantic-caching","publisher":"github.com"},{"claim":"","quotes":["Embedding model The embedding model used in this example is all-MiniLM-L6-v2 .","This is a fast, general purpose embedding model with 384 dimensions (dims)."],"cite_url":"https://github.com/botextractai/ai-semantic-caching#:~:text=Embedding%20model%20The%20embedding%20model%20used%20in%20this%20example%20is%20all%2DMiniLM%2DL6%2Dv2%20.&text=This%20is%20a%20fast%2C%20general%20purpose%20embedding%20model%20with%20384%20dimensions%20%28dims%29.","source_url":"https://github.com/botextractai/ai-semantic-caching","publisher":"github.com"},{"claim":"","quotes":["F1 Score : Balanced metric … (hit rate) with accuracy (precision).","Semantic Caching is a powerful … thresholds based on user feedback."],"cite_url":"https://github.com/botextractai/ai-semantic-caching#:~:text=F1%20Score%20%3A%20Balanced%20metric,%28hit%20rate%29%20with%20accuracy%20%28precision%29.&text=Semantic%20Caching%20is%20a%20powerful,thresholds%20based%20on%20user%20feedback.","source_url":"https://github.com/botextractai/ai-semantic-caching","publisher":"github.com"},{"claim":"The README claims savings of more than 70% in operational costs and responses more than 80% faster.","quotes":["The LLM response times are simulated using a random delay between 0.4 and 0.6 seconds (400-600 ms)."],"cite_url":"https://github.com/botextractai/ai-semantic-caching#:~:text=The%20LLM%20response%20times%20are%20simulated%20using%20a%20random%20delay%20between%200.4%20and%200.6%20seconds%20%28400%2D600%20ms%29.","source_url":"https://github.com/botextractai/ai-semantic-caching","publisher":"github.com"}],"schema_version":"newruntime-agent-readable-v0.2","stable_id":"post:ai-semantic-caching-semantic-caching-with-redis-for-0c0c80","status":"published","visuals":[],"editor":{"role":"editor","name":"Andrey Reshetnikov","profile":"https://newruntime.com/owner-profile.md","profile_json":"https://newruntime.com/owner-profile.json","same_as":["https://www.linkedin.com/in/reshetnikov1/","https://t.me/lapetuse"]},"routes":{"html":"https://newruntime.com/posts/ai-semantic-caching-semantic-caching-with-redis-for-0c0c80/","markdown":"https://newruntime.com/posts/ai-semantic-caching-semantic-caching-with-redis-for-0c0c80.md","json":"https://newruntime.com/posts/ai-semantic-caching-semantic-caching-with-redis-for-0c0c80.json"},"markdown_url":"https://newruntime.com/posts/ai-semantic-caching-semantic-caching-with-redis-for-0c0c80.md","next_reads":[{"type":"topic","path":"/topics/inference/","url":"https://newruntime.com/topics/inference/","title":"Inference","reason":"Explore the inference topic hub.","media_type":"text/html","markdown_url":"https://newruntime.com/topics/inference.md","json_url":"https://newruntime.com/topics/inference.json"},{"type":"topic","path":"/topics/ai-infrastructure/","url":"https://newruntime.com/topics/ai-infrastructure/","title":"Ai Infrastructure","reason":"Explore the ai-infrastructure topic hub.","media_type":"text/html","markdown_url":"https://newruntime.com/topics/ai-infrastructure.md","json_url":"https://newruntime.com/topics/ai-infrastructure.json"},{"type":"collection","path":"/posts/","url":"https://newruntime.com/posts/","title":"Field Notes","reason":"Open the latest editorial analysis.","media_type":"text/html","json_url":"https://newruntime.com/posts.json"},{"type":"collection","path":"/sources/","url":"https://newruntime.com/sources/","title":"Sources","reason":"See the original sources this archive cites.","media_type":"text/html"}]}
