NOIR

Quickstart

Build and run a self-hosted Slack agent in four steps.

Noir runs inside your application. It connects your model to a channel and adds the reliable execution boundary around each turn. Your code, credentials, data, and infrastructure stay yours.

This guide creates a Slack bot that replies when mentioned. You need Node.js 22.18 or newer, a Slack app, and an OpenRouter API key.

1. Install

npm install @noir-agent/agent
npm install ai @openrouter/ai-sdk-provider

There is no Noir account or Noir API key.

2. Create the agent

agent.ts
import { noir } from '@noir-agent/agent'
import { slack } from '@noir-agent/agent/channels/slack'
import { createOpenRouter } from '@openrouter/ai-sdk-provider'

const openrouter = createOpenRouter({
  apiKey: process.env.OPENROUTER_API_KEY!,
})

export default noir({
  id: 'my-agent',
  instructions: 'Answer directly. Use tools for facts. Never invent a result.',
  personality: {
    tone: 'Funny, concise, and useful',
    traits: ['direct', 'careful'],
  },
  model: openrouter('openai/gpt-5-mini'),
  channels: { slack: slack() },
})

Create .env beside the agent:

.env
OPENROUTER_API_KEY=
SLACK_BOT_TOKEN=xoxb-...
SLACK_SIGNING_SECRET=

3. Run locally

npx noir dev ./agent.ts --port 3000

The process starts an HTTP server. Slack events are accepted at /webhooks/slack.

4. Connect Slack

Expose port 3000 with the tunnel or host you already use, then configure the Slack app:

  1. Set the Event Subscriptions request URL to https://YOUR_HOST/webhooks/slack.
  2. Subscribe the bot to app_mention.
  3. Add the app_mentions:read and chat:write bot scopes.
  4. Install or reinstall the app in the workspace.
  5. Invite the bot to a channel and mention it.

The adapter verifies Slack signatures before a message reaches the model. Replies stay in the originating thread.

Verify it

npx noir doctor ./agent.ts
npx noir inspect ./agent.ts

doctor checks that the agent loads and its configured providers are healthy. inspect prints channels, routes, tools, capabilities, and policy without sending a message.

Send @your-bot hello in Slack. A successful local setup produces one signed inbound event, one bounded model run, and one delivered reply. Repeating Slack’s event delivery does not create a second run.

What to add next

  • Read the mental model before adding state or tools.
  • Follow the one-file agent to add your database, memory, sandbox, and Stripe.
  • Use the production Slack guide for complete scopes, persistence, deployment, and failure testing.
  • Browse capabilities when the agent needs schedules, tasks, contacts, media, browser handoff, or quality controls.

Start with the smallest working agent. Add a durable store before multiple workers or restart-dependent work. Add each optional capability only when the product needs it.

On this page