> ## Documentation Index
> Fetch the complete documentation index at: https://docs.agno.com/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.
</Note>

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

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

<CardGroup cols={2}>
  <Card title="Dependencies with Agents" icon="robot" href="/dependencies/agent/overview">
    Learn how to use dependencies with agents
  </Card>

  <Card title="Dependencies with Teams" icon="users" href="/dependencies/team/overview">
    Learn how to use dependencies with teams
  </Card>

  <Card title="AgentOS API" icon="code-branch" href="/agent-os/api/usage">
    Pass dependencies via the AgentOS API
  </Card>

  <Card title="Agent Schema" icon="book" href="/reference/agents/agent">
    View the full Agent schema reference
  </Card>
</CardGroup>
