🌐 Language: English | 简体中文
"An AI companion that remembers, grows, and maintains emotional continuity"
🚀 Quick Start • ✨ Features • 📸 Screenshots • 📚 Documentation
ATRI is an Android app + cloud backend AI companion project. Unlike ordinary chatbots, she has:
|
Chat with her anytime, anywhere |
She records what happened today |
Diaries become "memories" |
| 🤖 Traditional Chatbots | 💖 ATRI's Approach |
|---|---|
| Every conversation starts fresh | Remembers everything important via diary + vector memory + real-time facts |
| Emotions change instantly | Status capsule system + intimacy decay, moods have inertia |
| One-size-fits-all responses | Intimacy system affects speaking style, relationships grow |
| May fabricate memories | Tool registration mechanism with 8 tools, actively verifies via search/diary/web |
┌─────────────────────────────────────────────────────────────────┐
│ 📱 Android App (Kotlin) │
│ Jetpack Compose • Room • DataStore │
└──────────────────────────┬──────────────────────────────────────┘
│ 🔐 HTTPS + Token Auth
▼
┌──────────────────────┴──────────────────────┐
│ │
▼ ▼
┌───────────────────────┐ ┌───────────────────────────────┐
│ ☁️ Cloudflare Workers │ OR │ 🖥️ VPS / Zeabur Server │
│ D1 + R2 + Vectorize │ │ Fastify + PostgreSQL/pgvector│
└───────────────────────┘ └───────────────────────────────┘
│
▼
┌─────────────────────────────────────────────────────────────────┐
│ 🤖 AI Model Service (Native Multi-Format) │
│ OpenAI • Claude • Gemini • DeepSeek • Local Models │
│ (OpenAI / Anthropic / Gemini API format auto-adapt) │
└─────────────────────────────────────────────────────────────────┘
| Option | Best For | Features | |
|---|---|---|---|
| ☁️ | Cloudflare Workers | Beginners, low cost | Serverless, free tier, simple setup |
| 🖥️ | VPS / Zeabur | Advanced users | Web admin panel, PostgreSQL, compat API, more control |
-
Click the button above
-
Fill in only 2 variables:
DOMAIN- Public domain bound to the API service (must match the publicly exposed domain)PASSWORD- Your password (used for admin login and client auth)
💡
PASSWORDcan be a strong password (special characters like@ : / # ?are safe)⚠️ Important:DOMAINmust match the actual public domain, otherwise the admin panel may fail with CORS /bad_origin -
Wait for deployment to complete
-
Visit your domain to access the admin panel
-
Configure upstream API (OpenAI/Claude/Gemini) in the admin panel
📝 Note: The Android client and web frontend use the same public API paths on both backends (Cloudflare Workers and VPS/Zeabur), so switching backends is just changing the base URL.
🪟 Windows One-Click Deploy
- Double-click
scripts/deploy_cf.bat - Follow the prompts to enter:
- Worker name (press Enter for default)
- D1 database name (press Enter for default)
- R2 bucket name (press Enter for default)
- Vectorize index name (press Enter for default)
- OPENAI_API_KEY (required)
- EMBEDDINGS_API_KEY (required for vector memory)
- The script will automatically create resources and deploy
- Copy the Worker URL when done
🍎 macOS / 🐧 Linux Manual Deploy
# 1. Clone and install
git clone https://github.com/MIKUSCAT/ATRI.git
cd ATRI/worker && npm install
# 2. Login to Cloudflare
npx wrangler login
# 3. Create resources
npx wrangler d1 create atri_diary
npx wrangler r2 bucket create atri-media
npx wrangler vectorize create atri-memories --dimensions=1024 --metric=cosine
# 4. Update wrangler.toml with database_id from step 3
# 5. Initialize and deploy
npx wrangler d1 execute atri_diary --file=db/schema.sql
npx wrangler secret put OPENAI_API_KEY
cd .. && python3 scripts/sync_shared.py
cd worker && npx wrangler deploycd server
cp .env.example .env
# Edit .env with your configuration
docker-compose up -d📖 See server/README.md for detailed VPS deployment guide.
| Step | Action |
|---|---|
| 1️⃣ | Download APK from Releases |
| 2️⃣ | Install and open the app |
| 3️⃣ | Set your nickname on the welcome screen |
| 4️⃣ | Go to Settings (⚙️) and configure: API URL, App Token, Model |
|
🎭 In-Character Authentic personality defined in prompts.json |
💬 Context Memory Today + yesterday's chats inform responses |
📓 Auto Diary Nightly reflections from her perspective |
🧠 Long-term Memory Vector-stored memories + real-time facts |
🖼️ Rich Media Send images or docs she understands them |
| Feature | Description |
|---|---|
| 🎨 Status Capsule | Dynamic mood status with label text + color, model-driven updates via set_status tool |
| 💕 Intimacy System | Relationship temperature affects reply style, fades without maintenance |
| 🔧 8 Registered Tools | search_memory read_diary read_conversation web_search set_status update_intimacy remember_fact forget_fact |
| 🌐 Native Multi-Format | Natively supports OpenAI, Anthropic (Claude), and Gemini API formats |
| 🔀 Split Architecture | Chat and diary can use different upstreams independently |
| 🌐 Web Admin Panel | (VPS) Runtime config, prompt editing, encrypted secrets management |
| 🔌 Compat API | (VPS) OpenAI / Anthropic / Gemini compatible endpoints for third-party clients |
.
├── 📱 ATRI/ # Android App (Kotlin / Jetpack Compose)
│ ├── app/src/main/
│ │ ├── java/me/atri/
│ │ │ ├── data/ # Data layer (API, DB, Repository, DataStore)
│ │ │ ├── di/ # Dependency Injection (Koin)
│ │ │ ├── ui/ # UI layer (Compose screens & components)
│ │ │ └── utils/ # Utilities
│ │ └── res/ # Resources
│ └── build.gradle.kts
│
├── ☁️ worker/ # Cloudflare Worker Backend
│ ├── src/
│ │ ├── routes/ # API routes
│ │ ├── services/ # Core services
│ │ └── utils/ # Utility functions
│ ├── db/schema.sql # Database schema
│ └── wrangler.toml # Worker config
│
├── 🖥️ server/ # VPS Backend (Fastify + PostgreSQL + pgvector)
│ ├── src/
│ │ ├── routes/ # API routes (chat, diary, conversation, media, admin, admin-ui, models, compat)
│ │ ├── services/ # Core services (agent, LLM, memory, diary, profile, runtime-settings)
│ │ ├── jobs/ # Scheduled jobs (diary-cron, diary-scheduler, memory-rebuild)
│ │ ├── runtime/ # Environment & types
│ │ ├── admin/ # Admin log buffer
│ │ ├── config/ # Default prompts
│ │ ├── utils/ # Utilities (auth, media-signature, attachments, sanitize)
│ │ └── scripts/ # Build & import scripts
│ ├── admin-ui/ # Web admin panel (static assets)
│ ├── docker-compose.yml
│ ├── Dockerfile
│ └── zeabur.yaml # Zeabur deployment config
│
├── 🔗 shared/ # Shared Config
│ └── prompts.json # Personality and prompts
│
└── 📜 scripts/ # Deployment Scripts
├── deploy_cf.bat # Windows CF deploy
└── sync_shared.py # Sync prompts
| 📄 Document | 📝 Content |
|---|---|
| 🏛️ Tech Architecture Blueprint | Design philosophy, data flow, API contracts |
| 🚀 VPS Deployment Guide | Docker, Zeabur, 1Panel, Baota deployment |
| 🎭 Personality Definition | ATRI's personality and prompts |
This project is licensed under the PolyForm Noncommercial License 1.0.0.
- ✅ Personal learning, research, non-commercial use allowed
⚠️ Commercial use requires separate authorization




