| title | Integrate a slack-native AI agent | |||||
|---|---|---|---|---|---|---|
| excerpt | Unify company knowledge with slack-native AI agents | |||||
| products |
|
|||||
| keywords |
|
|||||
| tags |
|
import PrereqAccount from "versionContent/_partials/_prereqs-cloud-project-and-self.mdx";
$AGENTS_LONG is a Slack-native AI agent that you use to unify the knowledge in your company. This includes your Slack history, docs, GitHub repositories, Salesforce and so on. You use your $AGENTS_SHORT to get instant answers for real business, technical, and operations questions in your Slack channels.
$AGENTS_LONG can handle concurrent conversations with enterprise-grade reliability. They have the following features:
- Durable and atomic event handling: $PG-backed event claiming ensures exactly-once processing, even under high concurrency and failure conditions
- Bounded concurrency: fixed worker pools prevent resource exhaustion while maintaining predictable performance under load
- Immediate event processing: $AGENTS_LONG provide real-time responsiveness. Events are processed within milliseconds of arrival rather than waiting for polling cycles
- Resilient retry logic: automatic retry with visibility thresholds, plus stuck or expired event cleanup
- Horizontal scalability: run multiple $AGENTS_SHORT instances simultaneously with coordinated work distribution across all instances
- AI-Powered Responses: use the AI model of your choice, you can also integrate with MCP servers
- Extensible architecture: zero code integration for basic agents. For more specialized use cases, easily customize your agent using Jinja templates
- Complete observability: detailed tracing of event flow, worker activity, and database operations with full Logfire instrumentation
This page shows you how to install the $AGENTS_CLI, connect to the $COMPANY MCP server, and customize prompts for your specific needs.
- Install the uv package manager
- Get an Anthropic API key
- Optional: get a Logfire token
Before installing $AGENTS_LONG, you need to create a Slack app that the $AGENTS_SHORT will connect to. This app provides the security tokens for Slack integration with your $AGENTS_SHORT:
-
Create a manifest for your Slack App
-
In a temporary directory, download the $AGENTS_SHORT Slack manifest template:
curl -O https://raw.githubusercontent.com/timescale/tiger-agents-for-work/main/slack-manifest.json
-
Edit
slack-manifest.jsonand customize your name and description of your Slack App. For example:"display_information": { "name": "Tiger Agent", "description": "Tiger AI Agent helps you easily access your business information, and tune your Tiger Cloud services", "background_color": "#000000" }, "features": { "bot_user": { "display_name": "Tiger Agent", "always_online": true } },
-
Copy the contents of
slack-manifest.jsonto the clipboard:cat slack-manifest.json| pbcopy
-
-
Create the Slack app
- Go to api.slack.com/apps.
- Click
Create New App. - Select
From a manifest. - Choose your workspace, then click
Next. - Paste the contents of
slack-manifest.jsonand clickNext. - Click
Create.
-
Generate an app-level token
- In your app settings, go to
Basic Information. - Scroll to
App-Level Tokens. - Click
Generate Token and Scopes. - Add a
Token Name, then clickAdd Scope, addconnections:writethen clickGenerate. - Copy the
xapp-*token locally and clickDone.
- In your app settings, go to
-
Install your app to a Slack workspace
- In the sidebar, under
Settings, clickInstall App. - Click
Install to <workspace name>, then clickAllow. - Copy the
xoxb-Bot User OAuth Token locally.
- In the sidebar, under
You have created a Slack app and obtained the necessary tokens for $AGENTS_SHORT integration.
$AGENTS_LONG are a production-ready library and CLI written in Python that you use to create Slack-native AI agents. This section shows you how to configure a $AGENTS_SHORT to connect to your Slack app, and give it access to your data and analytics stored in $CLOUD_LONG.
-
Create a project directory
mkdir my-tiger-agent cd my-tiger-agent -
Create a $AGENTS_SHORT environment with your Slack, AI Assistant, and database configuration
- Download
.env.sampleto a local.envfile:
curl -L -o .env https://raw.githubusercontent.com/timescale/tiger-agent/refs/heads/main/.env.sample
- In
.env, add your Slack tokens and Anthropic API key:
# Slack tokens (from the Slack app you created) SLACK_APP_TOKEN=xapp-your-app-token SLACK_BOT_TOKEN=xoxb-your-bot-token # Anthropic API key ANTHROPIC_API_KEY=sk-ant-your-api-key # Optional: Logfire token for enhanced logging LOGFIRE_TOKEN=your-logfire-token
- Add the connection details for the $SERVICE_LONG you are using for this $AGENTS_SHORT:
PGHOST=<host> PGDATABASE=tsdb PGPORT=<port> PGUSER=tsdbadmin PGPASSWORD=<password>
- Save and close
.env.
- Download
-
Add the default $AGENTS_SHORT prompts to your project
mkdir prompts curl -L -o prompts/system_prompt.md https://raw.githubusercontent.com/timescale/tiger-agent/refs/heads/main/prompts/system_prompt.md curl -L -o prompts/user_prompt.md https://raw.githubusercontent.com/timescale/tiger-agent/refs/heads/main/prompts/user_prompt.md
-
Install $AGENTS_LONG to manage and run your AI-powered Slack bots
-
Install the $AGENTS_CLI using uv.
uv tool install --from git+https://github.com/timescale/tiger-agents-for-work.git tiger-agent
tiger-agentis installed in~/.local/bin/tiger-agent. If necessary, add this folder to yourPATH. -
Verify the installation.
tiger-agent --help
You see the $AGENTS_CLI help output with the available commands and options.
-
-
Connect your $AGENTS_SHORT with Slack
-
Run your $AGENTS_SHORT:
tiger-agent run --prompts prompts/ --env .env
If you open the explorer in $CONSOLE, you can see the tables used by your $AGENTS_SHORT.
-
In Slack, open a public channel app and ask $AGENTS_SHORT a couple of questions. You see the response in your public channel and log messages in the terminal.
-
To increase the amount of specialized information your AI Assistant can use, you can add MCP servers supplying data your users need. For example, to add the $COMPANY MCP server to your $AGENTS_SHORT:
-
Copy the example
mcp_config.jsonto your projectIn
my-tiger-agent, run the following command:```bash curl -L -o mcp_config.json https://raw.githubusercontent.com/timescale/tiger-agent/refs/heads/main/examples/mcp_config.json ``` -
Configure your $AGENTS_SHORT to connect to the most useful MCP servers for your organization
For example, to add the $COMPANY documentation MCP server to your $AGENTS_SHORT, update the docs entry to the following:
"docs": { "tool_prefix": "docs", "url": "https://mcp.tigerdata.com/docs", "allow_sampling": false },
To avoid errors, delete all entries in
mcp_config.jsonwith invalid URLs. For example thegithubentry withhttp://github-mcp-server/mcp. -
Restart your $AGENTS_SHORT
tiger-agent run --prompts prompts/ --mcp-config mcp_config.json
You have configured your $AGENTS_SHORT to connect to $MCP_SHORT. For more information, see MCP Server Configuration.
$AGENTS_LONG uses Jinja2 templates for dynamic, context-aware prompt generation. This system allows for sophisticated prompts that adapt to conversation context, user preferences, and event metadata. $AGENTS_LONG uses the following templates:
system_prompt.md: defines the AI Assistant's role, capabilities, and behavior patterns. This template sets the foundation for the way your $AGENTS_SHORT will respond and interact.user_prompt.md: formats the user's request with relevant context, providing the AI Assistant with the information necessary to generate an appropriate response.
To change the way your $AGENTS_SHORTs interact with users in your Slack app:
-
Update the prompt
For example, in
prompts/system_prompt.md, add another item in theResponse Protocolsection to fine tune the behavior of your $AGENTS_SHORTs. For example:5. Be snarky but vaguely amusing
-
Test your configuration
Run $AGENTS_SHORT with your custom prompt:
tiger-agent run --mcp-config mcp_config.json --prompts prompts/
For more information, see Prompt tempates.
For additional customization, you can modify the following $AGENTS_SHORT parameters:
--model: change AI model (default:anthropic:claude-sonnet-4-20250514)--num-workers: adjust concurrent workers (default:5)--max-attempts: set retry attempts per event (default:3)
Example with custom settings:
tiger-agent run \
--model claude-3-5-sonnet-latest \
--mcp-config mcp_config.json \
--prompts prompts/ \
--num-workers 10 \
--max-attempts 5Your $AGENTS_SHORTs are now configured with $COMPANY MCP server access and personalized prompts.

