Getting Started

Getting Started

Create a Discord bot, install VexAI, configure your environment, and get your AI admin assistant running in minutes.

Prerequisites

  • Node.js v22+ (for native install) or Docker & Docker Compose (recommended)
  • LLM API key from one of: OpenAI, Anthropic, OpenRouter, or any OpenAI-compatible provider
  • Discord bot token (follow the guide below to create one)

Creating a Discord Bot

1. Create the Application

  1. Go to the Discord Developer Portal
  2. Click New Application
  3. Name it VexAI (or whatever you like) and click Create

2. Enable Privileged Intents

  1. In the left menu, click Bot
  2. Scroll down to Privileged Gateway Intents
  3. Enable all three toggles:
    • Presence Intent
    • Server Members Intent
    • Message Content Intent
  4. Click Save Changes
Tip: Enable all three Privileged Gateway Intents or the bot won't receive messages.

3. Copy the Bot Token

  1. On the Bot page, click Reset Token
  2. Copy the token and save it somewhere safe. You'll need it for the .env file
Warning: Never share your bot token publicly. If it gets leaked, return to this page and click Reset Token immediately to invalidate the old one.

4. Invite the Bot to Your Server

  1. In the left menu, go to OAuth2 → URL Generator
  2. Under Scopes, check bot and applications.commands
  3. Under Bot Permissions, check Administrator
  4. Copy the generated URL at the bottom
  5. Open the URL in your browser, select your server, and click Authorize

Installation

The fastest way to get started. Uses SQLite for zero-config storage.

git clone https://github.com/mrelmida/vexai.git && cd vexai
cp .env.example .env
# Edit .env with your Discord token + LLM API key
docker-compose up -d --build
docker-compose logs -f

Environment Variables

Configure VexAI by editing the .env file in the project root. All variables are read at startup.

Core

Variable Required Default Description
DISCORD_TOKEN Yes - Discord bot token
LLM_PROVIDER Yes - openai, anthropic, openrouter, or openai-compatible
LLM_API_KEY Yes - API key for LLM provider
LLM_MODEL Yes - Model name (e.g. gpt-4o, claude-sonnet-4-20250514)
LLM_BASE_URL No - Custom base URL (openai-compatible provider only)
ADMIN_USER_IDS Yes - Comma-separated Discord user IDs for admin access

Security Observer

Variable Required Default Description
SECURITY_LLM_PROVIDER No Main LLM Separate provider for security observer
SECURITY_LLM_API_KEY No Main key Separate API key for security
SECURITY_LLM_MODEL No Main model Separate model for security
SECURITY_ALERT_CHANNEL_ID No - Channel for security alerts

Search

Variable Required Default Description
SEARCH_PROVIDER No - brave or searxng
SEARCH_API_KEY No - Brave Search API key
SEARXNG_URL No - SearXNG instance URL

Database

Variable Required Default Description
DATABASE_TYPE No sqlite sqlite or postgres
DATABASE_URL No - PostgreSQL connection string

Embeddings

Variable Required Default Description
EMBEDDINGS_ENABLED No false Enable semantic search
EMBEDDINGS_PROVIDER No builtin builtin, openai, openrouter, or local
EMBEDDINGS_MODEL No Xenova/all-MiniLM-L6-v2 Embedding model name
EMBEDDINGS_API_KEY No - API key for openai / openrouter providers
EMBEDDINGS_BASE_URL No - Base URL for local provider
EMBEDDINGS_DIMENSIONS No 384 Embedding vector dimensions

First Run

When VexAI starts for the first time without an existing data/config.json, it launches an interactive setup wizard in the terminal. The wizard walks you through:

  1. Discord token: paste the bot token you copied earlier
  2. LLM configuration: choose a provider, enter your API key, and select a model
  3. Admin setup: provide your Discord user ID so the bot knows who can run admin commands

Once complete, the wizard writes the configuration to data/config.json and the bot connects to Discord automatically.

Tip: After initial setup, use the /config view slash command in Discord to verify your configuration at any time.
Note: If you provided environment variables in .env, they override the corresponding values in data/config.json. See Configuration for the full precedence rules.