main.py validates configuration, initializes storage, loads non-empty cogs,
connects to Discord, synchronizes slash commands, and publishes the current
version in Judy’s activity.
config.py is the source of truth for project paths, database locations,
credentials, models, AI controls, feature limits, cooldowns, public URLs,
colors, and version metadata.
ai_service.py owns all Gemini access.
The service provides:
Chat and ambient cogs no longer create their own Gemini clients.
For direct chat, the AI service also receives bounded server-scoped identity
and relationship context from identity_service.py. Scores and internal tiers
are context only and must not be exposed in normal conversation.
identity_service.py stores profiles and relationship state in
database/identity.db.
Each Discord server has an independent profile for a user. Direct interactions update:
Progression is deterministic, gradual, and clamped. It does not use a second AI request or allow one message to create a high-trust relationship.
guild_service.py stores setup state in database/guilds.db.
cogs/utility.py provides:
/setup/setup_status/help/invite/privacy/terms/support/data_deleteSetup validates channel permissions, configures the chat channel, optionally enables ambient presence, updates live cog state, and persists the result.
Runtime SQLite databases:
judy.db: core bootstrapguilds.db: setup statechat.db: configured chat channel per serverambient.db: ambient settings and ignored channelsxp.db: server-isolated XPmoderation.db: server-isolated warningsidentity.db: server-isolated profiles and relationshipsThe memory manager stores recent channel conversations and server-scoped user facts in JSON. A one-server legacy installation automatically converts old unscoped user-memory keys during the first 2.0 startup.
Server-specific records include a Discord guild ID. User facts, profiles, and relationships are keyed by guild ID and user ID.
data_service.py removes configuration, chat settings, ambient settings, XP,
warnings, user memory, identity state, and known channel conversations when:
/data_deletechat.py: direct conversation routing and recent contextmemory.py: user-controlled server-scoped memoriesidentity.py: profile, preferred-name, and relationship commandsambient.py: passive reactions, replies, and GIFsxp.py: XP, ranks, and leaderboardsimages.py: external image searchmoderation.py: warnings and moderation actionsutility.py: setup, help, install, legal, support, and deletiondiagnostics.py: health and private operational inspectionowner.py: owner-only runtime administration.env.