---
title: "Discussion on \"Semantic caching for LLMs, with a Python example\" | Hashnode"
description: "Discussion on \"Semantic caching for LLMs, with a Python example\". Return a cached LLM answer when a new question means the same as an old one. How semantic caching works, with a free Python and pgvector demo."
url: "https://hashnode.com/posts/semantic-caching-for-llms-with-a-python-example/6afaddbad1c565b7a556c0cb"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [Semantic caching for LLMs, with a Python example](https://hassanrants.hashnode.dev/semantic-caching-for-llms-with-a-python-example?utm_source=hashnode&utm_medium=feed)

Return a cached LLM answer when a new question means the same as an old one. How semantic caching works, with a free Python and pgvector demo.

1d ago · 13 min read · hassanrants.hashnode.dev  
Read the article

-   [#llm](https://hashnode.com/tag/llm)
-   [#python](https://hashnode.com/tag/python)
-   [#embeddings](https://hashnode.com/tag/embeddings)
-   [#tutorial](https://hashnode.com/tag/tutorial)

## Written by

[Hassan Aziz](https://hashnode.com/@hassandevelopment)

@hassandevelopment · Rawalpindi, Punjab, Pakistan

  
[View profile](https://hashnode.com/@hassandevelopment)

AI-native developer and entrepreneur

I'm a freelance AI consultant, YouTuber, entrepreneur, and gym freak, all in one. On this blog, you'll mostly find me talking about AI, softwaredev, and technology. Enjoy.

## Responses

Markdown supported · ⌘↵ to post

No responses yet.
