What is Portal Mode?
Portal mode implements backward temporal reasoning: you specify a known endpoint (the “portal”) and a known origin, then the system discovers plausible paths that connect them by working backward through time. Think of Portal mode as reverse causality: “Given that X happened in 2031, what chain of decisions in 2026-2030 made X inevitable?”Core insight: Portal mode is for root cause analysis, disaster postmortems, and forensic timelines—scenarios where you know the outcome and need to understand how it came to be.
When to Use Portal Mode
Use Portal mode when:- You know the outcome - A disaster occurred, a verdict was reached, a mission failed
- Root cause analysis - Trace backward to find decision chains that led to the outcome
- Forensic investigation - Reconstruct events leading to a known result
- Strategic postmortems - “How did we lose this deal?” “Why did this product fail?”
- Regulatory analysis - Trace institutional failure back to policy/staffing decisions
Perfect for
- Disaster investigations (Mars mission failure)
- Litigation verdict analysis ($47M judgment—how?)
- Product launch failure postmortems
- Security breach forensics
- Institutional failure analysis
Not ideal for
- Open-ended exploration (use Forward/Branching)
- Multiple endings (use Branching)
- No clear endpoint (use Forward)
- Narrative storytelling (use Directorial)
How Portal Mode Works
Generate Backward Steps
Starting from the portal, the system generates antecedent states at each step:
- What could have happened at T-1 to lead to the portal state?
- Generate N candidates per step (default: 3)
- Use LLM + hybrid scoring to rank plausibility
Score & Filter Paths
Each backward path is scored using:
- LLM plausibility (0.3 weight)
- Historical precedent (0.2 weight)
- Causal necessity (0.3 weight)
- Entity capability (0.2 weight)
coherence_threshold (default: 0.7) are pruned.Forward Validation
To prevent hallucination, Portal mode forward-simulates each backward path:
- Does the path make sense when read forward?
- Can entities actually perform these actions?
- Are knowledge dependencies satisfied?
Architecture
Portal mode is implemented inworkflows/portal_strategy.py:
Key Data Structures
Configuration
Portal Configuration Parameters
Portal Configuration Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
mode | string | required | Must be "portal" |
portal_description | string | required | Description of the endpoint state |
portal_year | int | required | Year of the portal (endpoint) |
origin_year | int | required | Year of the origin (start) |
backward_steps | int | 10 | Number of backward steps to generate |
exploration_mode | string | "adaptive" | "reverse_chronological", "oscillating", "random", "adaptive" |
oscillation_complexity_threshold | int | 10 | If steps > threshold, use oscillating |
candidate_antecedents_per_step | int | 3 | Candidate prior states per step |
path_count | int | 5 | Number of complete paths to return |
coherence_threshold | float | 0.7 | Minimum score for path validation |
llm_scoring_weight | float | 0.3 | Weight for LLM plausibility |
historical_precedent_weight | float | 0.2 | Weight for historical similarity |
causal_necessity_weight | float | 0.3 | Weight for causal linkage |
entity_capability_weight | float | 0.2 | Weight for entity capability |
use_simulation_judging | bool | true | Enable forward validation with judge model |
simulation_forward_steps | int | 1 | Steps to forward-simulate for validation |
judge_model | string | "llama-3.1-405b" | Model for judging path coherence |
Template Examples
Example 1: Ares III Mars Mission Portal
Fromshowcase/mars_mission_portal.json:
- March 2026: Initial life support design decision (simplified system)
- August 2027: Lin Zhang’s anomaly report marked “reviewed” without action
- January 2029: Budget cut forces crew size reduction
- November 2030: Final pre-launch review overrides safety concerns
Example 2: Litigation Verdict Portal
Frompersona/agent3_litigation_portal.json:
Exploration Modes
Portal mode supports multiple exploration strategies:- Reverse Chronological
- Oscillating
- Adaptive
- Random
Standard backward stepping: 100 → 99 → 98 → … → 1
- Simplest approach
- Good for linear cause-effect chains
- Default for
backward_steps <= 10
Hybrid Scoring System
Portal paths are scored using a weighted hybrid approach:Pivot Point Detection
Portal mode automatically detects critical decision moments where paths diverge:Best Practices
1. Write Specific Portal Descriptions
1. Write Specific Portal Descriptions
The portal description anchors the entire backward search. Be concrete:Good:
“Ares III loses contact during orbital insertion on March 15, 2031 at 14:23 UTC. Last telemetry shows O2 generator failure cascading to comms blackout. All 4 crew presumed lost.”Bad:
“The Mars mission failed.”
2. Use Entity Roster to Anchor Characters
2. Use Entity Roster to Anchor Characters
Portal mode works best when you pre-define key entities:This prevents entity hallucination and grounds the narrative in specific people.
3. Enable Simulation Judging for Critical Scenarios
3. Enable Simulation Judging for Critical Scenarios
For high-stakes analysis (legal, disaster investigation), enable forward validation:This uses a large judge model to forward-simulate each path and verify coherence.
4. Tune Coherence Threshold
4. Tune Coherence Threshold
- Exploratory postmortems:
0.65(permissive, more paths) - Standard analysis:
0.70(balanced) - Legal/regulatory:
0.75(strict, fewer but higher-quality paths)
5. Request Multiple Paths
5. Request Multiple Paths
Set
path_count: 5 or higher to explore multiple failure modes:- Path 1: Schedule pressure overrode safety concerns
- Path 2: Budget cuts eliminated redundancy
- Path 3: Personnel conflict prevented escalation
- Path 4: Technical debt accumulated unnoticed
- Path 5: Regulatory oversight gaps
Cost Estimates
Quick
0.153-4 entities5 backward steps3-5 min
Standard
0.504-6 entities8-10 steps10-15 min
Comprehensive
1.006-8 entities10-15 steps15-25 min
Portal mode is more expensive than Forward because it explores multiple candidate antecedents per step and runs forward validation.
Running Portal Mode
Related Mechanisms
Portal mode commonly pairs with:- M3 (Exposure Events) - Track when entities learned critical information
- M7 (Causal Chains) - Validate backward→forward causality
- M11 (Dialog Synthesis) - Generate conversations at pivot points
- M13 (Relationship Evolution) - Track trust erosion over time
- M17 (Modal Causality) - Portal-specific validation rules
Next Steps
- Forward Mode - Default forward causality
- Branching Mode - Counterfactual timelines
- Template Catalog - Browse all 21+ templates

