LogoRobo.js

@robojs/ai

Transform your Robo into an AI-powered copilot with native voice, vision, web search, and more.

Install @robojs/ai with:

Turn your Robo into an AI chatbot with native voice conversations, vision, web search with citations, natural language command execution, token tracking, and a pluggable engine architecture. Ships with OpenAI's Responses and Conversations APIs by default, but you can swap in any provider.

Features

AI Chat

Mentions, replies, DMs, and channel whitelists

Voice

Realtime transcription and playback

Web Search

Inline citations from the web

Commands

Natural language slash command execution

Token Tracking

Usage limits and rate controls

Knowledge Sync

Vector stores from /documents

Custom Engines

Swap in any AI provider

Hooks

Pipeline customization points

Installation

npx robo add @robojs/ai@next

Or scaffold a new project with the plugin already wired up:

npx create-robo@next my-robo -p @robojs/ai@next

Set OPENAI_API_KEY in your environment (or your provider's equivalent) so the default OpenAI engine can authenticate.

Interaction patterns

Users interact with your AI Robo in four ways:

  • Mentions -- Ping the bot anywhere: @Sage what's the schedule?
  • Replies -- Reply to any bot message to continue the thread.
  • DMs -- Message the bot directly.
  • Whitelisted channels -- Channels where the bot responds without a mention.

Control where the bot can operate with whitelist and restrict:

config/plugins/robojs/ai.mjs
export default {
	whitelist: {
		channelIds: ['123456789012345678']
	},
	restrict: {
		channelIds: ['345678901234567890']
	}
}
config/plugins/robojs/ai.mjs
export default {
	whitelist: {
		channelIds: ['123456789012345678']
	},
	restrict: {
		channelIds: ['345678901234567890']
	}
}

restrict always wins. If set, the bot ignores messages from channels not in the list -- even if they appear in the whitelist.

Quick start

A minimal configuration with custom instructions and engine settings:

config/plugins/robojs/ai.mjs
import { OpenAiEngine } from '@robojs/ai/engines/openai'

export default {
	instructions: 'You are Sage, a friendly community mentor who answers succinctly.',
	engine: new OpenAiEngine({
		chat: {
			model: 'gpt-4.1-mini',
			temperature: 0.6,
			maxOutputTokens: 800
		}
	})
}
config/plugins/robojs/ai.mjs
import { OpenAiEngine } from '@robojs/ai/engines/openai'

export default {
	instructions: 'You are Sage, a friendly community mentor who answers succinctly.',
	engine: new OpenAiEngine({
		chat: {
			model: 'gpt-4.1-mini',
			temperature: 0.6,
			maxOutputTokens: 800
		}
	})
}

Next steps

On this page