Skip to main content
Dependencies are a way to inject variables into your Agent context. The dependencies parameter accepts a dictionary containing functions or static variables that are automatically resolved before the agent runs.
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.
dependencies.py
Dependencies can be static values or callable functions. When using functions, they are automatically executed at runtime before the agent runs, and their return values are used as the dependency values.
You can set dependencies and add_dependencies_to_context on Agent initialization, or pass them dynamically to the run(), arun(), print_response() and aprint_response() methods.

Adding dependencies to context

Set add_dependencies_to_context=True to add the entire list of dependencies to the user message. This way you don’t have to manually add the dependencies to the instructions.
dependencies_instructions.py
This adds the entire dependencies dictionary to the user message between <additional context> tags. The new user message looks like this:

Access dependencies in tool calls and hooks

You can access the dependencies in tool calls and hooks by using the RunContext object.
See the RunContext schema for more information.

Learn more

Dependencies Overview

Learn about dependencies in Agno

Add Dependencies on Run

Pass dependencies to agent.run()

Add Dependencies to Context

Auto-inject dependencies into messages

Access in Tools

Use dependencies in custom tools