Find a file
RainbowBird 0642ede8d1
Some checks failed
CI / Lint (push) Has been cancelled
CI / Build Test (stage-tamagotchi) (push) Has been cancelled
CI / Build Test (stage-tamagotchi-godot) (push) Has been cancelled
CI / Build Test (stage-web) (push) Has been cancelled
CI / Build Test (ui-loading-screens) (push) Has been cancelled
CI / Build Test (ui-transitions) (push) Has been cancelled
CI / Unit Test (push) Has been cancelled
CI / Type Check (push) Has been cancelled
CI / Check Provenance (push) Has been cancelled
Cloudflare Pages (Auth UI) / Deploy - ui-server-auth (push) Has been cancelled
Cloudflare Workers / Deploy - stage-web (push) Has been cancelled
Update Nix pnpmDeps Hash / update (push) Has been cancelled
feat(analytics): expand PostHog coverage and forward server business facts (#2038)
## What

Closes the three structural gaps in AIRI's product analytics: the signup
surface had zero instrumentation, the payment funnel had no terminator
in PostHog, and SPA route changes emitted no pageviews. Also adds
semantic events for character cards, desktop-only features, and
data-maintenance actions.

## User paths

- User signs up / logs in / verifies email / resets password / links
OAuth / deletes account → each step now emits a PostHog event from
`apps/ui-server-auth` (previously fully uninstrumented), with
`identify()` wired on session load so anonymous funnel events merge into
the user person.
- User pays via Stripe → webhook writes `product_events` as before, and
the product-events service now forwards `payment_completed` (plus signup
and subscription lifecycle facts) to PostHog via posthog-node
`captureImmediate`, keyed by the Better Auth user id → the
`checkout_started → payment_completed` funnel closes end-to-end.
Per-request LLM/TTS volume is explicitly not forwarded.
- User navigates between routes in any surface (web / desktop / pocket /
docs) → `$pageview` + `$pageleave` fire per route change via the
posthog-js `defaults: '2025-05-24'` preset in the shared
`posthog.config.ts`.
- User creates / imports / duplicates / edits a ccv3 card, switches
stage background, runs destructive data actions (export / import / clear
chats, reset providers, wipe app data), or uses desktop differentiators
(Spotlight send, widget windows, in-app updater, MCP server management,
pairing QR) → dedicated low-cardinality events.

## Notable decisions

- Server forwarding defaults on: `POSTHOG_PROJECT_KEY` defaults to the
shared browser-safe phc_* project key; set it to an empty string to
disable. Postgres `product_events` remains the source of truth.
- Cross-surface events (`oauth_callback_failed`, account lifecycle)
share one stage vocabulary exported from stage-ui so the two emitters
cannot drift silently.
- Events captured right before full-page navigation use `sendBeacon` so
they survive the redirect (checkout, OAuth consent handoff, login
redirect).
- Removed dead wrappers (`trackSignup`, `trackFirstModelSelected`,
`trackModelChanged`) that duplicated live event streams under second
names.

## How tested

- `pnpm -F @proj-airi/server exec vitest run
src/services/domain/product-events.test.ts` — 6 passed, covering the
forwarding allowlist, the `user_signed_up → signup_completed` mapping,
non-forwarded per-request actions, and a throwing sink not failing the
webhook path nor losing the DB row.
- stage-ui suites (`use-analytics`, `use-linked-accounts`, exports
contract) — 22 passed, including new account/card/data/desktop event
assertions.
- Real transport smoke: posthog-node `captureImmediate` against
`us.i.posthog.com` with the production key resolved in 1380ms (one
`server_forwarding_smoke_test` event left in the project; filter by
event name).
- Browser-tested pageviews: `VITE_ENABLE_POSTHOG=true` dev build, two
`history.pushState` route changes each produced a `$pageview` with
`$pathname`, `navigation_type: pushState`, previous-page dwell time, and
the `surface` super property; batched POST to `us.i.posthog.com/e/`
returned 200. Note: posthog-js drops events from automated browsers
(`navigator.webdriver`) by default — the verification session bypassed
the bot filter locally; production config is untouched.
- Typecheck and lint pass for server, stage-ui, stage-pages, stage-web,
stage-tamagotchi, ui-server-auth.

Full verification record:
`apps/server/docs/ai-context/verifications/posthog-forwarding-and-pageview.md`

## Follow-ups (not in this PR)

- Bot channel usage stats (Discord / Telegram) once they route through
server-runtime counters.
- Main-process desktop events (tray menu, global shortcut fire) need
renderer relay plumbing.
- Confirm `payment_completed` arrives in PostHog after the first real
Stripe payment post-deploy.

https://claude.ai/code/session_01Q1yGavkQ1P41YhTWE4XKex
2026-07-08 15:33:39 +08:00
.agents/skills docs(agents): add server gateway refactor skill 2026-06-03 13:48:18 +08:00
.cursor/commands feat(ci): lint swift code 2026-01-02 23:49:01 +08:00
.gemini chore: disable gemini review 2026-05-16 17:27:26 +08:00
.github chore: remove admin dashboard 2026-07-02 02:22:16 +08:00
.vscode chore(ci): added Godot vscode extension recommendation, and .prototools for managing dotnet versions 2026-04-23 02:19:44 +08:00
.zed chore(workspace): added Zed editor config 2026-01-30 16:56:50 +08:00
apps feat(analytics): expand PostHog coverage and forward server business facts (#2038) 2026-07-08 15:33:39 +08:00
bucket fix(bucket): update Scoop manifest to v0.9.0-alpha.18 (#1430) 2026-03-20 23:45:26 +08:00
docs chore: update sponsors svg (#2036) 2026-07-08 04:27:39 +00:00
engines/stage-tamagotchi-godot release: v0.11.0 2026-07-08 01:20:12 +08:00
integrations/vscode release: v0.11.0 2026-07-08 01:20:12 +08:00
nix fix(nix): missing runtime libs & small changes (#1956) 2026-06-07 01:37:54 -04:00
packages feat(analytics): expand PostHog coverage and forward server business facts (#2038) 2026-07-08 15:33:39 +08:00
patches chore(stage-tamagotchi): patch uiohook-napi to use prebuilt binaries and skip postinstall build 2026-05-20 15:27:22 +09:00
plugins release: v0.11.0 2026-07-08 01:20:12 +08:00
scripts chore(ci): resolve OpenCollective 401 in sponsors workflow (#1843) 2026-05-19 19:11:03 +08:00
services release: v0.11.0 2026-07-08 01:20:12 +08:00
.dockerignore feat(ci): proper Dockerfile for current project setup & release workflow 2025-08-25 04:30:37 +08:00
.editorconfig feat(stage-tamagotchi): add click through support (previous macOS only, now both supported) (#187) 2025-05-31 01:45:47 +08:00
.gitattributes fix(ci): min-integrity: none for safeoutput mcp call (#1645) 2026-04-12 18:02:58 +08:00
.gitignore chore(.gitignore): updated 2026-06-18 15:14:31 +08:00
.prototools chore(ci): added Godot vscode extension recommendation, and .prototools for managing dotnet versions 2026-04-23 02:19:44 +08:00
.tool-versions chore(workspace): bump node.js version to 24.13.0 2026-03-09 22:25:56 +08:00
AGENTS.md docs: require inline comments for calculation-heavy code (#2013) 2026-06-27 01:30:11 +08:00
bump.config.ts chore(bumpp): bump versions in iOS project 2026-04-05 01:07:56 +09:00
CLAUDE.md chore(docs): replace CLAUDE.md symlink with @AGENTS.md reference (#1455) 2026-03-23 13:56:52 +08:00
crowdin.yml chore(ci): autofix crowdin files 2025-11-30 20:27:08 +08:00
cspell.config.yaml feat(stage-tamagotchi,stage-shared): listen keyup for global shortcut with uiohook 2026-05-20 03:07:54 +09:00
default.nix feat(nix): add nix flake and package (#319) 2025-07-28 12:48:58 +08:00
eslint.config.ts chore: convert eslint config to typescript 2026-07-07 23:57:44 +08:00
flake.lock fix(nix): missing runtime libs & small changes (#1956) 2026-06-07 01:37:54 -04:00
flake.nix chore(ci): Remove CI concurrency group & small fixes (#1758) 2026-05-04 06:37:35 +08:00
knip.json perf: setup knip, remove unused dependencies (#992) 2026-01-24 15:08:08 +08:00
LICENSE docs: update LICENSE 2024-12-03 16:25:03 +08:00
package.json release: v0.11.0 2026-07-08 01:20:12 +08:00
pnpm-lock.yaml feat(analytics): expand PostHog coverage and forward server business facts (#2038) 2026-07-08 15:33:39 +08:00
pnpm-workspace.yaml feat(analytics): expand PostHog coverage and forward server business facts (#2038) 2026-07-08 15:33:39 +08:00
posthog.config.ts feat(analytics): expand PostHog coverage and forward server business facts (#2038) 2026-07-08 15:33:39 +08:00
README.md docs: update README 2026-06-05 17:02:34 +08:00
rustfmt.toml chore: update rust fmt rules (#235) 2025-06-28 00:26:07 +08:00
skills-lock.json chore(.agent): added agent-browser skill 2026-04-15 04:32:18 +08:00
sponsorkit.config.js feat(docs): sync download buttons and added SponsorKit (#1407) 2026-03-19 03:23:21 +08:00
tsconfig.json chore(pocket): exclude build and public folder in tsconfig 2026-05-04 19:47:38 +08:00
turbo.json fix(turbo): add missing dependency for build task 2026-07-02 02:42:57 +08:00
uno.config.ts feat(inference): unify and optimize WebGPU inference pipeline (#1622) 2026-04-13 23:19:27 +08:00
vite-env.d.ts refactor(posthog): unify project key for all AIRI surfaces and streamline configuration 2026-07-08 00:05:26 +08:00
vitest.config.ts feat(stage-godot): rim light (#2032) 2026-07-07 05:21:15 +08:00

Project AIRI

Re-creating Neuro-sama, a soul container of AI waifu / virtual characters to bring them into our world.

[Join Discord Server] [Try it] [简体中文] [日本語] [Русский] [Tiếng Việt] [Français] [한국어]

AIRI - A container of cyber living souls, re-creation of Neuro-sama | Product Hunt moeru-ai%2Fairi | Trendshift

Heavily inspired by Neuro-sama

Tip

On Windows, you can also install AIRI with winget:

winget install MoeruAI.AIRI

Or install AIRI with Scoop:

scoop bucket add airi https://github.com/moeru-ai/airi
scoop install airi/airi

On macOS, you can install AIRI with Homebrew Cask without adding a custom tap:

brew install --cask airi

Warning

Attention: We do not have any officially minted cryptocurrency or token associated with this project. Please check the information and proceed with caution.

Note

We've got a whole dedicated organization @proj-airi for all the sub-projects born from Project AIRI. Check it out!

RAG, memory system, embedded database, icons, Live2D utilities, and more!

Tip

We have a translation project on Crowdin. If you find any inaccurate translations, feel free to contribute improvements there. Crowdin | Agile localization for tech companies

Have you dreamed about having a cyber living being (cyber waifu, digital pet) or digital companion that could play with and talk to you?

With the power of modern large language models like ChatGPT and famous Claude, asking a virtual being to roleplay and chat with us is already easy enough for everyone. Platforms like Character.ai (a.k.a. c.ai) and JanitorAI as well as local playgrounds like SillyTavern are already good-enough solutions for a chat based or visual adventure game like experience.

But, what about the abilities to play games? And see what you are coding at? Chatting while playing games, watching videos, and is capable of doing many other things.

Perhaps you know Neuro-sama already. She is currently the best virtual streamer capable of playing games, chatting, and interacting with you and the participants. Some also call this kind of being "digital human." Sadly, as it's not open sourced, you cannot interact with her after her live streams go offline.

Therefore, this project, AIRI, offers another possibility here: let you own your digital life, cyber living, easily, anywhere, anytime.

Recent DevLogs & Stories

What's So Special About This Project?

Unlike the other AI driven VTuber open source projects, アイリ was built with support of many Web technologies such as WebGPU, WebAudio, Web Workers, WebAssembly, WebSocket, etc. from the first day.

Tip

Worrying about the performance drop since we are using Web related technologies?

Don't worry, while the Web browser version is meant to give an insight into how much we can push and do inside browsers and webviews, we will never fully rely on this. The desktop version of AIRI is capable of using native NVIDIA CUDA and Apple Metal by default (thanks to HuggingFace & the beloved candle project), without any complex dependency management. Considering the tradeoff, it is partially powered by Web technologies for graphics, layouts, animations, and the WIP plugin system for everyone to integrate things.

This means that アイリ is capable of running on modern browsers and devices and even on mobile devices (already done with PWA support). This brings a lot of possibilities for us (the developers) to build and extend the power of アイリ VTuber to the next level, while still leaving the flexibility for users to enable features that require TCP connections or other non-Web technologies such as connecting to a Discord voice channel or playing Minecraft and Factorio with friends.

Note

We are still in the early stage of development where we are seeking out talented developers to join us and help us to make アイリ a reality.

It's ok if you are not familiar with Vue.js, TypeScript, and devtools required for this project, you can join us as an artist, designer, or even help us to launch our first live stream.

Even if you are a big fan of React, Svelte or even Solid, we welcome you. You can open a sub-directory to add features that you want to see in アイリ, or would like to experiment with.

Fields (and related projects) that we are looking for:

  • Live2D modeller
  • VRM modeller
  • VRChat avatar designer
  • Computer Vision
  • Reinforcement Learning
  • Speech Recognition
  • Speech Synthesis
  • ONNX Runtime
  • Transformers.js
  • vLLM
  • WebGPU
  • Three.js
  • WebXR (checkout the another project we have under the @moeru-ai organization)

If you are interested, why not introduce yourself here? Would like to join part of us to build AIRI?

Current Progress & Roadmap

Capable of

  • Brain
  • Ears
    • Audio input from browser
    • Audio input from Discord
    • Client side speech recognition
    • Client side talking detection
  • Mouth
    • Multi-provider voice synthesis, including ElevenLabs, Microsoft/Azure Speech, OpenAI-compatible TTS, Alibaba Cloud Model Studio, and local Kokoro TTS
  • Body
    • VRM support
      • Control VRM model
    • VRM model animations
      • Auto blink
      • Auto look at
      • Idle eye movement
    • Live2D support
      • Control Live2D model
    • Live2D model animations
      • Auto blink
      • Auto look at
      • Idle eye movement

Development

For detailed instructions to develop this project, follow CONTRIBUTING.md

Note

By default, pnpm dev will start the development server for the Stage Web (browser version). If you would like to try developing the desktop version, please make sure you read CONTRIBUTING.md to setup the environment correctly.

pnpm i
pnpm dev

Stage Web (Browser Version at airi.moeru.ai)

pnpm dev

Stage Tamagotchi (Desktop Version)

pnpm dev:tamagotchi

A Nix package for Tamagotchi is included. To run airi with Nix, first make sure to enable flakes, then run:

nix run github:moeru-ai/airi

NixOS

Electron requires shared libraries that aren't in standard paths on NixOS. Use the FHS shell defined in flake.nix:

nix develop .#fhs
pnpm dev:tamagotchi

Stage Pocket (Mobile Version)

Start the development server for the capacitor:

pnpm dev:pocket:ios --target <DEVICE_ID_OR_SIMULATOR_NAME>
# Or
CAPACITOR_DEVICE_ID_IOS=<DEVICE_ID_OR_SIMULATOR_NAME> pnpm dev:pocket:ios

You can see the list of available devices and simulators by running pnpm exec cap run ios --list.

If you need to connect server channel on pocket in wireless mode, you need to start tamagotchi as root:

sudo pnpm dev:tamagotchi

Then enable secure websocket in tamagotchi settings/connections.

Documentation Site

pnpm dev:docs

Publish

Run bumpp to update the monorepo version:

npx bumpp --no-commit --no-tag

Support of LLM API Providers (powered by xsai)

Sub-projects Born from This Project

%%{ init: { 'flowchart': { 'curve': 'catmullRom' } } }%%

flowchart TD
  Core("Core")
  Unspeech("unspeech")
  DBDriver("@proj-airi/drizzle-duckdb-wasm")
  MemoryDriver("[WIP] Memory Alaya")
  DB1("@proj-airi/duckdb-wasm")
  SVRT("@proj-airi/server-runtime")
  Memory("Memory")
  STT("STT")
  Stage("Stage")
  StageUI("@proj-airi/stage-ui")
  UI("@proj-airi/ui")

  subgraph AIRI
    DB1 --> DBDriver --> MemoryDriver --> Memory --> Core
    UI --> StageUI --> Stage --> Core
    Core --> STT
    Core --> SVRT
  end

  subgraph UI_Components
    UI --> StageUI
    UITransitions("@proj-airi/ui-transitions") --> StageUI
    UILoadingScreens("@proj-airi/ui-loading-screens") --> StageUI
    FontCJK("@proj-airi/font-cjkfonts-allseto") --> StageUI
    FontXiaolai("@proj-airi/font-xiaolai") --> StageUI
  end

  subgraph Apps
    Stage --> StageWeb("@proj-airi/stage-web")
    Stage --> StageTamagotchi("@proj-airi/stage-tamagotchi")
    Core --> RealtimeAudio("@proj-airi/realtime-audio")
    Core --> PromptEngineering("@proj-airi/playground-prompt-engineering")
  end

  subgraph Server_Components
    Core --> ServerSDK("@proj-airi/server-sdk")
    ServerShared("@proj-airi/server-shared") --> SVRT
    ServerShared --> ServerSDK
  end

  STT -->|Speaking| Unspeech
  SVRT -->|Playing Factorio| F_AGENT
  SVRT -->|Playing Minecraft| MC_AGENT

  subgraph Factorio_Agent
    F_AGENT("Factorio Agent")
    F_API("Factorio RCON API")
    factorio-server("factorio-server")
    F_MOD1("autorio")

    F_AGENT --> F_API -.-> factorio-server
    F_MOD1 -.-> factorio-server
  end

  subgraph Minecraft_Agent
    MC_AGENT("Minecraft Agent")
    Mineflayer("Mineflayer")
    minecraft-server("minecraft-server")

    MC_AGENT --> Mineflayer -.-> minecraft-server
  end

  XSAI("xsAI") --> Core
  XSAI --> F_AGENT
  XSAI --> MC_AGENT

  Memory_PGVector("@proj-airi/memory-pgvector") --> Memory

  style Core fill:#f9d4d4,stroke:#333,stroke-width:1px
  style AIRI fill:#fcf7f7,stroke:#333,stroke-width:1px
  style UI fill:#d4f9d4,stroke:#333,stroke-width:1px
  style Stage fill:#d4f9d4,stroke:#333,stroke-width:1px
  style UI_Components fill:#d4f9d4,stroke:#333,stroke-width:1px
  style Server_Components fill:#d4e6f9,stroke:#333,stroke-width:1px
  style Apps fill:#d4d4f9,stroke:#333,stroke-width:1px
  style Factorio_Agent fill:#f9d4f2,stroke:#333,stroke-width:1px
  style Minecraft_Agent fill:#f9d4f2,stroke:#333,stroke-width:1px

  style DBDriver fill:#f9f9d4,stroke:#333,stroke-width:1px
  style MemoryDriver fill:#f9f9d4,stroke:#333,stroke-width:1px
  style DB1 fill:#f9f9d4,stroke:#333,stroke-width:1px
  style Memory fill:#f9f9d4,stroke:#333,stroke-width:1px
  style Memory_PGVector fill:#f9f9d4,stroke:#333,stroke-width:1px

Similar Projects

Open sourced ones

Non-open-sourced ones

Project Status

Repobeats analytics image

Acknowledgements

Supporters

Thank you for supporting Project AIRI through OpenCollective, Patreon, and Ko-fi.

Project AIRI supporters

Special Thanks

Special thanks to all contributors for their contributions to Project AIRI ❤️

Star History

Star History Chart