Skip to main content
Junkie uses environment variables for configuration. All settings can be configured through a .env file in the root directory.

Discord Configuration

DISCORD_TOKEN
string
required
Your Discord account token. Required to connect the selfbot to Discord.
This token provides full access to your Discord account. Never share it or commit it to version control.
LOG_LEVEL
string
default:"INFO"
Logging level for the bot. Options: DEBUG, INFO, WARNING, ERROR, CRITICAL
MESSAGE_SYNC_LIMIT
int
default:"200"
Number of recent messages to sync after startup to detect offline edits/deletes.

Database Configuration

POSTGRES_URL
string
default:""
PostgreSQL connection URL for message history, agent sessions, and memory storage.Format: postgresql://username:password@host:port/databaseIf not set, sessions and memories will not persist across restarts.

Model Provider Configuration

CUSTOM_PROVIDER
string
default:"groq"
The LLM provider to use for the main agent model. Can be:
  • groq - Uses Groq’s API
  • Any OpenAI-compatible base URL (e.g., https://api.openai.com/v1)
CUSTOM_MODEL
string
default:"openai/gpt-oss-120b"
Model identifier for the main agent. Examples:
  • openai/gpt-oss-120b (Groq)
  • gpt-4-turbo
  • gpt-5
CUSTOM_PROVIDER_API_KEY
string
default:"None"
API key for custom provider. Required when using a custom OpenAI-compatible endpoint.
GROQ_API_KEY
string
default:""
required
API key for Groq. Required for:
  • Using Groq as the main provider
  • Memory processing (uses openai/gpt-oss-120b)
  • Groq Compound agent

External Service API Keys

FIRECRAWL_API_KEY
string
default:""
API key for Firecrawl web scraping service. When set, enables the Firecrawl MCP server for the code agent.
E2B_API_KEY
string
required
API key for E2B code execution sandboxes. Required for the code agent to run Python code and shell commands.Get your API key at e2b.dev

Agent Configuration

MODEL_TEMPERATURE
float
default:"0.3"
Controls randomness in model outputs. Range: 0.0 to 2.0
  • Lower values (0.1-0.3): More focused and deterministic
  • Higher values (0.7-1.0): More creative and varied
MODEL_TOP_P
float
default:"0.9"
Nucleus sampling parameter. Alternative to temperature. Range: 0.0 to 1.0
AGENT_HISTORY_RUNS
integer
default:"1"
Number of previous conversation runs to include in agent context.
AGENT_RETRIES
integer
default:"2"
Number of times to retry failed agent operations.
MAX_AGENTS
integer
default:"100"
Maximum number of user teams to cache in memory. Uses LRU eviction when limit is reached.

Debug Configuration

DEBUG_MODE
boolean
default:"false"
Enable verbose debug logging for agent operations. Set to true to activate.
DEBUG_LEVEL
integer
default:"1"
Debug verbosity level when DEBUG_MODE is enabled.
  • 1: Basic debug info
  • Higher values: More detailed logging

Tracing Configuration

TRACING
boolean
default:"false"
Enable Phoenix/Arize tracing for observability. Set to true to activate.
PHOENIX_API_KEY
string
default:"None"
API key for Phoenix/Arize. Required when TRACING=true.
PHOENIX_ENDPOINT
string
Phoenix trace collection endpoint URL.
PHOENIX_PROJECT_NAME
string
default:"junkie"
Project name for organizing traces in Phoenix.

MCP Configuration

MCP_URLS
string
default:""
Comma-separated list of MCP server URLs to enable additional tools.Example: https://mcp.example.com/v1,https://another-mcp.com/api

Context Agent Configuration

CONTEXT_AGENT_MODEL
string
default:"gemini-2.5-flash-lite"
Model for the Chat Context Q&A agent. Should be a fast, long-context model.
CONTEXT_AGENT_MAX_MESSAGES
integer
default:"50000"
Maximum number of messages the context agent can process.
TEAM_LEADER_CONTEXT_LIMIT
integer
default:"100"
Context window limit for the team leader agent.

Example .env File

# Discord Configuration (Required)
DISCORD_TOKEN=your_discord_token
LOG_LEVEL=INFO
MESSAGE_SYNC_LIMIT=200

# Database
POSTGRES_URL=postgresql://user:password@localhost:5432/junkie

# Model Configuration (Required)
CUSTOM_PROVIDER=https://api.openai.com/v1
CUSTOM_MODEL=gpt-5
CUSTOM_PROVIDER_API_KEY=sk-...
GROQ_API_KEY=gsk_...

# External Services
E2B_API_KEY=your_e2b_api_key
FIRECRAWL_API_KEY=your_firecrawl_key

# Agent Settings
MODEL_TEMPERATURE=0.3
MAX_AGENTS=100

# Tracing
TRACING=true
PHOENIX_API_KEY=your-phoenix-key
PHOENIX_PROJECT_NAME=my-junkie-instance

# Debug
DEBUG_MODE=false

Build docs developers (and LLMs) love