Trying to implement prompt caching using MongoDBCache in my RAG based document answering system but facing an issue
Hey guys!
I am working on a multimodal rag for complex pdfs (using a pdf rag chain) but i am facing an issue. I am trying to implement prompt caching using Langchain's MongoDBCache in my RAG based document answering system.
I had created a post on this issue few days ago but i didn't get any replies due to lack of enough description of the problem.
The problem i am facing is that the query that i ask is getting stored into the MongoDBCache but, when i ask that same query again, MongoDBcache is not being used to return the response.
For example look at the screenshots: i said "hello". That query and response got stored into the cache ( in second screenshot ) , but when i send "hello" one more time, i get a unique response, different from the previous one. Ideally it should be same as previous one as the previous query and its response was cached. But that doesn't happen, instead the second "hello" query also gets cached with a unique ID.
Note: MongoDBCache is different from Semantic Cache
code snippet: