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
- Go to the Discord Developer Portal
- Click New Application
- Name it VexAI (or whatever you like) and click Create
2. Enable Privileged Intents
- In the left menu, click Bot
- Scroll down to Privileged Gateway Intents
- Enable all three toggles:
- Presence Intent
- Server Members Intent
- Message Content Intent
- Click Save Changes
Tip: Enable all three Privileged Gateway Intents or the bot won't receive messages.
3. Copy the Bot Token
- On the Bot page, click Reset Token
- Copy the token and save it somewhere safe. You'll need it for the
.envfile
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
- In the left menu, go to OAuth2 → URL Generator
- Under Scopes, check
botandapplications.commands - Under Bot Permissions, check Administrator
- Copy the generated URL at the bottom
- 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
Use PostgreSQL for production workloads or multi-instance deployments.
git clone https://github.com/mrelmida/vexai.git && cd vexai
cp .env.example .env
# Edit .env to set DATABASE_TYPE=postgres and DATABASE_URL
docker-compose -f docker-compose.postgres.yml up -d --build
docker-compose -f docker-compose.postgres.yml logs -f
Run natively with Node.js v22 or later.
git clone https://github.com/mrelmida/vexai.git && cd vexai
npm install
cp .env.example .env
# Edit .env with your Discord token + LLM API key
npm run build
npm start
For development with hot-reload:
npm run dev
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:
- Discord token: paste the bot token you copied earlier
- LLM configuration: choose a provider, enter your API key, and select a model
- 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.