This example demonstrates how to add location context to agent instructions, enabling the agent to provide location-specific responses and search for local information.
from agno.agent import Agentfrom agno.models.openai import OpenAIResponsesfrom agno.tools.hackernews import HackerNewsToolsagent = Agent( model=OpenAIResponses(id="gpt-5.2"), add_location_to_context=True, tools=[HackerNewsTools(cache_results=True)],)agent.print_response("What city am I in?", stream=True)agent.print_response("Search for tech news relevant to my location", stream=True)