Composio Tools

Give an agent a Composio GitHub action and ask it to star a repository.

composio_tools.py
"""
Composio Tools
=============================

Demonstrates composio tools.
"""

from agno.agent import Agent
from composio_agno import Action, ComposioToolSet

# ---------------------------------------------------------------------------
# Create Agent
# ---------------------------------------------------------------------------


toolset = ComposioToolSet()
composio_tools = toolset.get_tools(
    actions=[Action.GITHUB_STAR_A_REPOSITORY_FOR_THE_AUTHENTICATED_USER]
)
agent = Agent(tools=composio_tools)

# ---------------------------------------------------------------------------
# Run Agent
# ---------------------------------------------------------------------------
if __name__ == "__main__":
    agent.print_response("Can you star agno-agi/agno repo?")

Connect GitHub before running

This cookbook uses the ComposioToolSet adapter from composio-agno 0.7.20, whose get_tools method wraps actions as Agno toolkits. After installing dependencies, connect the GitHub account to use for the action:

composio add github

Complete the CLI authentication flow before starting the script. The account connection is separate from OPENAI_API_KEY; the agent run can star the named repository using that connected account.

Run the Example

Set up your virtual environment

uv venv --python 3.12
source .venv/bin/activate

Install dependencies

uv pip install -U agno composio-agno==0.7.20 openai

Export your OpenAI API key

export OPENAI_API_KEY="your_openai_api_key_here"

Run the example

Save the code above as composio_tools.py, then run:

python composio_tools.py

Full source: cookbook/91_tools/composio_tools.py