When a user submits a query, the query is converted into an embedding and searched against the vector database to retrieve the relevant documents.

But what happens if the user asks the same or a very similar query again?

This is where semantic caching comes into the picture.

Instead of searching the vector database again, the system stores the previous search result in a cache. A cache is a temporary storage where frequently accessed or recently queried results are stored. When the user asks the same or a semantically similar query again, the system can retrieve the result directly from the cache instead of querying the vector database again.

Benefits