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

# Dependencies

> Inject variables into agent and team context with dependencies.

**Dependencies** are a way to inject variables into your Agent or Team context. The `dependencies` parameter accepts a dictionary containing functions or static variables that are automatically resolved before the agent or team runs.

> [!NOTE]
>
> You can use dependencies to inject memories, dynamic few-shot examples, "retrieved" documents, etc.

## Basic usage

You can reference the dependencies in your agent instructions or user message.

```python dependencies.py theme={null}
from agno.agent import Agent
from agno.models.openai import OpenAIResponses

agent = Agent(
    model=OpenAIResponses(id="gpt-5.2"),
    dependencies={"name": "John Doe"},
    instructions="You are a story writer. The current user is {name}."
)

agent.print_response("Write a 5 second short story about {name}")
```

> [!TIP]
>
> You can set `dependencies` on `Agent`/`Team` initialization, or pass it to the `run()` and `arun()` methods.

## How dependencies work

Dependencies are resolved at runtime, just before your agent or team executes. Here's the flow:

1. **Define dependencies**: Provide a dictionary of key-value pairs where values can be static data or callable functions
2. **Resolution**: When the agent/team runs, Agno calls all callable dependencies and replaces them with their return values
3. **Template substitution**: Resolved dependencies are available in your instructions using `{dependency_name}` syntax
4. **Context injection**: When `add_dependencies_to_context=True`, dependencies are automatically added to the user message

## Learn more

> **[Dependencies with Agents](https://agno-v2.mintlify.site/dependencies/agent/overview.md)**
>
> Inject runtime values into agent instructions and context

> **[Dependencies with Teams](https://agno-v2.mintlify.site/dependencies/team/overview.md)**
>
> Share resolved dependencies across team members

> **[AgentOS API](https://agno-v2.mintlify.site/agent-os/using-the-api.md)**
>
> Pass dependencies via the AgentOS API

> **[Agent Schema](https://agno-v2.mintlify.site/reference/agents/agent.md)**
>
> View the full Agent schema reference


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