Birdwatcher is an open-source agent that provides data analysis capabilities for your data in Tinybird
It connects to the Tinybird MCP server using your Tinybird token and enables analytics via natural language
Use it locally by passing a prompt, and optionally specify a Slack channel or email address where you want to receive the response notification
git clone git@github.com:tinybirdco/ai.git
cd ai/agents/birdwatcher
# Fill in the required environment variables for your Tinybird account and LLMs.
# Optionally, provide your Slack or Resend API keys to enable notifications
cp .env.example .env
curl -LsSf https://astral.sh/uv/install.sh | sh
uv sync
uv run python birdwatcher.py \
--prompt "analyse website visits and notify me on #tmp-birdwatcher" \
--mission base
Schedule it as a GitHub Action:
name: Birdwatcher Endpoint Errors Monitor
on:
schedule:
- cron: '0 9 * * *' # Runs daily at 9:00 UTC
workflow_dispatch: # Allows manual triggering
jobs:
monitor-endpoint-errors:
runs-on: ubuntu-latest
steps:
- uses: tinybirdco/ai@main
with:
slack_token: ${{ secrets.SLACK_TOKEN }}
anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }}
tinybird_token: ${{ secrets.TINYBIRD_TOKEN }}
tinybird_host: ${{ secrets.TINYBIRD_HOST }}
prompt: |
Report endpoint errors in the last 24 hours.
Send a Slack message to #tmp-birdwatcher with the results.
No markdown.
mission: base
model: 'claude-4-sonnet-20250514'
Missions are predefined instructions that guide the Birdwatcher agent to perform specific analyses
You can find the available missions in the GitHub repository
To use a mission, provide both a prompt and the name of the mission (Markdown file):
uv run python birdwatcher.py \
--prompt "Investigate cpu spikes in the last hour and notify to alrocar@tinybird.co" \
--mission cpu_spikes
You can contribute your own missions or use the --mission
flag to instruct the agent to run a custom analysis.
uv run python birdwatcher.py \
--prompt "Analyze my web analytics metrics in the last month. Notify in #website-metrics" \
--mission "<Your custom mission rules>"
uv run python birdwatcher.py
π€ Birdwatcher Chat CLI
--------------------------------------------------
π¬ You: top 5 pages with more visits in the last 24 hours
ββ Message ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β β
β top 5 pages with more visits in the last 24 hours β
β β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
ββ Response (26.1s) βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β β
β Here are the top 5 most visited pages in the last 24 hours: β
β β
β 1 Homepage (/) - 153 visits β
β 2 Documentation quick start page (/docs/forward/get-started/quick-start) β
β - 50 visits β
β 3 Pricing page (/pricing) - 42 visits β
β 4 Templates page (/templates) - 21 visits β
β 5 Product page (/product) - 21 visits β
β β
β The homepage is by far the most visited page, with nearly three times as β
β many visits as the second most popular page. β
β β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
ββ Session Summary ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β β
β Session summary updated β
β β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ