How oranai-ltd/oransim works
Oransim is a causal marketing-campaign simulator: teams define a campaign scenario, simulate audience exposure and consumer response, and inspect predicted KPIs or counterfactual outcomes. The documented use cases include pre-launch ROI ranking, mid-campaign interventions, and post-mortem comparisons. The graph highlights the API workflow and major modeling subsystems; some links are based on README descriptions because their implementation files were not excerpted.
Main entry points: predict.py Prediction API · api_state.py Runtime bootstrap · engine.py Scenario sandbox · platforms Platform adapters
Components 20
Scenario API
- Prediction API
backend/oransim/api_routers/predict.py - Runtime bootstrap
backend/oransim/api_state.py - Scenario sandbox
backend/oransim/sandbox/engine.py - KPIs and traces
backend/oransim/api_routers/predict.py
Campaign Simulation
- Platform exposure model
backend/oransim/platforms/xhs/world_model_legacy.py - Platform adapters
backend/oransim/platforms - Recommendation simulation
backend/oransim/platforms/xhs/recsys_rl.py - Campaign dynamics
backend/oransim/diffusion/legacy_hawkes.py - Embedding bus
backend/oransim/runtime/embedding_bus.py - Real embedder
backend/oransim/runtime/real_embedder.py
Causal Analysis
- Structural causal model
backend/oransim/causal/scm.py - Counterfactual engine
backend/oransim/causal/counterfactual.py
Consumer Agents
- Consumer response
backend/oransim/agents/statistical.py - Persona agents
backend/oransim/agents/soul.py - LLM persona responses
backend/oransim/agents/soul_llm.py - LLM providers
backend/oransim/agents/llm_providers
Simulation Inputs
- Virtual population
backend/oransim/data/population.py - Creative and KOL data
backend/oransim/data/creatives.py - Platform configuration
backend/oransim/data/platforms.py
Other components
- Growth team
Connections 21
- Growth team → Prediction API: submits scenario
- Prediction API → Runtime bootstrap: uses runtime
backend/oransim/api_routers/predict.py - Runtime bootstrap → Virtual population: generates
backend/oransim/api_state.py - Runtime bootstrap → Scenario sandbox: initializes
backend/oransim/api_state.py - Prediction API → Platform configuration: uses platform data
backend/oransim/api_routers/predict.py - Prediction API → Platform exposure model: simulates exposure
backend/oransim/api_routers/predict.py - Prediction API → Recommendation simulation: uses recommendation model
backend/oransim/api_routers/predict.py - Prediction API → Campaign dynamics: runs lifecycle
backend/oransim/api_routers/predict.py - Prediction API → Structural causal model: runs causal graph
backend/oransim/api_routers/predict.py - Prediction API → Consumer response: simulates responses
backend/oransim/api_routers/predict.py - Prediction API → Persona agents: uses persona agents
backend/oransim/api_routers/predict.py - Prediction API → LLM persona responses: optionally simulates discourse
backend/oransim/api_routers/predict.py - LLM persona responses → LLM providers: routes generation
backend/oransim/agents/soul_llm.py - Prediction API → Counterfactual engine: supports interventions
- Scenario sandbox → Counterfactual engine: recomputes scenarios
backend/oransim/sandbox/engine.py - Prediction API → KPIs and traces: returns KPIs
backend/oransim/api_routers/predict.py - Prediction API → Creative and KOL data: uses creative and KOL inputs
backend/oransim/api_routers/predict.py - Platform adapters → Platform exposure model: implements platform behavior
backend/oransim/platforms/xhs/recsys_rl.py - Runtime bootstrap → Embedding bus: indexes simulation data
backend/oransim/api_state.py - Embedding bus → Real embedder: supports real embeddings
backend/oransim/runtime/embedding_bus.py - Prediction API → Platform adapters: supports multiple platforms
backend/oransim/api_routers/predict.py