Skip to content

How to control agent's thoughts? #3165

@Hetvi-Solanki

Description

@Hetvi-Solanki

Describe the bug

  • We are getting too much of thinking from agent even for the simplest queries like "Hi"
  • Is there any way to control the thoughts?
  • I have tried setting thinking budget to small no. of tokens, yet it does not show any effect

To Reproduce

root_agent = Agent(
    name="manager",
    model=settings.GEMINI_MODEL,
    description="Manager agent",
    instruction=manager_instruction,
    generate_content_config=GenerateContentConfig(
        temperature=settings.TEMPERATURE,
        http_options=HttpOptions(
            # milliseconds
            timeout=settings.AGENT_TIMEOUT,
        ),
    ),
    tools=[
        AgentTool(query_agent),
        AgentTool(tax_agent),
        describe_table,
        explain_query,
        get_schema,
        sample_rows
    ],
    output_schema=ManagerResponse,
    planner=BuiltInPlanner(
        thinking_config=ThinkingConfig(
            include_thoughts=True, thinking_budget=settings.MANAGER_THINKING_BUDGET
        )
    ),
)

Expected behavior
A very small thought with minimal tokens and only necessary thinking.

Screenshots

Image Image

Desktop (please complete the following information):

  • OS: Linux
  • Python version : 3.12
  • ADK version(pip show google-adk): 1.15.1

Model Information:

  • Are you using LiteLLM: No
  • Which model is being used : gemini-2.5-flash

Additional context
Also, can you explain why are somethings in [] , like "[briefly describe the initial instinct]". Refer the second photo

Metadata

Metadata

Assignees

Labels

agent engine[Component] This issue is related to Agent Engine deploymentquestion[Component] This issue is asking a question or clarification

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions