Skip to content

feat: TikTok/Douyin ecosystem simulation (short video, livestream, e-commerce) #476

@akz142857

Description

@akz142857

Summary

I'd like to propose adding TikTok/Douyin ecosystem simulation support to MiroFish. This would extend the current Twitter and Reddit platforms with short video feed, livestream, and e-commerce conversion simulation — making MiroFish the first open-source framework capable of simulating TikTok-style social commerce.

Motivation

  • TikTok/Douyin is the world's largest short-video platform (7-8B DAU), but no open-source simulation framework exists for its ecosystem
  • MiroFish's vision is "Predicting Anything" — TikTok's content virality + livestream commerce is one of the most commercially valuable scenarios to simulate
  • The existing OASIS architecture (Platform abstraction + ActionType + AgentGraph) provides a solid foundation for extension
  • Use cases: brand launch rehearsal, KOL campaign simulation, content strategy testing, e-commerce funnel optimization

Proposed Design

Three-Phase Implementation

Phase 1 — Short Video Feed Simulation

  • TikTok agent profile format (role: viewer / creator / streamer / merchant)
  • Video content model (abstracted as attribute vectors, not actual video)
  • Traffic Pool Racing algorithm (流量池赛马): 7-level traffic pools with relative ranking promotion/demotion
  • Custom recommendation system: 70% interest-based + 15% following + 10% explore + 5% livestream
  • Feed action space: create_video, watch_video, like, comment, share, follow, duet, stitch, not_interested, scroll_feed
  • 3-second attention window simulation for completion rate modeling
  • Content lifecycle with time decay (72h half-life) and re-distribution triggers

Phase 2 — Livestream Simulation

  • Livestream room model with real-time multi-agent co-presence
  • Streamer agent decision chain (product showcase, audience interaction, flash sales, urgency tactics)
  • Viewer behavior: enter/exit, bullet comments, gifts, product clicks
  • Livestream traffic scoring (stay duration, interaction rate, viewer growth, GPM)

Phase 3 — E-Commerce Closed Loop

  • Product and Order data models
  • Dual conversion funnels: short video shopping cart + livestream commerce
  • Agent purchase decision model (price sensitivity, impulse buying, herd effect)
  • Key metrics output: GPM, CVR, UV value, average order value, return rate

Technical Approach

  • No OASIS fork required: Use custom Platform subclass, keeping compatibility with upstream upgrades
  • MiroFish changes: ~6 modified files + ~6 new files
    • config.py — add OASIS_TIKTOK_ACTIONS
    • oasis_profile_generator.py — add to_tiktok_format()
    • simulation_config_generator.py — TikTok platform config generation
    • simulation_manager.py — add TIKTOK to PlatformType enum
    • simulation_runner.py — support TikTok simulation script
    • api/simulation.pyenable_tiktok parameter
    • New: run_tiktok_simulation.py, tiktok_platform.py, tiktok_recsys.py, tiktok_commerce.py, tiktok_livestream.py
  • Frontend: New TikTokDashboard.vue for traffic pool visualization and e-commerce metrics

Key Differences from Twitter/Reddit

Dimension Twitter/Reddit TikTok (proposed)
Content Text-based Short video (attribute vectors)
Recommendation Social graph / vote score Algorithm-driven traffic pool racing
Lifecycle Persistent 24-72h window + re-distribution
Interactions Retweet/vote/comment Like/comment/share/duet/stitch/purchase/gift
Commerce None Livestream commerce + video shopping cart
User roles Uniform Viewer / Creator / Streamer / Merchant

Contribution Plan

I've forked the repo at akz142857/MiroFish and have a detailed technical plan ready. I'd like to:

  1. Submit PRs incrementally (Phase 1 → 2 → 3), not as one massive PR
  2. Each PR will be self-contained and independently testable
  3. Happy to adjust the design based on maintainer feedback before coding

I'd also consider contributing the core TikTokPlatform and TikTokRecsys upstream to camel-ai/oasis if that's preferred.

Questions for Maintainers

  1. Does this direction align with MiroFish's roadmap?
  2. Any preference on the Platform extension approach (custom subclass vs. OASIS upstream)?
  3. Should I also propose a Platform Registry / adapter pattern to make future platform additions easier?

Looking forward to your feedback!

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions