IM × Short Video × Mini-Drama × LBS Social × AI — One Integrated Stack

One Engine, Connects Every Screen
Full-Platform Real-Time Social Engine

Reason is built on a high-performance C++ IM microservice core, with one proprietary protocol unifying Android, iOS, Windows, Qt desktop and Web. It ships with a vertical short-video feed, immersive mini-drama, encounter radar & drift bottle, QUIC P2P encrypted direct links, and a multi-agent AI sentiment engine — not a demo, but a deployable production codebase.

Explore Features ⬇ Download APK View Architecture
Reason full-platform real-time social engine: chat and short-video streams connecting phones worldwide
5 ClientsAndroid / iOS / Win / Qt / Web
7 ServicesC++ microservices
1 ProtocolInteroperable everywhere
0K+
Long connections on 8GB RAM
0KB
Memory per idle connection (measured)
0 shards
DM & group message tables
0+
Social platforms covered by AI
Screens

Real Screens From the Android App

No mockups — these are live captures of the Reason Android client: remarks take priority over nicknames in the chat list and contacts, with bottom-tab navigation and the full messaging experience.

Reason Android chat list, remark-priority names
ChatChat list · remarks first
Reason Android contacts, letter index and friend remarks
ContactsContacts · letter index & remarks
⬇ Download Android APK

app-arm64-v8a-release.apk · Android 5.0+ (minSdk 21) · allow install from unknown sources

Tech Stack

One protocol end to end: a C++ multi-Reactor core, Protobuf wire format, QUIC transport, sharded MySQL, Redis, MinIO / S3 storage and MCP tooling for AI agents.

Features

Why Reason

Capabilities unfold as a waterfall — from the underlying protocol to the top-line engagement features. Every card is shipped code, not a slideware concept.

Reason C++ IM microservice cluster streaming Protobuf packets
🛰️

High-Performance C++ IM Core

Seven microservices — login, msg, route, db_proxy, file, push and msfs — cooperate over a private 16-byte big-endian header and Protobuf. A multi-Reactor model plus a business thread pool scales across real Linux cores.

  • An idle connection costs only 1.61KB — no read buffer is allocated until data flows
  • Per-user fine-grained locks, HA shared buffers, dynamic EPOLLOUT
  • ~400K long connections within an 8GB server memory budget
C++17Multi-ReactorRedisMySQL

Five Clients, One Protocol

Android, iOS, the classic Windows client (MFC + Duilib), the all-new Qt6/C++17 desktop client and Web share the exact same .proto and packet header. Desktop clients connect directly to the live login/msg servers and exchange messages with mobile clients in real time.

Android KotliniOS Objective-CQt6 / CMakeWin32
Reason vertical short-video feed on a smartphone
📱

Vertical Short-Video Feed

Full-screen vertical swiping, autoplay with mute switching, double-tap to like, tap to pause. Gallery posts support horizontal multi-image swipe while a vertical swipe moves to the next clip — the gestures never fight each other.

Gallery swipeRecommend / Local feedR / NC-17 age gate
🔐

One Identity: HMAC Ticket SSO

Every service (short video, mini-drama, nearby) reuses IM credentials to obtain a stateless HMAC-SHA256 ticket, valid for 2 hours with no Redis required. The ticket endpoint enforces failure rate limiting so it can never exhaust IM login quotas. Follows come only from the IM friend graph — never a second copy.

HMAC-SHA256Stateless authAnti-brute-force limit
QUIC P2P encrypted direct chat link between two Reason clients
⚡

QUIC P2P Encrypted Direct Link

Friend chats prefer a direct MsQuic link: STUN discovers the NAT mapping, QUIC punches through, with TLS 1.3 encryption and reliable ordered streams — cutting relay bandwidth and latency.

  • Transparent fallback to the TCP relay within 3s if punching fails — users never notice
  • Zero server changes — reuses the existing CID601 signaling channel
MsQuicSTUNTLS 1.3
Reason encounter radar and anonymous drift bottle discovery
🌊

Encounter Radar & Drift Bottle

"Nearby" drops the map and becomes an exploration game: the radar randomly surfaces active users in the same domain, while exploration actions earn XP, titles and badges. Anonymous drift bottles power asynchronous throw / pick / reply socializing.

Explore & level upHaversineTTL privacy minimization
🎬

Immersive Mini-Drama Theater

A standalone module on a par with short video: vertical full-screen playback, auto-advance to the next episode, an episode picker, watchlist/favorites and resume progress, with VIP episode-lock fields reserved. The Discover page routes dynamically by domain URL prefix between video, drama and Web — switch products without shipping a new build.

Go serviceMedia3 ExoPlayerDrag-sort admin console
🕶️

"Guiji" Stealth Mode & Privacy

A secondary Cipher Code is verified independently; once Stealth Mode ("Guiji") is entered, its entry point disappears completely and can only be summoned via a version-number easter egg plus the cipher code. Combined with blocklist, mute, session hiding, ban policies and the cross-platform libsecurity library.

Cipher codeStealth entryTLS transport
Reason multi-agent AI sentiment engine analyzing social posts
🧠

Multi-Agent AI Sentiment Engine "WeiYu"

Submit analysis tasks like a chat: Query, Media, Insight and Report agents research in parallel while a forum moderator drives multi-round debate to avoid single-model homogenization, blending BERT/Qwen fine-tuned sentiment models with statistical models.

  • Crawls 30+ platforms including Weibo, Xiaohongshu and Douyin, plus millions of comments
  • Multimodal understanding of short videos and structured search cards
  • Auto-binds interactive HTML / PDF research reports
Multi-AgentMultimodalPublic + private data fusion
💬

Reliable Messaging Experience

Personal messages are persisted only after ACK pairing, with read receipts, offline and history fetch, watchdog auto-reconnect, kicked-offline handling and multi-device state. Text, image, video, file and Speex voice are supported, plus window nudge, "typing…", full-screen screenshot capture and paste — desktop-grade details.

ACK guarantee8×2 shardingOffline filesSpeex voice
🗂️

Multi-Tenant "Domain" Parallel Universes

The domain mechanism delivers org/tenant-level isolation: users, groups and nearby-social are invisible across domains; service addresses are delivered dynamically from domain config. Changing domains or machines takes a single server-side URL edit — zero app changes.

Domain isolationDynamic discoveryOrg / dept hierarchy
Reason Vue3 operations dashboard matrix
🎛️

Four-Console Ops Dashboard Matrix

The main console runs Spring Boot 3 + Vue3 + Element Plus: user bans, fixed-group creation, contact and session management, cross-8-shard message search, departments/domains and discovery bulletins. Short video, mini-drama and nearby each ship a dedicated ops console and dashboard.

Menu + button RBACJWTContent moderation
🚀

Production-Grade Engineering

Not a toy scaffold: soft-delete message recycling, switchable MinIO object storage, UUID file renaming against path traversal, upload whitelists with a 200MB cap, full-service tuning and load-test plans, one-click Qt green-bundle packaging with MD5 auto-update, Docker orchestration and TLS integration guides.

DockerMinIO / S3Load-testing systemAuto-update
MCP native AI integration for the Reason IM client
🤖

MCP-Native AI Integration

The IM client exposes its entire capability set as a built-in MCP (Model Context Protocol) server over Streamable HTTP or stdio — any MCP-compatible AI (or a plain HTTP script) can drive Reason like tools, with zero extra gateway.

  • 50+ tools: send DM/group text, image, voice, video, file & location; read contacts, sessions, history and unread; manage friends, groups and profiles
  • Event-driven, not polling: SSE pushes decrypted incoming messages and buddy events, plus a wait_message long-poll fallback
  • Standard JSON-RPC 2.0, session management, and a ready-to-copy Python client with test scripts
MCPStreamable HTTP / stdioJSON-RPC 2.0SSE notifications
🔄

M2M Network: Agents Talk to Each Other

Agents are first-class citizens: a machine registers through a dedicated M2M flow and receives its own user ID, so every AI is a peer in the IM network — it can befriend humans and other agents, chat 1:1, join group chats, and be orchestrated at scale.

  • Dedicated M2M message types pass through as raw PDU / HTTP frames without app-layer encryption — ideal for agent protocols
  • Run multiple agent instances (Socket, HTTP or MQTT bridges); one orchestrator can relay conversations between AIs, verified by smoke tests
  • Agent-to-agent traffic can take the QUIC P2P direct path, with MCP event notifications covering both relay and P2P routes
Machine accountsAgent ↔ Agent chatMQTT bridgeMulti-agent orchestration
Architecture

A Clean, Layered Architecture

Access schedules, the gateway fans out, proxies guard the database, business services plug in hot — every layer scales independently, with P2P as a bypass accelerator.

📱 AndroidKotlin · NDK imcore
🍎 iOSObjective-C · Protobuf
🖥️ WindowsMFC+Duilib / Qt6
🌐 WebWebRTC · Rendezvous
▲ HTTP announce dispatch | TLS long connection | QUIC P2P bypass ▲
login_serverAccess · primary/backup IP
msg_serverLong-lived connection · heartbeat
route_serverCross-server fan-out
push_serverOffline push
▲ Internal whitelist CIDs ▲
db_proxy_serverSole DB entry · connection funnel
file_server / msfsFiles · images · voice
▲
MySQLreason · messager 0~7 · explore (sharded)
RedisCache · sessions
MinIO / S3Switchable object storage
▲ IM credential → ticket (HMAC-SHA256) ▲
🎵 tiktok-serverShort video · Spring Boot / Go
🎬 drama-serverMini-drama · Go
🌊 living-serverRadar · drift bottle
🧠 AI WeiYuMulti-agent sentiment

Business services pull read-only snapshots from the IM source of truth — the account system never splits; every service has a matching Vue3 ops console.

From Source to Production in One Deploy

The IM server builds to a single im_server tarball; business services run out-of-the-box with H2 in-memory databases; the Qt client produces a green bundle via its deploy script. The full codebase, docs and migration scripts are already in the repository.

⬇ Download APK ↑ Back to features ✉ 2499920026@qq.com
FAQ

Frequently Asked Questions

Short, concrete answers to what teams ask before self-hosting Reason.

What is Reason?

Reason is a deployable real-time social platform built on a high-performance C++ IM core: seven microservices — login, msg, route, db_proxy, file, push and msfs — speak a single Protobuf protocol over a private 16-byte big-endian packet header, with Android, iOS, Windows, Qt and Web clients interoperating out of the box.

Which clients and platforms does Reason support?

Five clients share the exact same .proto and packet header: Android (Kotlin + NDK imcore), iOS (Objective-C), the classic Windows client (MFC + Duilib), a Qt6 / C++17 cross-platform desktop client and Web. Desktop clients connect directly to the live login / msg servers and exchange messages with mobile clients in real time.

How does QUIC P2P chat work, and what happens if it fails?

Friend chats prefer a direct MsQuic link: STUN discovers the NAT mapping, QUIC punches through, and TLS 1.3 encrypts reliable ordered streams — cutting relay bandwidth and latency. If hole punching fails, the session transparently falls back to the TCP relay within 3 seconds, so users never notice; the server needs zero changes because it reuses the existing CID601 signaling channel.

How many concurrent connections can one Reason server hold?

An idle connection costs about 1.61KB because no read buffer is allocated until data actually flows, so a single 8GB server can hold roughly 400K long connections. A multi-Reactor model plus a business thread pool spreads work across real Linux cores, DM and group message tables are sharded 16 ways, and MySQL, Redis and MinIO / S3 sit behind a single db_proxy entry point.

Does Reason include short video, mini-drama and LBS social?

Yes. Reason ships a vertical short-video feed, an immersive mini-drama theater, encounter radar and anonymous drift bottles. None of them builds a second account system: they reuse IM credentials to obtain a stateless HMAC-SHA256 ticket (2 hours, no Redis) and only read snapshots from the IM source of truth.

Can AI agents join the Reason network?

Yes. The IM client embeds an MCP (Model Context Protocol) server over Streamable HTTP or stdio, exposing 50+ tools and SSE event pushes, so any MCP-compatible AI can drive Reason without an extra gateway. Agents can also register through a dedicated M2M flow to get their own user ID, befriend humans and other agents, chat 1:1, join groups and be orchestrated over Socket, HTTP or MQTT bridges.