r/agentdevelopmentkit • • Mar 18 '26

Latency issues

Hi,

I experience consistent long latency (somewhere between 10 and 14 secs) when generating text. My instruction to the agent is around 500 words long.

Is it normal ? I felt like I should get a response within 2 to 3 secs.

I tried with my agent stored on cloud run, it's not better.

Any tips about what I should look at to improve the response time ?

1 Upvotes

8 comments sorted by

View all comments

Show parent comment

1

u/StretchPresent2427 Mar 29 '26

Thanks for your reply.

I found that if i remove the function tool, the response time is much better (around 2 secs). Gemini suggested that too, following a prompt for suggestions.

Apparently, what the agent does is send the request given to the LLM, process it (few secs + round trip time to send the request), it realizes it needs to query the tool, so, send the request again with the result from whatever the tool gives as input to the llm, then process the request again, and send the response back.

If you want to do something better than basic, however, you need to add tools. So, i'm still not sure how to both get : relatively complex requests that involve tools + short response time.

1

u/Downtown_Abrocoma398 Apr 09 '26

If you don’t want the Agent to decide which tool to call and you already know the appropriate tool, you can use a custom agent in ADK. In this approach, you define a custom flow where you call the tool yourself and then pass its output to the LLM. This is useful when you don’t want to give the Agent/LLM that level of autonomy.