> ## 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.

# Cache Team Response

> Cache team leader and member responses in two layers.

Demonstrates two-layer caching for team leader and member responses.

```python caching.py theme={null}
"""
Cache Team Response
=============================

Demonstrates two-layer caching for team leader and member responses.
"""

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

# ---------------------------------------------------------------------------
# Create Members
# ---------------------------------------------------------------------------
researcher = Agent(
    name="Researcher",
    role="Research and gather information",
    model=OpenAIResponses(id="gpt-5.2", cache_response=True),
)

writer = Agent(
    name="Writer",
    role="Write clear and engaging content",
    model=OpenAIResponses(id="gpt-5.2", cache_response=True),
)

# ---------------------------------------------------------------------------
# Create Team
# ---------------------------------------------------------------------------
content_team = Team(
    members=[researcher, writer],
    model=OpenAIResponses(id="gpt-5.2", cache_response=True),
    markdown=True,
)

# ---------------------------------------------------------------------------
# Run Team
# ---------------------------------------------------------------------------
if __name__ == "__main__":
    content_team.print_response(
        "Write a very very very explanation of caching in software"
    )
```

## Run the Example

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

**1. Install dependencies**

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

**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 `caching.py`, then run:

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

Full source: [cookbook/03\_teams/01\_quickstart/09\_caching.py](https://github.com/agno-agi/agno/blob/v3.0.4/cookbook/03_teams/01_quickstart/09_caching.py)


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