GitHub
Memory System

Rollout Manager

Simulation and planning ('Imagination') engine for complex decision making.

Storage: Episodic (Stores simulation traces)

Purpose

The Rollout Manager allows the agent to "think before it acts." It simulates multiple future conversation paths (rollouts) to determine the best response strategy before committing to a real answer.

Key Features

  • Monte Carlo Simulation: Generates branching future states for complex queries.
  • Scoring: Evaluates the outcome of branches to pick the optimal path *before* acting content.

Functional Deep Dive

Branching & Simulation

For critical decisions, the manager generates k possible next steps and uses a lightweight model to play out the conversation for n turns.

Scoring & Selection

It evaluates the final state of each branch. The MainOrchestrator then selects the path with the highest success probability and executes it in reality.

Simulation Tree Diagram

API Reference

Rollout Manager provides endpoints for simulation and planning.

MethodEndpointDescription
POST/api/memory/v1/rollouts/simulateSimulate rollout branches
GET/api/memory/v1/rolloutsList rollout simulations
GET/api/memory/v1/rollouts/rollout_idGet rollout simulation
POST/api/memory/v1/rollouts/rollout_id/evaluateEvaluate branch
DELETE/api/memory/v1/rollouts/rollout_idDelete rollout

SDK Reference

The Functor SDK provides a Python interface for rollout operations.

Simulating Rollouts

from functor_sdk import FunctorClient
client = FunctorClient(api_key="your-api-key")
# Simulate rollout branches
rollout = client.memory.rollouts.simulate(
rollout_id="rollout_123",
query="What's the best approach?",
branches=[
{"name": "option_a", "action": "..." },
{"name": "option_b", "action": "..."}
],
depth=3,
user_id="user_456"
)
print(f"Best branch: {rollout['best_branch']}")
# List rollouts
rollouts = client.memory.rollouts.list(
user_id="user_456",
limit=20
)
# Get rollout
rollout = client.memory.rollouts.get(rollout_id="rollout_123")
# Evaluate branch outcome
evaluation = client.memory.rollouts.evaluate_branch(
rollout_id="rollout_123",
branch_name="option_a",
actual_outcome={"success": True}
)
# Delete rollout
client.memory.rollouts.delete(rollout_id="rollout_123")