An AI-powered Discord companion inspired by Marin Kitagawa
Marin AI is a Discord bot that embodies the personality of Marin Kitagawa β the bubbly, passionate cosplayer from My Dress-Up Darling. She's not just another chatbot; she remembers you, develops relationships over time, and has her own moods that affect how she interacts with you.
Built with love using Go, Cerebras AI for ultra-fast inference, and SurrealDB for persistent memory.
- Vector-based memory β Marin remembers conversations using semantic embeddings
- Fact extraction β She learns and stores facts about users (interests, preferences, etc.)
- Memory maintenance β Automatic aging and summarization of old memories
- Duplicate detection β Smart deduplication prevents redundant memories
A sophisticated relationship system inspired by dating sims with 25,000 XP max progression (~1 week casual) and 10 relationship levels:
| Level | XP Range | Description |
|---|---|---|
| π Stranger | 0 - 1,249 | Just met |
| π Familiar Face | 1,250 - 2,499 | Seen around |
| π Acquaintance | 2,500 - 4,999 | Starting to know you |
| π Casual Friend | 5,000 - 8,749 | Hang out sometimes |
| π Friend | 8,750 - 12,499 | Actual friends |
| π€ Good Friend | 12,500 - 16,249 | Genuinely close |
| π Close Friend | 16,250 - 19,999 | Deep trust |
| π Best Friend | 20,000 - 22,499 | No barriers |
| π Soulmate | 22,500 - 24,374 | Deep connection |
| β€οΈβπ₯ Special Someone | 24,375 - 25,000 | In love |
- Interact every day to build a streak (up to 2x XP bonus at 30+ days!)
- Missing a day resets your streak with a small penalty
- Streak displayed in
/affectioncommand
Your affection gains are affected by Marin's current mood:
- Flirty (1.5x) β Compliments and flirting worth more
- Hyper (1.2x) β Everything feels more meaningful
- Playful (1.3x) β Teasing and jokes rewarded
- Bored (0.6x) β Harder to impress
When you level up, Marin sends you a special DM with:
- A heartfelt message acknowledging your bond
- Personal secrets she only shares with close friends
If you're active in a server but haven't talked to Marin in 3+ days:
- She notices and gets a little jealous
- You might receive a passive-aggressive comment
- Small affection penalty until you make it up to her
5% chance per message of triggering a "heart moment":
- Bonus affection from random thoughts Marin has about you
- Messages like "wait... my heart just did a thing π"
π Hidden Bonuses
- Shared interests β Talking about cosplay, anime, etc. gives extra XP
- Late night chats (11 PM - 4 AM) β More intimate conversations
- DM conversations β Worth more than public channels
- Anniversary tracking β Special messages on milestones (7 days, 30 days, 1 year, etc.)
Marin has different moods that cycle naturally and affect her responses:
- β¨ Hyper β Extra energetic and excitable
- π΄ Sleepy β A bit drowsy, shorter responses
- π Flirty β More teasing and playful
- πΈ Nostalgic β Reflective and wistful
- π― Focused β Task-oriented, less distracted
- π€ Bored β Looking for entertainment
- Powered by Google Gemini (requires
GEMINI_API_KEY) - Marin can see and comment on images you send
- Natural reactions to photos and memes
- Uses custom guild emojis when available
- Smart reaction matching based on message content
- Personality-appropriate emoji selection
- If you haven't talked to Marin in 1+ day, she might DM you
- Uses smart exponential backoff (1 day β 2 days β 4 days)
- She'll try to reach you up to 4 times with increasingly dramatic messages
- Won't spam indefinitely β she'll eventually give up until you return
- Responding to her DM gives massive bonus affection!
Marin has a strong sense of self and won't just do whatever you say:
- Task Refusal β She's a friend, not a tool. If you ask her to write an essay, debug code, or do boring work, she'll refuse (usually with a sassy comment).
- Opinions β She has her own likes and dislikes (especially about anime and cosplay).
- Mood Swings β Sometimes she's hyper, sometimes she's sleepy. Her responses change based on how she's feeling.
Marin has her own internal state that makes her feel alive:
- Marin thinks about close friends and reaches out unprompted
- Higher affection = higher chance of random messages
- Messages reference what she's currently doing/thinking
When a conversation ends with Marin's reply (you "leave her on read"), she might come back later with a follow-up thought:
- Trigger: User goes inactive for 30+ minutes after Marin's last message
- Chance: Based on affection level (5% for casual friends β 35% for Special Someone)
- Delay: Higher affection = shorter delay (30m-3h for soulmates, 1h-5h for close friends, 4h-12h for newer friends)
- Context-aware: References what you were talking about earlier
- Natural: Messages like "wait i was thinking about what you said earlier..."
This makes Marin feel like a real person who thinks about conversations after they end, rather than immediately forgetting.
- Marin has her own activities, projects, and thoughts
- Current Activity: "working on a cosplay", "watching anime", etc.
- Current Project: "Miku cosplay", "a bunny girl costume", etc.
- On Her Mind: Random thoughts that influence conversations
- These shift over time (every 30 minutes)
- Marin references her current activity in conversations
- Her mood is influenced by how recent interactions went
- Creates a sense of continuity and presence
- Natural Language β Just ask her naturally: "Remind me to watch the new episode in 2 hours" or "Don't let me forget to buy fabric tomorrow"
- Contextual Delivery β She'll DM you when the time comes, reminding you in her own style.
- Go 1.24 or higher
- SurrealDB instance
- Discord Bot Token
- API Keys for:
- Cerebras (primary LLM)
- Embedding API
- Google Gemini (optional, for vision)
-
Clone the repository
git clone https://github.com/mishl-dev/marinai.git cd marinai -
Copy example environment file
cp example.env .env
-
Configure your
.envDISCORD_TOKEN=your_discord_bot_token CEREBRAS_API_KEY=your_cerebras_key EMBEDDING_API_URL=your_embedding_endpoint EMBEDDING_API_KEY=your_embedding_key SURREAL_DB_HOST=your_surreal_host SURREAL_DB_USER=root SURREAL_DB_PASS=your_password GEMINI_API_KEY=your_gemini_key # Optional
-
Run the bot
go run main.go
# Build and run with Docker Compose
docker-compose up -dThe included docker-compose.yml handles environment variables and volume mounting for the config file.
model_settings:
temperature: 1 # LLM creativity (0-2)
top_p: 1 # Nucleus sampling
delays:
message_processing: 1.5 # Seconds before responding (typing simulation)
memory:
fact_aging_days: 7 # Days before facts start aging
fact_summarization_threshold: 20 # Max facts before summarization
maintenance_interval_hours: 24 # How often to run memory maintenance| Variable | Required | Description |
|---|---|---|
DISCORD_TOKEN |
β | Your Discord bot token |
CEREBRAS_API_KEY |
β | Cerebras API key for LLM |
EMBEDDING_API_URL |
β | Endpoint for text embeddings (default provided) |
EMBEDDING_API_KEY |
β | API key for embeddings |
SURREAL_DB_HOST |
β | SurrealDB WebSocket URL |
SURREAL_DB_USER |
β | SurrealDB username |
SURREAL_DB_PASS |
β | SurrealDB password |
SURREAL_DB_NAMESPACE |
β | Namespace (default: marin) |
SURREAL_DB_DATABASE |
β | Database (default: memory) |
GEMINI_API_KEY |
β | Google Gemini key for vision |
DISCORD_GUILD_ID |
β | Guild ID for faster command updates during dev |
| Command | Description |
|---|---|
/reset |
Permanently delete all your conversation history and memories |
/stats |
See what Marin remembers about you |
/mood |
Check Marin's current mood |
/affection |
Check your relationship status with Marin |
Marin responds when:
- Mentioned (
@Marin hey!) - Replied to (reply to any of her messages)
- Random chance (~30% in active channels)
- DMs (always responds in direct messages)
marinai/
βββ main.go # Entry point, initialization
βββ config.yml # Bot configuration
βββ Dockerfile # Multi-stage build
βββ docker-compose.yml # Container orchestration
βββ pkg/
βββ bot/ # Core bot logic
β βββ handler.go # Message handling
β βββ affection.go # Relationship system
β βββ mood.go # Mood system
β βββ memory_*.go # Memory processing
β βββ slash_commands.go
β βββ system_prompt.go
βββ cerebras/ # Cerebras LLM client
βββ gemini/ # Google Gemini adapter
βββ embedding/ # Text embedding client
βββ memory/ # Memory store interface
βββ surreal/ # SurrealDB client
- Language: Go 1.24
- Discord Library: discordgo
- Database: SurrealDB β Vector search + document storage
- LLM: Cerebras β Ultra-fast inference
- Vision: Google Gemini β Image understanding
- Caching: In-memory LRU cache for embeddings
go test ./...We include a helper script to verify your development environment:
# Check dependencies, config, formatting, and run fast tests
./scripts/dev-check.sh
# Run all tests (including long running ones)
./scripts/dev-check.sh --all| Package | Purpose |
|---|---|
pkg/bot |
Discord event handlers, personality logic |
pkg/cerebras |
LLM API client |
pkg/gemini |
Vision API adapter |
pkg/embedding |
Text embedding with caching |
pkg/memory |
Memory store abstraction |
pkg/surreal |
SurrealDB client wrapper |
This project uses The Curse of Knowledge License β a satirical license where reading it revokes all rights. In practice: do whatever you want, just don't be weird about it.
- Marin Kitagawa β The character from My Dress-Up Darling by Shinichi Fukuda
- Cerebras β For providing ultra-fast LLM inference
- SurrealDB β For the excellent database with built-in vector search
