๐ 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 โ โ Recommended
โ D1 + R2 + Vectorize โ
โโโโโโโโโโโโโฌโโโโโโโโโโโโ
โ (VPS/Docker also supported,
โ see server/README.md)
โผ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ ๐ค 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 (Recommended) | Beginners, low cost | Serverless, free tier, simple setup |
| ๐ฅ๏ธ | VPS / Docker | Advanced users | Web admin panel, PostgreSQL, compat API, more control |
- 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
# 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 your account_id and database_id from step 3
# 5. Run database migrations
npx wrangler d1 execute atri_diary --file=db/schema.sql
npx wrangler d1 execute atri_diary --file=migrations/0004_add_fact_memories.sql
npx wrangler d1 execute atri_diary --file=migrations/0005_add_conversation_tombstones.sql
npx wrangler d1 execute atri_diary --file=migrations/0006_add_reply_to.sql
npx wrangler d1 execute atri_diary --file=migrations/0007_add_proactive_tables.sql
npx wrangler d1 execute atri_diary --file=migrations/0008_add_runtime_settings_tables.sql
# 6. Set secrets
npx wrangler secret put OPENAI_API_KEY
npx wrangler secret put EMBEDDINGS_API_KEY
npx wrangler secret put APP_TOKEN
# Optional: npx wrangler secret put TAVILY_API_KEY
# Optional: npx wrangler secret put DIARY_API_KEY
# 7. Sync shared prompts and deploy
cd .. && python3 scripts/sync_shared.py
cd worker && npx wrangler deploy๐ Note: The Android client uses the same API paths on both backends, so switching is just changing the base URL.
cd server
cp .env.example .env
# Edit .env with your configuration
docker-compose up -d๐ See server/README.md for detailed VPS deployment guide (Docker, 1Panel, Baota).
| 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 |
| ๐ฌ Proactive Messages | ATRI can initiate conversations on her own; supports Email / WeChat Work notifications |
| ๐ 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 | Runtime config, prompt editing, encrypted secrets management (VPS only) |
| ๐ Compat API | OpenAI / Anthropic / Gemini compatible endpoints for third-party clients (VPS only) |
.
โโโ ๐ฑ 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, 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




