Background
I’m experimenting with Gemini Pro 2.5 to enhance complex, multi-stage coding tasks—entirely automated, with no human in the loop. In these tasks, I expose the model to a wide range of tools, and the interaction typically looks like this:
user->tool-call->tool-response->tool-call->tool-response->tool-call->…
issue
To make the model’s reasoning process more transparent, I’ve enabled the include_thoughts flag. However, at each stage of the task, when I inspect the thoughts summary, it appears as though the model is re-analyzing the problem from scratch. It doesn’t seem to reference its previous thinking or build on it explicitly.
example:
Let’s say I ask the model to translate a file from language A to language B.
Here’s a shortened version of the model’s initial thought summary before calling the first tool:
Okay, here's the breakdown of my thought process, taking on the persona of an expert in the field, ready to tackle this translation task.
Alright, let's dive in. My goal is to find excellent examples within the target repository that will help me translate this XXX...
First things first, I need a solid understanding of the *source* file. Okay, it's an Angular directive, which means it's responsible for rendering part of the UI based on data. It has a template, handles a scope with ...
I'll also check the file XXX to see how they handled the component.
After the tool response is returned with function call, and I am appending also the tool-response - When I am calling the LLM again, I get the next thought summary, which seems to restart the reasoning process instead of continuing from the previous step:
Okay, here's the breakdown of my thought process as I tackle this translation task. I've start by digging into the Angular code, looking at XXX. It's pretty straightforward – it's a directive that renders XXX which it then hands off to another directive YYY.
My initial thought is that XXX is a wrapper. It calls the renderer directive.
I started by looking at ZZZ figuring that's a good name for a file that would use it, but unfortunately, it doesn't seem to exist. So, I'm thinking, maybe the React translation has combined the logic.
I then looked at the file itself. I'm seeing that it handles a lot of logic, particularly based on the sub-question type.
Now, based on the returned value I need to find out *what* uses ZZZ. My gut feeling is that it's likely a component that handles displaying a page...
And again in the third turn:
Okay, let's get to work. My task is to find the React equivalent of an Angular directive, specifically XXX, within the target repository.
...
While the model does make progress and the task does converge, the internal thoughts summaries feel disconnected—as if each one is starting fresh rather than continuing a coherent line of thought.
Question
- Are the thoughts in multi-turn conversations discarded between turns?
- Is there a way to instruct the model to reference or build upon prior thoughts instead of rethinking from first principles each time?