> ## Documentation Index
> Fetch the complete documentation index at: https://agno-v2.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Location Context

> Demonstrates adding location and timezone context to team prompts.

```python location_context.py theme={null}
"""
Location Context
================

Demonstrates adding location and timezone context to team prompts.
"""

from agno.agent import Agent
from agno.models.openai import OpenAIResponses
from agno.team import Team

# ---------------------------------------------------------------------------
# Create Members
# ---------------------------------------------------------------------------
planner = Agent(
    name="Travel Planner",
    model=OpenAIResponses(id="gpt-5-mini"),
    instructions=[
        "Use location context in recommendations.",
        "Keep suggestions concise and practical.",
    ],
)


# ---------------------------------------------------------------------------
# Create Team
# ---------------------------------------------------------------------------
trip_planner_team = Team(
    name="Trip Planner",
    model=OpenAIResponses(id="gpt-5-mini"),
    members=[planner],
    add_location_to_context=True,
    timezone_identifier="America/Chicago",
    instructions=[
        "Plan recommendations around local time and season.",
        "Mention when local timing may affect itinerary decisions.",
    ],
)


# ---------------------------------------------------------------------------
# Run Team
# ---------------------------------------------------------------------------
if __name__ == "__main__":
    trip_planner_team.print_response(
        "What should I pack for a weekend trip based on local time and climate context?",
        stream=True,
    )
```

## Run the Example

<Snippet file="create-venv-step.mdx" />

**1. Install dependencies**

```bash theme={null}
uv pip install -U agno openai requests
```

**2. Export your OpenAI API key**

```bash Mac/Linux theme={null}
export OPENAI_API_KEY="your_openai_api_key_here"
```

```bash Windows theme={null}
$Env:OPENAI_API_KEY="your_openai_api_key_here"
```

**3. Run the example**

Save the code above as `location_context.py`, then run:

```bash theme={null}
python location_context.py
```

Full source: [cookbook/03\_teams/09\_context\_management/location\_context.py](https://github.com/agno-agi/agno/blob/v3.0.4/cookbook/03_teams/09_context_management/location_context.py)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.