A comprehensive toolkit of AI-powered utilities for Tinybird, enabling intelligent data analysis, monitoring, and integration capabilities.
This repository contains powerful AI utilities designed to enhance your Tinybird experience:
- 🐦 Birdwatcher: An intelligent agent for automated data analysis and monitoring
- 📦 JavaScript SDK: Seamless integration with Vercel AI SDK for web applications
Birdwatcher is an open-source AI agent that provides intelligent data analysis capabilities for your Tinybird data. It connects to the Tinybird MCP server and enables analytics via natural language.
Local Usage:
git clone [email protected]:tinybirdco/ai.git
cd ai/agents/birdwatcher
cp .env.example .env # Configure your environment variables
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
GitHub Actions:
name: Birdwatcher Endpoint Errors Monitor
on:
schedule:
- cron: '0 9 * * *' # Runs daily at 9:00 UTC
workflow_dispatch:
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'
- Natural Language Queries: Ask questions about your data in plain English
- Automated Monitoring: Set up scheduled analysis and alerts
- Slack Integration: Receive notifications directly in your Slack channels
- Mission System: Predefined analysis templates for common use cases
- CLI Mode: Interactive chat interface for data exploration
Missions are predefined instructions that guide Birdwatcher to perform specific analyses. Available missions include:
- Base: General data analysis
- CPU Spikes: Infrastructure monitoring
- Daily Summary: Regular reporting
- Explore: Data discovery
The @tinybirdco/ai
package provides seamless integration between Vercel AI SDK and Tinybird's analytics platform, enabling you to track and analyze AI model performance in your web applications.
npm install @tinybirdco/ai
# or
yarn add @tinybirdco/ai
# or
pnpm add @tinybirdco/ai
Next.js App Router Example:
import { createOpenAI } from "@ai-sdk/openai";
import { wrapModel } from "@tinybirdco/ai/ai-sdk";
import { streamText } from "ai";
export const maxDuration = 30;
export async function POST(req: Request) {
const { messages } = await req.json();
const openai = createOpenAI({
apiKey: process.env.OPENAI_API_KEY,
});
const model = wrapModel(openai("chatgpt-4o-latest"), {
host: process.env.TINYBIRD_HOST!,
token: process.env.TINYBIRD_TOKEN!,
});
const result = streamText({
model: model,
messages,
});
return result.toDataStreamResponse();
}
- Vercel AI SDK Integration: Seamless compatibility with Vercel's AI SDK
- Streaming Support: Real-time response streaming
- Performance Tracking: Monitor AI model performance and usage
- TypeScript Support: Full type safety out of the box
OPENAI_API_KEY=your_openai_api_key
TINYBIRD_HOST=your_tinybird_host
TINYBIRD_TOKEN=your_tinybird_token
-
Choose Your Tool:
- Use Birdwatcher for automated data analysis and monitoring
- Use the JavaScript SDK for web application integration
-
Set Up Your Environment: Configure your Tinybird credentials and API keys
-
Start Building: Follow the quick start guides above to get up and running
- Birdwatcher Documentation
- JavaScript SDK Documentation
- Tinybird MCP Server
- LLM Performance Tracker Template
We welcome contributions! Please check out our contributing guidelines and feel free to submit pull requests or open issues.
MIT License - see the LICENSE file for details.