text
stringlengths
0
59.1k
import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';
import ApiKeyButton from '@site/src/components/docs-widgets/ApiKeyButton';
import StepSection from '@site/src/components/docs-widgets/StepSection';
import SectionDivider from '@site/src/components/docs-widgets/SectionDivider';
import ExpandableCode from '@site/src/components/docs-widgets/ExpandableCode';
# Slack Agent
This guide shows how to build event-driven AI agents with VoltAgent and Slack using [Triggers](/actions-triggers-docs/triggers/usage) and [Actions](/actions-triggers-docs/actions/overview).
You'll create an agent that uses Triggers to receive Slack messages, processes them (with optional weather lookup), and uses Actions to reply in the same channel.
:::info
Follow the steps with your own keys and workspace. You can get the agent source code [here](https://github.com/voltagent/voltagent/tree/main/examples/with-slack).
:::
<br/>
<video controls loop muted playsInline style={{width: '100%', height: 'auto'}}>
<source src="https://cdn.voltagent.dev/voltagent-recipes-guides/slack-5.mp4" type="video/mp4" />
Your browser does not support the video tag.
</video>
<br/>
<br/>
<StepSection stepNumber={1} title="Create the Project">
Run the CLI to scaffold a new project:
```bash
npm create voltagent-app@latest
```
</StepSection>
<StepSection stepNumber={2} title="Configure and Start">
If you skipped API key entry during setup, create or edit the `.env` file in your project root and add your API key:
<Tabs>
<TabItem value="openai" label="OpenAI" default>
```bash
OPENAI_API_KEY=your-api-key-here
```
<ApiKeyButton provider="OpenAI" href="https://platform.openai.com/api-keys" />
</TabItem>
<TabItem value="anthropic" label="Anthropic">
```bash
ANTHROPIC_API_KEY=your-api-key-here
```
<ApiKeyButton provider="Anthropic" href="https://console.anthropic.com/settings/keys" />
</TabItem>
<TabItem value="google" label="Google Gemini">
```bash
GOOGLE_GENERATIVE_AI_API_KEY=your-api-key-here
```
<ApiKeyButton provider="Google" href="https://aistudio.google.com/app/apikey" />
</TabItem>
<TabItem value="groq" label="Groq">
```bash
GROQ_API_KEY=your-api-key-here
```
<ApiKeyButton provider="Groq" href="https://console.groq.com/keys" />
</TabItem>
<TabItem value="mistral" label="Mistral">
```bash
MISTRAL_API_KEY=your-api-key-here
```
<ApiKeyButton provider="Mistral" href="https://console.mistral.ai/api-keys" />
</TabItem>
</Tabs>
Now start the development server:
<Tabs>
<TabItem value="npm" label="npm" default>
```bash
npm run dev
```