Skip to content

sunrf-renlab-ai/Relationship-Simulation

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

44 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Relationship Simulation (Pair)

Connect your AI to theirs. Run a relationship simulation. 把你和 ta 的 AI 接到一起,跑一场关系模拟。

Live: https://relationship-simulation-amiz.vercel.app

Status: Deployed on Vercel free tier (Vercel default .vercel.app domain — no custom domain). Open source, MIT-pending.

What this is

Two users each install Pair's CLI daemon on their own machine. The daemon invokes their local Claude Code (with their existing Anthropic auth and local memory directory). Pair's web app orchestrates a 4-stage organic dialog between both users' AIs over WebSocket, then renders an interactive visual report — match radar, future-scene cards, dialog timeline, overall score.

Invariants:

  • No memory upload — memory stays in each user's local Claude Code config
  • Each side spends its own LLM tokens via its own local CLI
  • Pair never holds API keys, never reads memory content
  • Report extraction is server-side static text analysis — zero additional LLM cost
  • Daemon token at rest is AES-GCM encrypted (~/.pair/config.json)

Languages

Web UI ships English (default) + Chinese. Switch via /en and /zh routes. Daemon CLI is English-only (developer tool). Each pairing picks its own simulation language; the agents converse in that language.

Tech Stack

  • Frontend: Next.js 16 App Router on Vercel (Hobby tier)
  • i18n: next-intl with path-based routing (/en/..., /zh/...)
  • Long-running orchestrator: Bun + Hono on Render (Free tier). WebSocket hub for daemon connections, SSE for the frontend.
  • DB + Auth + RLS: Supabase (Free tier)
  • Rate limit + concurrency lock: Upstash Redis (Free tier)
  • Errors: Sentry tunneled at /monitoring
  • AI runtime: Pair's own daemon (Bun-compiled single binary), references Multica's pkg/agent/*.go adapter patterns. Subprocess-spawns the user's local claude CLI.

Architecture

[User A laptop]                                       [User B laptop]
       │                                                       │
[pair daemon CLI] ◄────WebSocket────┐         ┌────WebSocket────► [pair daemon CLI]
       │                            │         │                          │
       │ spawns subprocess          │         │                          │
[local claude CLI w/ memory]        │         │       [local claude CLI w/ memory]
                                    ▼         ▼
                          [Render orchestrator]
                          (Bun + Hono, WS hub +
                          runStagedSimulation)
                                    │
                                    │ SSE
                                    ▼
                          [Vercel: Next.js UI,
                          report rendering]
                                    │
                                    ▼
                          [Supabase: users, pairings,
                          turns, reports]

Repo layout

.
├── docs/superpowers/plans/   # Implementation plans (source of truth)
├── app/[locale]/              # Next.js (Vercel, en/zh routed)
├── i18n/                      # next-intl config
├── messages/                  # en.json + zh.json
├── orchestrator/              # Render service (Bun + Hono)
├── daemon/                    # CLI daemon (Bun-compiled binary)
├── lib/, components/          # Shared
├── supabase/migrations/       # SQL schema
├── render.yaml, Dockerfile    # Render deploy
└── vercel.json                # Vercel cron

Plans

  • docs/superpowers/plans/2026-05-11-v2-self-daemon.mdcurrent
  • docs/superpowers/plans/2026-05-11-v1-multica-connected.md — superseded (planned to call Multica's HTTP API)
  • docs/superpowers/plans/2026-05-11-v0-self-test.md — superseded (local CLI self-test)

Install (daemon — required to use Pair)

curl -fsSL https://relationship-simulation-amiz.vercel.app/install | bash
pair login --paste     # paste a token from /onboard
pair daemon            # stay online

The install script downloads a Bun-compiled binary from GitHub Releases for your OS/arch (darwin-arm64 / darwin-x64 / linux-x64).

Try it

  1. Visit https://relationship-simulation-amiz.vercel.app
  2. Sign in (magic link)
  3. Run the install command above + pair daemon
  4. Create a pairing, share the link with someone
  5. They sign in + install daemon
  6. Click Start → watch the 4-stage simulation → see the report

License

TBD.

About

Resources

Contributing

Stars

Watchers

Forks

Packages

 
 
 

Contributors