Context Window & Learning

I have a database of information that I’d like Gemini to use. When I interface with Gemini, it uses this database to formulate a response. It works well, however, after some time, I then find the context window is full, and the database information is truncated, thereby impeding the operation of retrieving the necessary information. I then need to create a new chat, input the database again, which is tedious.

How can I get around this issue of the database information being truncated?

Hi @MarkEX , Welcome to the forum.

Could you confirm whether you are passing the same database information in each subsequent call? Also, which model are you currently using? You might want to consider using gemini-1.5-pro, which supports a context window of up to 2 million tokens, this could be beneficial for your use case.

In the meantime, you may also want to explore our Document Q&A with Vector Database Cookbook for a more scalable solution.

Ok - thanks for the reply.

Each chat uses the same database information, and the requests, which are dynamic, relate specifically to the database, in this case a book with various psychological terms.

What about Content Caching?

Yes, you can also use explicit context caching. Let me know if it solved your issue.

Thanks