This guide walks you from zero to a running Slack chat agent. You will install Heypi, write a minimal agent folder, connect a Slack adapter, and callDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/hunvreus/heypi/llms.txt
Use this file to discover all available pages before exploring further.
runHeypi to bring everything online. The whole setup fits in one TypeScript file and a pair of Markdown files.
Heypi requires Node.js 22 or newer. No other system dependencies are needed for a basic Slack setup.
Heypi needs credentials for your chat platform and your AI model provider. For the Slack quickstart:
SLACK_BOT_TOKEN=xoxb-your-bot-token
SLACK_APP_TOKEN=xapp-your-app-level-token
OPENAI_API_KEY=sk-your-openai-key
OPENAI_API_KEY is read directly by Pi through its normal provider auth path—Heypi does not read it itself. You can pass model explicitly to agentFrom() or set HEYPI_MODEL (e.g. openai/gpt-5-mini); Heypi does not pick a model implicitly.To use a different model provider, set
HEYPI_MODEL to any provider/model-name string that Pi supports, or pass model in code (shown in the next step).You are a helpful DevOps assistant for the engineering team.
Answer concisely. Use plain language.
Prefer safe, auditable actions over shortcuts.
- Always confirm destructive operations before running them.
- Do not access resources outside the project workspace.
- If unsure, ask for clarification rather than guessing.
SOUL.md sets the agent’s identity and voice. AGENTS.md provides standing operating rules. Both are optional—Heypi falls back to a sensible default assistant identity if either file is missing. See Agent Folder for the full convention.import { agentFrom, createHeypi, runHeypi, slack, workspace } from "@hunvreus/heypi";
const app = createHeypi({
state: { root: "./state" },
adapters: [
slack({
botToken: process.env.SLACK_BOT_TOKEN!,
appToken: process.env.SLACK_APP_TOKEN!,
}),
],
agent: agentFrom("./agent", { model: "openai/gpt-5-mini" }),
runtime: { root: workspace("./workspace") },
});
await runHeypi(app);
state.rootadaptersagentruntime.rootrunHeypi(app) starts the app and installs SIGINT/SIGTERM handlers so the process drains in-flight turns and shuts down cleanly. Press Ctrl+C to stop it during development.Invite your Slack bot to a channel and send it a message. Heypi will create a thread, route your message to Pi, and stream the reply back. SQLite state is written to
./state/heypi.db and the sandboxed workspace lives in ./workspace.Use
heypi check to verify your Slack credentials and bot scopes before running the app for the first time. See CLI for the full command reference.For any tool call that could be destructive—deploying code, paging a service, deleting files—add an approver list. When a tool with
confirm defined is invoked, Heypi pauses the turn and posts an approval prompt with native Slack buttons. The turn resumes only after an approver clicks Approve.const app = createHeypi({
state: { root: "./state" },
adapters: [
slack({
botToken: process.env.SLACK_BOT_TOKEN!,
appToken: process.env.SLACK_APP_TOKEN!,
}),
],
agent: agentFrom("./agent", { model: "openai/gpt-5-mini" }),
runtime: { root: workspace("./workspace") },
approval: {
approvers: ["U123456"], // Slack user IDs of people who can approve
},
});
await runHeypi(app);
What’s Next
You have a running Slack agent with a sandboxed workspace. From here:- Agent Folder — Add skills, extensions, and dynamic context providers to the agent folder.
- Tools & Approvals — Write custom tools, configure
commandConfirmallow/block rules, and test approval flows. - Adapters — Add Discord, Telegram, or webhook adapters alongside Slack.
- Scope & Memory — Enable persistent model memory scoped to users or channels.