Primitives
Worlds, events, Fold, Navigate, context, predictions, actions, and objectives.
Spacefolder exposes two operations: Fold records what happened; Navigate asks what could happen next. A World connects their event history and learned state. Context, predictions, actions, and objectives describe a Navigate request.
World
A World holds your application’s event history and learned state. Use its world_id in every Fold and Navigate request. World API reference
Fold
Fold records events in a World. Reuse the same event ID when retrying so each event is counted once. Fold API reference
Event
An event records an observation, an action that was taken, or an outcome that was measured. It describes something that happened, with a stable ID and timestamp.
{
"id": "view-001",
"name": "movie_viewed",
"source": "player",
"timestamp": "2026-11-11T12:00:00Z",
"entity_id": "user_123",
"entity_type": "user",
"data": {"movie_id": "movie_456"}
}
| Field | Meaning |
|---|---|
id |
Stable event identity. Reuse it when retrying the same event. |
name |
What happened, such as movie_viewed or movie_watched. Keep names consistent across ingestion and predictions. |
source |
Optional name of the system that produced this event. |
timestamp |
When it happened. Use an RFC 3339 timestamp with a timezone. |
entity_id, entity_type |
Optional identifiers for the entity the event concerns. |
data |
Application-specific JSON data, such as a movie ID or measured latency. |
A proposed action in a Navigate request becomes an observed event only after your application takes it and sends the corresponding event through Fold.
Navigate
Navigate uses a World’s history and the current context to forecast an outcome or compare possible actions. Navigate API reference
Context
context is a required object for information you know when you call Navigate, such as {"screen": "movie_details", "movie_id": "movie_456"}. Choose the keys your application uses. Pass {} when you have nothing to add.
Prediction
A prediction names the outcome you want to estimate and how far ahead to look. Give each prediction a label, such as watch or revenue. Navigate uses that label in the response.
| Question | Prediction |
|---|---|
| Will the shopper place an order within a day? | {"event": "order.placed", "horizon": "1d"} |
| What revenue reading should we expect tomorrow? | {"event": "revenue.data.value", "horizon": "1d"} |
| What will daily sales total over the next week? | {"event": "sale.data.amount", "aggregation": "sum", "interval": "1d", "horizon": "7d"} |
Use the folded event name to predict its probability with or without a proposed action. Without actions, Navigate finds earlier occurrences of the entity’s latest event among entities of the same type. It compares non-overlapping windows at the same delay and horizon. Fold an observation.coverage receipt with data.event and data.complete_through to mark a historical window complete. For example, two covered product views followed by two orders give a smoothed probability of 75%. The calculation is (windows with an order + 1) / (covered windows + 2). If no comparable window is covered, Navigate returns insufficient_event_history.
Append .data. and a numeric field path to predict a reading, with or without actions. For example, sale.data.amount reads data.amount from each sale event. For standalone readings, fold one untagged series per entity with consistent units and a reading in each of the two most recent intervals.
horizon sets how far ahead to predict. A single interval returns value. Set interval shorter than horizon to get timestamped points, as in the weekly sales example with seven daily totals. Both fields accept durations such as 30s, 15m, 1h or 7d, up to 366 days.
aggregation combines numeric readings within each interval. For two sales of 10 and 20, the default mean gives 15, sum gives 30, min gives 10 and max gives 20. Supply unit if you want to label the units used in Fold.
The Navigate API reference also documents explicit event and field syntax, including literal event names containing .data.. The current model supports named event probabilities and numeric readings. The contract also defines next-event distributions and event counts for future model support.
Action
An action is a choice you want Navigate to evaluate, such as keeping the standard price or running a promotion. Fold the action your application takes. Weekly revenue example
Objective
An objective names the prediction to maximize or minimize. For example, maximize revenue when comparing pricing actions.
Confidence
Confidence is a 0–1 score for how strongly comparable World observations support a forecast. A score of 0 means zero support. A missing or null score means confidence is unavailable.
Verification
Fold the observed outcome, any action taken, and an observation.coverage receipt when reporting is complete. After the check, call navigation(run_id) in either SDK and read the measured revenue from verification.revenue.value. For events, verification returns 1 for an observed occurrence or 0 for a confirmed absence. SDK methods