Discord Agent Setup
This repo now includes a Discord-facing single-agent DDA-X scaffold in:
run_discord_agent.pysrc/discord_agent/config.pysrc/discord_agent/runtime.pysrc/discord_agent/bot.pyconfigs/discord_agent/snake_v0_2.json
What It Does
- One persistent DDA-style agent lives in Discord chat.
- State persists per user session inside the channel or DM where the conversation happens.
- The agent evolves through memory and reflection without rewriting its core identity.
- Admins get visibility through slash commands:
/ddax_state/ddax_mind/ddax_trace/ddax_reflect/ddax_reset/ddax_profile
1. Create The Discord Bot
In the Discord Developer Portal:
- Create a new application.
- Add a Bot user.
- Copy the bot token.
- Enable
MESSAGE CONTENT INTENT. - Install the bot to your private dev server with scopes:
botapplications.commands- Give it these permissions at minimum:
- View Channels
- Send Messages
- Read Message History
- Embed Links
- Attach Files
- Use Application Commands
Official references:
- Discord application commands:
https://docs.discord.com/developers/interactions/application-commands - Discord gateway intents:
https://docs.discord.com/developers/events/gateway
2. Add Environment Variables
Put these in .env:
DISCORD_BOT_TOKEN=your_bot_token_here
DISCORD_GUILD_ID=your_private_server_id
DISCORD_CHANNEL_IDS=comma,separated,channel_ids
DISCORD_ADMIN_USER_IDS=comma,separated,user_ids
DISCORD_MESSAGE_MODE=mentions
# Existing OpenAI key used by the DDA runtime
OAI_API_KEY=sk-...
Optional overrides:
DISCORD_CHAT_MODEL=gpt-4o
DISCORD_EMBED_MODEL=text-embedding-3-large
DISCORD_GEN_CANDIDATES=7
DISCORD_CORE_COS_MIN=0.28
DISCORD_ROLE_COS_MIN=0.18
DISCORD_AGENT_PROFILE=configs/discord_agent/snake_v0_2.json
DISCORD_DATA_DIR=data/discord_agent_v0_2
DISCORD_MESSAGE_MODE:
mentions: only respond when mentioned or when someone directly replies to the botchannel: respond to all messages in allowed channelsboth: mention, direct-reply, or allowed-channel mode
For a private server where you want tighter control, mentions is usually the cleanest default.
3. Install Dependencies
Use your project environment, then install:
4. Run The Bot
If DISCORD_GUILD_ID is set, slash commands sync to that guild immediately.
Easier Windows Launch
From the repo root:
What it does:
- creates
venvif missing - installs requirements
- validates
.env - starts Snake
Useful variants:
5. First Live Test
In your dev channel:
- Mention the bot, or reply directly to one of its messages if you are running in
mentionsmode. - If you are using
channelorboth, you can also send a normal message in an allowed channel. - Run
/ddax_stateto inspect the current scalar state. - Run
/ddax_mindto get the latest full state snapshot. - Run
/ddax_traceafter a few turns to inspect candidate selection and behavior.
Persistence Layout
The bot writes under data/discord_agent_v0_2/<session_key>/ by default:
state.pkl: full numpy-backed session statestate.json: scalar/admin-friendly summarytelemetry.jsonl: turn-by-turn trace logledger/: surprise-weighted memory entries and reflections
Profile Customization
Edit configs/discord_agent/snake_v0_2.json to change:
- core identity
- role identity
- style traits
- wound lexicon
- safety boundaries
The agent can evolve its adaptive notes over time, but the profile file is the core identity anchor.