Mirrai v1.3.0 — They’re Not Here
“Missing them is part of it. More central: the them from that time isn’t here.”
Something from my own life
In my last year of high school, my girlfriend was at another school. We could only talk on the phone at night — ten or twenty minutes.
When she had time we might talk for a few dozen minutes; if she was rushed, maybe just a few; on worse days, she wouldn’t call at all.
She didn’t have a phone back then; there was only the school’s public payphone. I could only wait for her to call me, because that payphone had a line: if she called me during a break, she must have given up going to the toilet and getting water, sprinting to the phone the moment the bell rang. So when I saw that familiar payphone number light up on my watch during a break, I had to be very, very happy, very, very thrilled — let alone that I might call her back: when the payphone rang, there was no telling who would pick up.
Later we agreed on one call in the morning and one at night. But she always got up late; over there they had to be in the classroom for morning study by 7:30, and she was late for it several times — let alone making calls. Honestly: if I didn’t get the morning call, I would worry and feel bad for a long time, which only made me look forward to the evening one more.
Sometimes the teacher supervising her morning study wasn’t strict, and she could make an excuse to slip out and call. But I had morning study at 7:30 too, so often when I saw that number come in, I’d have to find an excuse and get out fast — no matter which teacher was watching, I had to run out and pick up. Because I knew how hard it was for her to make that call; she must have missed me too, and I looked forward to our daily call time.
Then, later still, I never expected that I’d really get her back by waiting. She came back to my school. We went to class together every day, studied together, sat at the same desk like before. I came to feel more and more that every day together was precious — we were both seniors close to graduating, and the time we could still spend together in high school was already short. How many people are that lucky, that fortunate, to end up at the same university? Even landing in the same city is hard enough.
So I only understood later: the unease of those days, the anxiety, even the missing — all of it was only part of it. More central: the her from that time wasn’t here, wasn’t by my side.
On “can’t reach them”
People going through a breakup, people who can’t reach their partner — what they share isn’t just “missing them.” It’s that they’re not here.
The first is a relationship that has ended; the second is a relationship still there, but the person isn’t by your side. Today’s products treat these two states as almost the same thing: both get filed under “you miss them,” both get soothed with “just talk more.” But they aren’t the same thing. “Not by your side” is a harder fact than “missing them” — missing them is something inside you; not by your side is those hundreds of kilometers between you, those ten-odd hours, that payphone with a line.
Everything built in this release grew out of that time.
What’s in this release
📨 Letters
“Some things can’t be said into a chat box. Write them down — when you’re done you can choose not to send, or you can hand it to them.”
The app used to have only one way to speak: say something to it, and get an answer. But the things a person most wants to say to someone they can’t reach are often the things they can’t say to them — and sometimes the answer is the question itself.
So there are two distinct actions:
- A letter to them — once written, you can hand it to them, or just write it down. A letter handed over gets a reply in about a day — real people don’t reply instantly. That part is on purpose.
- Save it for when they’re back — note it down and say it when you’re back in touch. No one will rush you.
Letters you only write down don’t get answered — that’s your choice. Some things are enough once said. They need no reply.
📴 Can’t reach them right now
This is a state, not a malfunction.
“You two can’t reach each other for now — not a breakup. The reminders stop, and their tone turns to letter-writing: no pressing, no assuming the other side has seen it.”
Turn it on and the reminders for anniversaries and the day you met stop, and the way they talk changes — like writing letters, not sending messages. Because when you can’t reach someone you don’t send messages. You write letters.
But it isn’t a breakup. The memories are still there, both of you are still there, and you can switch back any time.
🕯️ Will they speak first
The default is never.
“The number of times they speak first should be something you buy yourself, not something stuffed in by default.”
Turn it on and they’ll send the first message after you’ve gone a long time without talking — with content drawn from what they actually know. You set the frequency: once a day, once every three days, once a week, or just 「从不」 (“never”).
📖 What happened between you two
The persona only remembers what’s in your chat logs. But real life isn’t in the chat logs.
“Breakups, getting back together, business trips, arguments… all of it can be recorded here. Once they know, they won’t stay stuck at the beginning of your relationship.”
What gets recorded is reality: together, temporarily apart, back together, broken up, fighting, making up, news, meeting in person, whatever moved you. Once it’s recorded, their tone and state change with it — a relationship that has ended shouldn’t still speak in the voice of when you were together.
🕰 Their clock
When you’re not in the same time zone, “it’s evening now” isn’t the same fact for both of you.
The time difference is now a specific number of hours, not “another time zone.” It’s three in the morning where they are, three in the afternoon where you are — the app knows, and it will tell you 「TA 那边现在是深夜」 (“it’s the middle of the night where they are”).
🫧 Take a pause
“It’s been too noisy lately, or too tiring. Let things be quiet for a while — this isn’t a breakup, and it isn’t a goodbye. Just a pause.”
A “take a pause” state. It stops: anniversary reminders, them speaking first, bringing up goodbye. But the memories are all still there, the relationship is still there, and either side can come back.
💌 Say goodbye properly
Goodbye isn’t a button. It’s a ceremony.
The farewell letter, a timeline of your time together, the days worth keeping — write them down. This isn’t deletion; it’s saying everything you wanted to say.
✍️ Human feel
“The higher it goes, the more they type like a real person: subjects dropped, sentences left unfinished, occasionally changing the subject.”
A slider that decides how much the persona’s replies read like a person typing rather than an assistant answering. This number used to live in the prompt; users never touched it.
Also
The command palette, a persona profile page for who they are, a distillation mode picker (how much material this distillation uses, at what precision), mood logs, a safety record panel (what you’ve looked at, and when you learned it).
This release also delivers on what was promised before
💬 Replies now appear one character at a time
Before, you sent a message, the interface spun, and the whole reply appeared at once — that was fake streaming. Now it’s real: SSE pushes tokens one by one, Markdown renders as it comes, and you can stop it partway through.
Changing this meant a refactor first: the “compose context → call the model → persist → judge emotion → compute intimacy → check graduation” flow had been written out separately in four places (three tRPC endpoints + the WeChat channel). Now it’s collapsed into a single server/chat/service.ts, and web, streaming, WeChat, and Feishu all go through it.
🧠 Memory is finally remembered
memory.autoExtract kept extracting memories and saving them into the memories table — and then they were never read again. Now memory takes part in scoring (keyword coverage 45% + time freshness 25% + category weight 20% + manual pinning 10%), and the most relevant few make it into the context. Chinese uses bigram matching; no word-segmentation dependency is introduced.
One new concept: memory anchors (category = "anchor"). Anchors are always injected, and carry a hard constraint:
If the conversation needs to cite a specific fact beyond the anchors and memory holds no record of it, show uncertainty. Do not make things up.
Old conversations past the context window are no longer dropped; they’re compressed into a rolling summary and stored.
🛟 Emotional safety layer
The product docs described three kinds of monitoring; the code had zero implementation. Now they exist.
Crisis detection runs locally, with no network and no reporting: when self-harm or suicidal language is hit, the persona gently breaks character, says a word of care, then offers a local help line. Weak signals don’t trigger it — that would only become noise.
🌍 The server speaks two languages too
Only the interface used to be internationalized; every sentence the server returned to the user was Chinese. An English user would see Chinese in error dialogs, push reminders, WeChat replies, graduation prompts — exactly when the wording needs to be clearest.
Now the server has its own copy table (445 strings, each with a Chinese and an English version), and the system prompts are split by language too; built-in scenarios, questionnaires, and distillation progress likewise.
The installed app speaks like a human in both directions — including the prompts it writes for the model.
🔒 Redis ships with the installer
Rate limiting and the scheduler’s locks need shared storage. Both used to be single-process: start a second copy of Mirrai and the quota would double, anniversary reminders would go out twice.
Now all three install methods bring their own Redis:
| Install method | Where Redis comes from |
|---|---|
macOS .dmg | Bundled in Mirrai.app/Contents/Resources/redis/ |
Windows .zip / .exe | Bundled in redis\ under the install directory |
| Docker | redis-server is already installed in the image |
Users configure nothing and download nothing extra. The app prefers the one in the package, starting and stopping it on its own.
✨ Feishu channel
Feishu’s 「使用长连接接收事件」 (“receive events via long connection”) mode needs no public IP, domain name, or SSL certificate — like the WeChat channel, it’s suited to running on your own machine.
⚠️ Requires an enterprise self-built app (long-connection mode doesn’t support store apps), and the app must be published and approved by an admin before its permissions take effect.
📥 Multi-source chat log collection
The four collectors in skill-engine/tools/ (Feishu / DingTalk / Slack / email) were never referenced by any code. Now they’re wired in: one collection contract, progress reporting, idempotent import.
🎴 SillyTavern character cards
The persona can be exported as a character card (with a chara chunk) that other tools can read directly; it can also be imported back the same way. No new npm dependencies — PNG chunk reading/writing and CRC32 are implemented ourselves.
📝 Guided questionnaire & persona template library
You can create a persona with no chat history at all. Nine Q&A steps produce a persona that fits the 7-layer structure. The template library deliberately has no remote marketplace — the product’s ethical framework is explicit: “the system does not own, sell, or analyze any of the user’s personal data.”
🖥 PWA
Installable to the desktop or home screen. The Service Worker caches only the app shell; /api/** and /uploads/** are network-only, without exception — your conversations are never written into any cache.
Also fixed along the way: where behavior didn’t match the promise
| Problem | Before | Now |
|---|---|---|
| The API key you set in settings | Saved into the llm_configs table and never read by any call | Resolved per user, effective on save; keys stored encrypted, list endpoints return masked values only |
| Logging out | Cleared only the cookie; the JWT expired a year later | Token versioning — logout invalidates immediately |
| Cross-user access | Other people’s persona jobs could be read, other people’s scenarios deleted | Every query carrying an identifier enforces a userId predicate; TypeScript forces the caller to pass it |
| Upload directory | The whole /uploads tree was served statically — chat logs, photos, TTS fetchable by URL alone | Per-user auth; the ownership segment in the path must match the current user |
| No rate limiting | Neither the login endpoint nor any metered LLM endpoint had any | Token-bucket rate limiting — auth by IP, LLM by user |
| CSRF | Cookies used SameSite=None over HTTPS, no Origin check | Default changed back to lax, plus Origin validation |
| Deleting an account left garbage | Deleting an account missed diaries, scenarios, and distillation jobs, and there was no transaction | One transaction deletes everything |
| Migration scripts | pnpm db:push depended on the gitignored drizzle/meta/; a fresh clone always failed | Switched to drizzle-kit push, plus an idempotent, re-runnable pnpm db:migrate |
Also: without Redis, the scheduler let reminders, reply nudges, and proactive messages all silently not run — lock failures were swallowed. Now, with no shared storage, it simply scans directly.
Verification for this release
- 971 tests / 96 files all green,
tscclean - Across the whole app (server + UI + shared code): 0 Chinese strings without an English counterpart — the scanner uses TypeScript’s own parser; comments and regexes can’t fool it
- The desktop package smoke test actually ran it: with a normal user (PostgreSQL refuses to run as admin) it initialized the database, created tables, started the service, confirmed an HTTP response, and confirmed the app was using the bundled Redis
- The macOS package, tested live: the app starts
Mirrai.app/Contents/Resources/redis/bin/redis-server, not the system one; when the app stops, it stops too
Upgrade notes
Desktop users
Download the installer again. The database syncs automatically on startup.
Source users
pnpm install
pnpm db:migrate # 应用增量迁移(幂等,可重复运行)
pnpm build && pnpm start
New installs can just run pnpm db:push once for the full schema.
One setting that needs your confirmation
On first launch, Mirrai creates a local admin (username admin, random password) and writes the credentials to:
- macOS:
~/Library/Application Support/Mirrai/first-run-credentials.txt - Windows:
%APPDATA%\Mirrai\first-run-credentials.txt
Please change this password as soon as you’ve logged in. If you don’t want it created automatically, set MIRRAI_BOOTSTRAP_ADMIN=manual.
Install
- macOS (Apple Silicon): download
Mirrai-macOS-arm64.dmgbelow, drag it into Applications, double-click to run - Windows (x64): download
Mirrai-Setup-x64.exebelow, double-click to install - Docker:
cp .env.example .env && docker compose up -d→ http://localhost:3000 - Source: see the README quick start
First launch on desktop can take a minute or two (it initializes the database). If macOS blocks the first open: System Settings → Privacy & Security → Open Anyway.
A note on ethics
Only upload chat history you have the right to use; get consent before modeling a real person. Mirrai’s goal is to help you finish the goodbye, not to replace a real relationship.
The hotline numbers in the crisis support resource list come from the built-in list; please verify them by hand once before going live — they change. The list lives in server/safety/resources.ts, and you can swap in your own with SAFETY_RESOURCES_FILE.
Many of the features in this release grew out of my own experience. And it’s because of that experience that I put particular care into making this product well.