Skip to main content

Introduction

Agno integrates seamlessly with a wide range of external services and platforms through its tools ecosystem. This page provides an overview of integration categories and common patterns.

Integration Categories

Developer Platforms

Integrate with development tools and platforms:

GitHub

Repository management, PRs, issues, code search

Bitbucket

Bitbucket repositories and pipelines

Linear

Issue tracking and project management

Jira

Atlassian project management

Communication Platforms

Connect to messaging and communication services:

Slack

Messaging, channels, and workspace management

Discord

Discord bot integration

Telegram

Telegram bot and messaging

WhatsApp

WhatsApp Business API

Cloud Services

Integrate with cloud platforms and services:

AWS Lambda

Serverless function execution

AWS SES

Email delivery service

Google Cloud

BigQuery, Drive, Sheets, Calendar

Notion

Workspace and knowledge management

Data & Analytics

Connect to databases and analytics platforms:

PostgreSQL

SQL database operations

DuckDB

Embedded analytics database

Neo4j

Graph database integration

Redshift

AWS data warehouse

AI Services

Integrate with AI and ML platforms:

OpenAI

GPT-4, DALL-E, Whisper APIs

Replicate

ML model deployment and inference

ElevenLabs

Voice synthesis and cloning

Fal.ai

Fast AI model inference

Integration Patterns

API Key Authentication

Most integrations use API keys for authentication:
import os
from agno.agent import Agent
from agno.tools.github import GithubTools

agent = Agent(
    tools=[GithubTools(
        access_token=os.getenv("GITHUB_ACCESS_TOKEN")
    )]
)
Always store API keys in environment variables, never hardcode them in your source code.

OAuth Authentication

Some services require OAuth flows:
from agno.tools.google import GoogleSheetsTools

tools = GoogleSheetsTools(
    credentials_file="path/to/credentials.json",
    token_file="path/to/token.json"
)

Database Connections

Database integrations use connection strings:
from agno.tools.postgres import PostgresTools

tools = PostgresTools(
    db_url="postgresql+psycopg://user:pass@localhost:5432/mydb"
)

Webhook Integrations

Some integrations support webhooks for real-time events:
from agno.tools.slack import SlackTools

tools = SlackTools(
    token=os.getenv("SLACK_BOT_TOKEN"),
    webhook_url=os.getenv("SLACK_WEBHOOK_URL")
)

Configuration Best Practices

1

Use Environment Variables

Store all credentials and API keys in environment variables:
import os

api_key = os.getenv("SERVICE_API_KEY")
if not api_key:
    raise ValueError("SERVICE_API_KEY environment variable not set")
2

Use .env Files Locally

Keep credentials in a .env file (add to .gitignore):
# .env
GITHUB_ACCESS_TOKEN=ghp_xxxxxxxxxxxx
SLACK_BOT_TOKEN=xoxb-xxxxxxxxxxxx
OPENAI_API_KEY=sk-xxxxxxxxxxxx
Load with python-dotenv:
from dotenv import load_dotenv
load_dotenv()
3

Implement Retry Logic

Handle transient failures with retry logic:
from agno.tools.github import GithubTools

tools = GithubTools(
    access_token=os.getenv("GITHUB_ACCESS_TOKEN"),
    # Most tools handle retries automatically
)
4

Set Appropriate Timeouts

Configure timeouts based on expected response times:
from agno.tools.api import APITools

tools = APITools(
    timeout=30,  # 30 second timeout
)
5

Monitor Rate Limits

Be aware of API rate limits and implement appropriate handling:
# Many tools handle rate limiting automatically
# Check tool documentation for specific limits

Multi-Service Integrations

Combine multiple integrations in a single agent:
import os
from agno.agent import Agent
from agno.tools.github import GithubTools
from agno.tools.slack import SlackTools
from agno.tools.postgres import PostgresTools

agent = Agent(
    tools=[
        GithubTools(access_token=os.getenv("GITHUB_ACCESS_TOKEN")),
        SlackTools(token=os.getenv("SLACK_BOT_TOKEN")),
        PostgresTools(db_url=os.getenv("DATABASE_URL")),
    ],
    instructions=[
        "You can access GitHub, Slack, and the database",
        "Coordinate information across all services",
        "Always confirm before making changes",
    ]
)

agent.print_response(
    "Check GitHub for new PRs, summarize them, and post to #engineering on Slack"
)

Integration Security

Principle of Least Privilege

Only grant the minimum permissions needed:
# Good: Only allow reading
tools = GithubTools(
    access_token=os.getenv("GITHUB_READ_TOKEN"),  # Read-only token
    include_tools=["search_repositories", "get_repository"]  # Read operations only
)

# Avoid: Granting unnecessary write permissions
tools = GithubTools(
    access_token=os.getenv("GITHUB_ADMIN_TOKEN"),  # Admin token with all permissions
)

Credential Rotation

Regularly rotate API keys and tokens:
# Use time-limited tokens when possible
from datetime import datetime, timedelta

# Many services support token expiration
tools = ServiceTools(
    token=get_temporary_token(expires=datetime.now() + timedelta(hours=1))
)

Audit Logging

Enable logging for security-sensitive operations:
from agno.agent import Agent
from agno.tools.github import GithubTools

tools = GithubTools(
    access_token=os.getenv("GITHUB_ACCESS_TOKEN"),
    requires_confirmation_tools=["delete_repository", "delete_file"]
)

agent = Agent(
    tools=[tools],
    # Enable detailed logging
    debug=True
)

Common Integration Examples

GitHub + Slack Integration

Monitor GitHub and post updates to Slack:
import os
from agno.agent import Agent
from agno.tools.github import GithubTools
from agno.tools.slack import SlackTools

agent = Agent(
    tools=[
        GithubTools(access_token=os.getenv("GITHUB_ACCESS_TOKEN")),
        SlackTools(token=os.getenv("SLACK_BOT_TOKEN")),
    ],
    instructions=[
        "Monitor GitHub repository activity",
        "Post important updates to Slack channels",
        "Format updates clearly with links",
    ]
)

agent.print_response(
    "Check for new issues in agno-agi/agno and post a summary to #updates"
)

Database + Slack Reporting

Query database and send reports to Slack:
from agno.agent import Agent
from agno.tools.postgres import PostgresTools
from agno.tools.slack import SlackTools

agent = Agent(
    tools=[
        PostgresTools(db_url=os.getenv("DATABASE_URL")),
        SlackTools(token=os.getenv("SLACK_BOT_TOKEN")),
    ],
    markdown=True,
)

agent.print_response(
    "Query the database for today's sales metrics and "
    "post a formatted report to #sales-metrics"
)

Troubleshooting

Authentication Errors

try:
    tools = GithubTools(access_token=os.getenv("GITHUB_ACCESS_TOKEN"))
    agent = Agent(tools=[tools])
    agent.print_response("List my repositories")
except Exception as e:
    print(f"Authentication failed: {e}")
    print("Check that GITHUB_ACCESS_TOKEN is set correctly")

Rate Limit Errors

from time import sleep

try:
    agent.print_response("Search for repositories")
except RateLimitError:
    print("Rate limit exceeded. Waiting before retry...")
    sleep(60)  # Wait 1 minute
    agent.print_response("Search for repositories")

Network Timeouts

from agno.tools.api import APITools

tools = APITools(
    timeout=60,  # Increase timeout for slow APIs
    retry_attempts=3,  # Retry failed requests
)

Next Steps

Built-in Tools

Explore all available integrations

Custom Tools

Create custom integrations

MCP Servers

Connect to external MCP servers

Security Guide

Learn about security best practices

Build docs developers (and LLMs) love