Mirrai — AI Persona Builders tool screenshot
AI Persona Builders

Mirrai: Best AI Persona Builders for Developers in 2026

7 min read·

Mirrai turns chat logs into a stateful digital persona with multi-provider LLM routing, emotion-state switching, and WeChat auto-reply support.

Pricing

Open-Source

Tech Stack

TypeScript 5.9, React 19, Node.js 20+, Express, tRPC, Drizzle, Wouter, Wechaty, Tailwind CSS, Framer Motion

Target

developers

Category

AI Persona Builders

What Is Mirrai?

Mirrai is a GitHub-hosted AI persona builder built by Ch1rpy2613. It turns uploaded chat logs into a stateful digital clone that replies in a target person's tone, and it is one of the best AI Persona Builders tools for developers. The repo documents a TypeScript 5.9, React 19, and Node.js 20+ stack, plus 10 LLM providers and 6 emotion states as of Feb 2026.

Quick Overview

AttributeDetails
TypeAI Persona Builders
Best ForDevelopers
Language/StackTypeScript 5.9, React 19, Node.js 20+, Express, tRPC, Drizzle, Wouter, Wechaty, Tailwind CSS, Framer Motion
LicenseMIT
GitHub StarsN/A as of Feb 2026
PricingOpen-Source
Last ReleaseN/A

Who Should Use Mirrai?

  • Indie hackers building companion apps who want a persona engine, not just a chat UI.
  • Full-stack developers who prefer a TypeScript-first repo with tRPC, Drizzle, and React in one codebase.
  • Teams prototyping conversational memory that need stateful replies, exportable chat history, and emotional transitions.
  • Builders shipping WeChat-native experiences who need the same persona to answer on web and in a bot channel.

Not ideal for:

  • products that need a managed SaaS and zero setup
  • teams handling highly sensitive chat logs without a privacy review
  • apps that need enterprise compliance, audit workflows, or consent gating out of the box

Key Features of Mirrai

  • Multi-stage persona distillation — The pipeline goes from upload to character extraction to structured persona synthesis. It separates style, attachment signals, love language, conflict behavior, and trigger moments so the model is not guessing from a single prompt.
  • Emotion state machine — Mirrai tracks six states: 温柔, 俏皮, 思念, 忧郁, 开心, and 疏离. State transitions are triggered by keywords and can also be overridden manually in the UI, which keeps replies consistent across long sessions.
  • Provider-agnostic LLM layer — One adapter handles OpenAI-compatible APIs, Claude, DeepSeek, Kimi, Qwen, Ollama, Dify, and 讯飞星火. The baseUrl and model split means changing models is mostly a config change, not a refactor.
  • Wechaty-based WeChat automation — Scan a QR code, bind a contact to a persona, and let the same memory store drive web and WeChat replies. Messages are tagged by channel, so you can debug whether drift comes from the bot flow or the browser flow.
  • Type-safe full stack — Drizzle schema definitions flow into tRPC routers and React Query hooks, so contract changes surface at compile time. That matters when the persona object carries many fields and the UI needs to stay aligned with the database.
  • Memory, diary, and export tooling — Mirrai can extract relationship memory nodes, generate daily diaries, and export a self-contained HTML conversation archive with SVG emotion timelines. That makes post-chat analysis possible without digging through raw logs.
  • Built-in TTS playback — Replies can be read aloud with Edge TTS, which is enough for validating a voice layer before you invest in custom audio. If you need a richer voice workflow, Moonshine Voice is the more specialized sidecar.

Mirrai vs Alternatives

ToolBest ForKey DifferentiatorPricing
MirraiSelf-hosted persona apps with chat-log ingestion and WeChat automationOpen source, multi-provider, and built around structured persona stateOpen-Source
ReplikaManaged emotional companion appsPolished hosted product with no self-hosting burdenFreemium
Character.AIBrowsing and sharing public charactersHuge consumer character ecosystem and low-friction discoveryFreemium
SillyTavernLocal-model prompt tinkeringDeep prompt control, community extensions, and local-first workflowsOpen-Source

Mirrai is the better pick when you want full source control, explicit persona extraction, and a channel bridge into WeChat. If you need prompt-level tracing while tuning the persona pipeline, pair Mirrai with OpenTrace.

Replika makes sense if you want a hosted companion with minimal setup and you do not care about the internals. Character.AI is better if the goal is entertainment, discovery, and public character distribution rather than private persona reconstruction.

SillyTavern is the fallback when you care more about prompt plumbing than opinionated product flows. If your team is editing long persona prompts or context packs all day, Claude Context Mode is a better companion for that workflow than manually juggling text files.

How Mirrai Works

Mirrai uses a layered architecture instead of a single prompt blob. The browser client in React 19 talks to Express through tRPC with HTTP batching and SuperJSON, and the server fans out into routers for auth, persona, file ingestion, chat, memory, emotion, diary, scene, analytics, WeChat, skill engine, and LLM config.

The key design choice is that persona generation is a pipeline, not a one-shot completion. Raw material gets normalized into structured traits, then merged into a durable persona record backed by Drizzle and Postgres, and only then does the chat layer ask the model to answer in-character. That keeps reply behavior tied to stored state instead of re-sending a giant prompt on every turn.

await trpc.persona.create.mutate({
  name: 'TA',
  sourceFiles: ['wechat.txt', 'moments.csv'],
  provider: 'ollama',
  model: 'llama3'
});

That call is the start of the flow: upload sources, extract traits, persist the persona, and wire the persona into the chat runtime. If you swap provider to an OpenAI-compatible backend, the same route still works because the abstraction is built around baseUrl and model, not a single vendor SDK.

The WeChat bot path is equally direct. Wechaty handles QR login and contact binding, while the shared memory layer keeps web and bot replies aligned, so the same persona can answer in both channels without duplicating prompt logic.

Pros and Cons of Mirrai

Pros:

  • Open-source MIT licensing means you can inspect, fork, and self-host the full stack.
  • The provider adapter covers cloud and local models, so model choice is not locked to one vendor.
  • The persona pipeline is explicit, which is better than hoping a single prompt can encode style, memory, and emotion.
  • Web, WeChat, diary, memory, and analytics live in one repo, which reduces glue code.
  • Strong TypeScript coverage lowers the chance of broken UI-to-API contracts.

Cons:

  • You need to manage sensitive chat logs, keys, and infrastructure yourself.
  • Emotion-state heuristics can misfire on ambiguous text, especially in short replies.
  • The setup is heavier than a hosted companion app because it includes database, model, and bot configuration.
  • Edge TTS is fine for validation, but it is not a custom voice-cloning stack.
  • There is no built-in enterprise governance layer for consent, retention, or compliance workflows.

Getting Started with Mirrai

git clone https://github.com/Ch1rpy2613/Mirrai.git
cd Mirrai
pnpm install
cp .env.example .env
pnpm dev

After the first boot, fill in your database URL, JWT secret, and one LLM provider key or base URL in the environment file. If you enable the WeChat bot, scan the QR code from the session after the server starts, then bind a contact to a persona and import a chat export to test the pipeline.

Verdict

Mirrai is the strongest option for self-hosted AI persona builders when you need chat-log ingestion, provider switching, and WeChat automation in one TypeScript codebase. Its biggest strength is structured persona state; its main caveat is that you must handle sensitive data and tuning yourself. Choose Mirrai if you want control over the whole stack.

Frequently Asked Questions

Looking for alternatives?

Compare Mirrai with other AI Persona Builders tools.

See Alternatives →

You Might Also Like