# Spacefolder > Fold all your data. Navigate what’s next. # Introduction Source: https://www.spacefolder.com/docs Spacefolder helps developers make predictions from their data on demand, without training a separate model for each question. To learn more about our model, see [**Large Adaptive World Model (LAWM)**](/docs/concepts/large-adaptive-world-model). ## Fold  [Fold](/docs/concepts/primitives#fold) learns from events across your sources: analytics, coding agents, telemetry, observability, payments, and more. This small model runs close to your data. It compares metrics before and after an event and encodes that change in latent space to update your world state. ## Navigate  [Navigate](/docs/concepts/primitives#navigate) combines learned world state with the current user or task context to predict the outcome of each possible action. It ranks actions by the outcomes you want to maximize or minimize. In the example above, preloading ranks first because it has the lowest predicted startup latency at the chosen horizon. ## Integrations - [Eve agent framework](/docs/integrations/eve) — use feedback to personalize responses and learn which actions work for each task. ## Start building - [Get API key on Spacefolder platform](https://platform.spacefolder.com/api-keys) to connect your application. - [Get started](/docs/get-started) to create a World, fold events, and compare actions. - [Primitives](/docs/concepts/primitives) to understand Worlds, events, context, predictions, actions, and objectives. - [Benchmarks](/docs/benchmarks) to compare agent navigations and see the TypeScript SDK examples behind them. - [Reference](/docs/reference) for the SDKs, HTTP API, and CLI. --- # Benchmarks Source: https://www.spacefolder.com/docs/benchmarks ## Navigation on generated histories These runs use generated event histories and known outcome probabilities. Columns count prior navigations per World. Scores measure expected utility from 0 (worst action) to 100 (best) on the same held-out cases. | Category | Agent navigation | 0 | 10 | 100 | 1,000 | | --- | --- | ---: | ---: | ---: | ---: | | Coding | [Recover a failed migration](/docs/benchmarks/coding) | 48.96 | 50.61 | 94.91 | **100.00** | | Tool calling | [Recover an inventory lookup](/docs/benchmarks/tools) | 25.24 | 49.67 | 91.72 | **100.00** | | Personal assistant | [Time a personal reminder](/docs/benchmarks/personal) | 30.00 | 66.50 | 83.33 | **100.00** | | Retention | [Choose a retention offer](/docs/benchmarks/retention) | 11.05 | 74.88 | 86.48 | **100.00** | | Fraud | [Intervene at checkout](/docs/benchmarks/fraud) | 52.08 | 26.15 | 60.28 | **100.00** | | Shopping | [Recommend a seller](/docs/benchmarks/fulfillment) | 67.71 | 52.08 | 52.08 | **100.00** | | Streaming | [Configure video playback](/docs/benchmarks/movies) | 46.21 | 68.75 | 81.25 | **98.13** | | Robotics | [Correct a robot placement](/docs/benchmarks/robotics) | 0.00 | 35.98 | 96.17 | **98.25** | | Video capture | [Recover a blurred capture](/docs/benchmarks/capture) | 84.15 | 75.32 | 94.01 | **97.43** | | Publishing | [Choose a publishing format](/docs/benchmarks/publishing) | 54.42 | 33.60 | 80.88 | **100.00** | At 1,000 navigations, 7 of 10 categories scored 100. Each World repeats two stable situations. A baseline using past outcomes for the same situation matched Spacefolder’s pick in 60 of 60 World–situation pairs. ## Performance on public industry datasets | Dataset | Folded events | Navigation results | | --- | --- | --- | | [ZOZO Open Bandit Dataset](/docs/benchmarks/shopping) | Item impressions, display probabilities and clicks. | **Estimated clicks per 1,000 impressions ↑** · Spacefolder 22.53, cached popularity 22.53, specialist recommender 16.89 on 30,188 held-out impressions. | | [UCI Bike Sharing](/docs/benchmarks/capacity) | Completed rentals per day. | **Mean absolute capacity error in rentals per day ↓** · Spacefolder 2,135.21, SQL 2,128.22, earlier model 2,133.53, fixed capacity 2,099.45 over 92 days. | ## Agent frameworks | Benchmark | Framework | Spacefolder impact | | --- | --- | --- | | [Coding agent](/docs/benchmarks/eve-coding-agent) | [Eve (Vercel)](/docs/integrations/eve) | On synthetic symptom-only bugs, Eve reached useful evidence about **4× faster** with a nearly **3× reduction in tokens**. | --- # UCI Bike Sharing Source: https://www.spacefolder.com/docs/benchmarks/capacity Over 92 days, mean absolute capacity error was **2,135.21 rentals/day** for Spacefolder, **2,133.53** for the earlier model, **2,128.22** for yesterday’s demand in SQL and **2,099.45** for fixed capacity. Lower is better.  Spacefolder and SQL chose different capacity on three days. Spacefolder added 489 and 581 units of error on October 4 and 12, and saved 427 on October 25. The replay reserved 1,000 extra units when predicted demand exceeded 7,572.5 rentals. All 92 Spacefolder forecasts were checked against the next day’s count. **About the dataset** Capital Bikeshare recorded completed rentals in 2011–2012. UCI provides hourly and daily totals. This replay uses daily totals to evaluate next-day capacity plans. [Explore the UCI dataset](https://archive.ics.uci.edu/dataset/275/bike+sharing+dataset) --- # Recover a blurred capture Source: https://www.spacefolder.com/docs/benchmarks/capture **KPI** · Usable footage probability minus blur probability.  ## After 1,000 navigations per World Spacefolder chose the highest-value action on **68 of 96** held-out navigations. | Approach | Expected utility | Score / 100 | | --- | ---: | ---: | | Spacefolder | 0.517 | 97.43 | | Vector search + SQL for matching situations¹ | 0.517 | 97.43 | | SQL for all situations¹ | 0.446 | 88.82 | | First listed action | -0.311 | 0.00 | | Ground truth | 0.538 | 100.00 | ¹ Stack analogies. The replay averaged each action’s outcomes in memory, grouping by exact situation for the first baseline and pooling all situations for the second. ## TypeScript SDK example [TypeScript SDK](/docs/reference/sdks#typescript-and-javascript) · [Navigate API](/docs/reference/api/navigate/navigate) ```ts import { SpacefolderClient } from "@spacefolder/sdk"; const sf = new SpacefolderClient(); const navigation = await sf.navigate({ nav_id: crypto.randomUUID(), world_id: "capture_example", entity_type: "demonstration_segment", entity_id: "demo-segment-018", context: { scene: "Fast hand motion under bright task lighting" }, actions: { no_action: {"name": "decision.configuration_retained", "data": {}}, shorter_exposure: {"name": "capture.configuration_set", "data": {"camera_id": "head-camera", "exposure_us": 2000, "frame_rate_hz": 60, "stabilization_enabled": false}}, stabilize_capture: {"name": "capture.configuration_set", "data": {"camera_id": "head-camera", "exposure_us": 4000, "frame_rate_hz": 60, "stabilization_enabled": true}}, repeat_slower: {"name": "capture.operator_prompted", "data": {"prompt_id": "repeat-motion-slower", "segment_id": "demo-segment-018"}}, }, predictions: { usable: {"event": "demonstration.segment_accepted", "horizon": "10s"}, blur: {"event": "capture.motion_blur_detected", "horizon": "10s"}, }, }); let chosen: string | undefined; let best = -Infinity; for (const action of ["no_action", "shorter_exposure", "stabilize_capture", "repeat_slower"] as const) { const usable = navigation.actions?.[action]?.predictions.usable; if (!usable || !("probability" in usable) || typeof usable.probability !== "number") continue; const blur = navigation.actions?.[action]?.predictions.blur; if (!blur || !("probability" in blur) || typeof blur.probability !== "number") continue; const utility = usable.probability - blur.probability; if (utility > best) { best = utility; chosen = action; } } console.log(JSON.stringify({ chosen }, null, 2)); ``` ## Example output **Fast hand motion under bright task lighting** ```json { "chosen": "repeat_slower" } ``` Apply the chosen capture setting to the segment, then record usability and blur from that segment's quality checks. --- # Recover a failed migration Source: https://www.spacefolder.com/docs/benchmarks/coding **KPI** · Probability of completing the task within five minutes.  ## After 1,000 navigations per World Spacefolder chose the highest-value action on **96 of 96** held-out navigations. | Approach | Expected utility | Score / 100 | | --- | ---: | ---: | | Spacefolder | 0.609 | 100.00 | | Vector search + SQL for matching situations¹ | 0.609 | 100.00 | | SQL for all situations¹ | 0.506 | 61.18 | | First listed action | 0.370 | 48.96 | | Ground truth | 0.609 | 100.00 | ¹ Stack analogies. The replay averaged each action’s outcomes in memory, grouping by exact situation for the first baseline and pooling all situations for the second. ## TypeScript SDK example [TypeScript SDK](/docs/reference/sdks#typescript-and-javascript) · [Navigate API](/docs/reference/api/navigate/navigate) ```ts import { SpacefolderClient } from "@spacefolder/sdk"; const sf = new SpacefolderClient(); const navigation = await sf.navigate({ nav_id: crypto.randomUUID(), world_id: "coding_example", entity_type: "task_revision", entity_id: "migration-schema", context: { scene: "Transient database connection failure" }, actions: { retry: {"name": "agent.retry", "data": {"scope": "migration"}}, search: {"name": "agent.search", "data": {"scope": "migration_and_schema"}}, replan: {"name": "agent.replan", "data": {"strategy": "inspect_schema_then_patch"}}, }, predictions: { success_rate: {"event": "task.completed", "horizon": "5m"}, }, }); let chosen: string | undefined; let best = -Infinity; for (const action of ["retry", "search", "replan"] as const) { const success_rate = navigation.actions?.[action]?.predictions.success_rate; if (!success_rate || !("probability" in success_rate) || typeof success_rate.probability !== "number") continue; const utility = success_rate.probability; if (utility > best) { best = utility; chosen = action; } } console.log(JSON.stringify({ chosen }, null, 2)); ``` ## Example output **Transient database connection failure** ```json { "chosen": "retry" } ``` Run the selected retry, schema search or replan on the failed revision. Record task completion against that revision before the five-minute deadline. --- # Eve coding agent Source: https://www.spacefolder.com/docs/benchmarks/eve-coding-agent  | Scenario | Speed | Time | Usage | Tokens | | --- | ---: | ---: | ---: | ---: | | pandas CI | **1.29× faster** | 148.6 → 115.0 s | **1.95× reduction** | 9,950 → 5,104 | | xarray CI | **3.30× faster** | 128.5 → 38.9 s | **1.61× reduction** | 3,297 → 2,043 | | Symptom-only diagnosis | **4.41× faster** | 31.4 → 7.1 s | **2.89× reduction** | 930 → 322 | ## Token usage gains On synthetic symptom-only bugs, Spacefolder cut token usage through first useful evidence by **65% (a 2.89× reduction)**. The pandas queue saw the largest end-to-end saving, with **49% fewer tokens** for the same verified diagnoses. On xarray, Eve saved model calls by going straight to verification when a known failure recurred. It still checked the current log before reusing the diagnosis. ## Speed gains On synthetic symptom-only bugs, Eve reached useful evidence **4.41× faster** with Spacefolder. Qwen usually searched the repository first. Spacefolder had learned that reproducing the failure often exposed the failing assertion, so Eve tried that earlier. Later repair attempts used more tokens. On real CI jobs, the largest speedup was **3.30×** for the single-worker xarray queue, with the same jobs verified. ## Methodology We compared the same Eve agent and Qwen2.5 3B model with and without guidance learned from earlier jobs. - **pandas CI.** Three workers investigated a mix of real GitHub Actions failures. For familiar typing failures, Spacefolder could route Eve directly to the type checker. Both agents verified the same jobs on the charted queue. On a harder queue where summaries lacked enough evidence, a fixed rule based on the failed step was faster and verified one more job than Spacefolder. - **xarray CI.** One worker investigated real failures across several pull requests, including a recurring Iris conversion error. When workers investigated jobs in parallel, Eve used fewer tokens with Spacefolder and verified the same jobs as Qwen alone. - **Symptom-only diagnosis.** We ran ten synthetic JavaScript bugs three times each with a generic CI failure message. Eve chose the first tool in both versions. With Spacefolder, it received a suggestion based on earlier tool outcomes. CI results are totals for a single queue replay. Synthetic results are averages per attempt through first useful evidence, with misses included. For evaluating whether a code change fixes a reported issue and passes the repository’s tests, see the [SWE-bench Verified dataset](https://huggingface.co/datasets/princeton-nlp/SWE-bench_Verified/tree/c104f840cc67f8b6eec6f759ebc8b2693d585d4a) **About the framework** Eve is Vercel’s TypeScript framework for durable agents. The Spacefolder extension lets an Eve agent record which tool it used and what happened, then use that experience to choose an investigation on a later job. [Official Eve documentation](https://eve.dev/docs/getting-started) · [Eve agent framework](/docs/integrations/eve) --- # Intervene at checkout Source: https://www.spacefolder.com/docs/benchmarks/fraud **KPI** · Expected dollars per checkout ($30 per timely payment, minus $180 per reported fraud and $0/$0.50/$3 for continue/verify/review).  ## After 1,000 navigations per World Spacefolder chose the highest-value action on **96 of 96** held-out navigations. | Approach | Expected utility | Score / 100 | | --- | ---: | ---: | | Spacefolder | 12.978 | 100.00 | | Vector search + SQL for matching situations¹ | 12.978 | 100.00 | | SQL for all situations¹ | 10.434 | 82.81 | | First listed action | 7.352 | 52.08 | | Ground truth | 12.978 | 100.00 | ¹ Stack analogies. The replay averaged each action’s outcomes in memory, grouping by exact situation for the first baseline and pooling all situations for the second. ## TypeScript SDK example [TypeScript SDK](/docs/reference/sdks#typescript-and-javascript) · [Navigate API](/docs/reference/api/navigate/navigate) ```ts import { SpacefolderClient } from "@spacefolder/sdk"; const sf = new SpacefolderClient(); const navigation = await sf.navigate({ nav_id: crypto.randomUUID(), world_id: "checkout_example", entity_type: "shopping_order", entity_id: "shopper-trip:checkout-verification", context: { scene: "Returning customer on a recognized device" }, actions: { continue_checkout: {"name": "checkout.payment_submitted", "data": {"provider": "stripe"}}, request_verification: {"name": "checkout.verification_requested", "data": {"method": "existing_account_auth"}}, pause_review: {"name": "checkout.review_requested", "data": {"queue": "merchant"}}, }, predictions: { paid: {"event": "payment_intent.succeeded", "horizon": "5m"}, fraud_reported: {"event": "checkout.fraud_reported", "horizon": "120d"}, }, }); const cost = { continue_checkout: 0, request_verification: 0.50, pause_review: 3 }; let chosen: string | undefined; let best = -Infinity; for (const action of ["continue_checkout", "request_verification", "pause_review"] as const) { const paid = navigation.actions?.[action]?.predictions.paid; if (!paid || !("probability" in paid) || typeof paid.probability !== "number") continue; const fraud_reported = navigation.actions?.[action]?.predictions.fraud_reported; if (!fraud_reported || !("probability" in fraud_reported) || typeof fraud_reported.probability !== "number") continue; const utility = 30 * paid.probability - 180 * fraud_reported.probability - cost[action]; if (utility > best) { best = utility; chosen = action; } } console.log(JSON.stringify({ chosen }, null, 2)); ``` ## Example output **Returning customer on a recognized device** ```json { "chosen": "continue_checkout" } ``` Submit the selected checkout intervention once. Observe five-minute payment completion and allow 120 days for fraud reports before closing the trial. --- # Recommend a seller Source: https://www.spacefolder.com/docs/benchmarks/fulfillment **KPI** · Purchase probability plus on-time fulfillment probability.  ## After 1,000 navigations per World Spacefolder chose the highest-value action on **96 of 96** held-out navigations. | Approach | Expected utility | Score / 100 | | --- | ---: | ---: | | Spacefolder | 1.053 | 100.00 | | Vector search + SQL for matching situations¹ | 1.053 | 100.00 | | SQL for all situations¹ | 1.002 | 67.71 | | First listed action | 0.730 | 32.29 | | Ground truth | 1.053 | 100.00 | ¹ Stack analogies. The replay averaged each action’s outcomes in memory, grouping by exact situation for the first baseline and pooling all situations for the second. ## TypeScript SDK example [TypeScript SDK](/docs/reference/sdks#typescript-and-javascript) · [Navigate API](/docs/reference/api/navigate/navigate) ```ts import { SpacefolderClient } from "@spacefolder/sdk"; const sf = new SpacefolderClient(); const navigation = await sf.navigate({ nav_id: crypto.randomUUID(), world_id: "shopping_example", entity_type: "shopping_order", entity_id: "shopper-trip:headphone-order", context: { scene: "Urban delivery with a flexible budget" }, actions: { sound_direct: {"name": "shopping.offer_recommended", "data": {"seller_id": "sound_direct", "sku": "headphones"}}, city_audio: {"name": "shopping.offer_recommended", "data": {"seller_id": "city_audio", "sku": "headphones"}}, }, predictions: { purchased: {"event": "order.placed", "horizon": "1h"}, on_time: {"event": "delivery.on_time", "horizon": "2d"}, }, }); let chosen: string | undefined; let best = -Infinity; for (const action of ["sound_direct", "city_audio"] as const) { const purchased = navigation.actions?.[action]?.predictions.purchased; if (!purchased || !("probability" in purchased) || typeof purchased.probability !== "number") continue; const on_time = navigation.actions?.[action]?.predictions.on_time; if (!on_time || !("probability" in on_time) || typeof on_time.probability !== "number") continue; const utility = purchased.probability + on_time.probability; if (utility > best) { best = utility; chosen = action; } } console.log(JSON.stringify({ chosen }, null, 2)); ``` ## Example output **Urban delivery with a flexible budget** ```json { "chosen": "sound_direct" } ``` Recommend the selected seller and record the actual purchase and on-time fulfillment against that order. Keep orders with incomplete delivery coverage unresolved. --- # Configure video playback Source: https://www.spacefolder.com/docs/benchmarks/movies **KPI** · Watch probability plus purchase probability.  ## After 1,000 navigations per World Spacefolder chose the highest-value action on **82 of 96** held-out navigations. | Approach | Expected utility | Score / 100 | | --- | ---: | ---: | | Spacefolder | 0.792 | 98.13 | | Vector search + SQL for matching situations¹ | 0.792 | 98.13 | | SQL for all situations¹ | 0.767 | 79.38 | | First listed action | 0.506 | 3.68 | | Ground truth | 0.792 | 100.00 | ¹ Stack analogies. The replay averaged each action’s outcomes in memory, grouping by exact situation for the first baseline and pooling all situations for the second. ## TypeScript SDK example [TypeScript SDK](/docs/reference/sdks#typescript-and-javascript) · [Navigate API](/docs/reference/api/navigate/navigate) ```ts import { SpacefolderClient } from "@spacefolder/sdk"; const sf = new SpacefolderClient(); const navigation = await sf.navigate({ nav_id: crypto.randomUUID(), world_id: "movies_example", entity_type: "viewer_session", entity_id: "user_123", context: { scene: "Returning viewer on a living-room TV" }, actions: { no_action: {"name": "decision.configuration_retained", "data": {}}, enable_autoplay: {"name": "experience.trailer_autoplay_set", "data": {"enabled": 1}}, enable_preload: {"name": "experience.player_preload_set", "data": {"enabled": 1}}, }, predictions: { watch: {"event": "movie_watched", "horizon": "1h"}, purchase: {"event": "movie_purchased", "horizon": "1h"}, }, }); let chosen: string | undefined; let best = -Infinity; for (const action of ["no_action", "enable_autoplay", "enable_preload"] as const) { const watch = navigation.actions?.[action]?.predictions.watch; if (!watch || !("probability" in watch) || typeof watch.probability !== "number") continue; const purchase = navigation.actions?.[action]?.predictions.purchase; if (!purchase || !("probability" in purchase) || typeof purchase.probability !== "number") continue; const utility = watch.probability + purchase.probability; if (utility > best) { best = utility; chosen = action; } } console.log(JSON.stringify({ chosen }, null, 2)); ``` ## Example output **Returning viewer on a living-room TV** ```json { "chosen": "enable_preload" } ``` Apply the chosen player configuration for the viewer session. Record subsequent watch and purchase events against the same session. --- # Time a personal reminder Source: https://www.spacefolder.com/docs/benchmarks/personal **KPI** · Probability of same-day completion minus interruption cost (0.10 now, 0.02 digest, zero silent).  ## After 1,000 navigations per World Spacefolder chose the highest-value action on **96 of 96** held-out navigations. | Approach | Expected utility | Score / 100 | | --- | ---: | ---: | | Spacefolder | 0.838 | 100.00 | | Vector search + SQL for matching situations¹ | 0.838 | 100.00 | | SQL for all situations¹ | 0.737 | 69.71 | | First listed action | 0.618 | 44.79 | | Ground truth | 0.838 | 100.00 | ¹ Stack analogies. The replay averaged each action’s outcomes in memory, grouping by exact situation for the first baseline and pooling all situations for the second. ## TypeScript SDK example [TypeScript SDK](/docs/reference/sdks#typescript-and-javascript) · [Navigate API](/docs/reference/api/navigate/navigate) ```ts import { SpacefolderClient } from "@spacefolder/sdk"; const sf = new SpacefolderClient(); const navigation = await sf.navigate({ nav_id: crypto.randomUUID(), world_id: "personal_example", entity_type: "task_attempt", entity_id: "personal-001", context: { scene: "In focus time; digest before deadline" }, actions: { notify_now: {"name": "personal.action", "data": {"choice": "notify_now"}}, digest: {"name": "personal.action", "data": {"choice": "digest"}}, silent: {"name": "personal.action", "data": {"choice": "silent"}}, }, predictions: { completed: {"event": "task.completed", "horizon": "1d"}, }, }); const cost = { notify_now: 0.10, digest: 0.02, silent: 0 }; let chosen: string | undefined; let best = -Infinity; for (const action of ["notify_now", "digest", "silent"] as const) { const completed = navigation.actions?.[action]?.predictions.completed; if (!completed || !("probability" in completed) || typeof completed.probability !== "number") continue; const utility = completed.probability - cost[action]; if (utility > best) { best = utility; chosen = action; } } console.log(JSON.stringify({ chosen }, null, 2)); ``` ## Example output **In focus time; digest before deadline** ```json { "chosen": "digest" } ``` Honor the user's permitted notification windows. Record the selected delivery or silence and follow the task through its one-day completion window. --- # Choose a publishing format Source: https://www.spacefolder.com/docs/benchmarks/publishing **KPI** · Engagement probability plus audience growth probability.  ## After 1,000 navigations per World Spacefolder chose the highest-value action on **96 of 96** held-out navigations. | Approach | Expected utility | Score / 100 | | --- | ---: | ---: | | Spacefolder | 0.835 | 100.00 | | Vector search + SQL for matching situations¹ | 0.835 | 100.00 | | SQL for all situations¹ | 0.719 | 54.42 | | First listed action | 0.623 | 50.00 | | Ground truth | 0.835 | 100.00 | ¹ Stack analogies. The replay averaged each action’s outcomes in memory, grouping by exact situation for the first baseline and pooling all situations for the second. ## TypeScript SDK example [TypeScript SDK](/docs/reference/sdks#typescript-and-javascript) · [Navigate API](/docs/reference/api/navigate/navigate) ```ts import { SpacefolderClient } from "@spacefolder/sdk"; const sf = new SpacefolderClient(); const navigation = await sf.navigate({ nav_id: crypto.randomUUID(), world_id: "personal_brand_example", entity_type: "content_campaign", entity_id: "personal-brand:next-post", context: { scene: "Builders seeking implementation details" }, actions: { blog_guide: {"name": "post.published", "data": {"draft_id": "blog_guide", "channel": "blog", "format": "guide", "title": "A practical guide to agents that learn from experience", "text": "A worked example of recording tool outcomes and comparing the next actions before an agent executes them.", "topic": "agent_experience", "audience": {"segment": "founders_and_builders", "roles": ["founder", "software_engineer"], "interests": ["coding_agents", "developer_tools"], "language": "en"}, "published_hour_utc": 9}}, linkedin_story: {"name": "post.published", "data": {"draft_id": "linkedin_story", "channel": "linkedin", "format": "personal_story", "title": "Our agent kept retrying the same failed strategy. Here is what we changed.", "text": "We started measuring which action worked in each context. Here are the results, the surprising failure, and the code we changed.", "topic": "agent_experience", "audience": {"segment": "founders_and_builders", "roles": ["founder", "software_engineer"], "interests": ["coding_agents", "developer_tools"], "language": "en"}, "published_hour_utc": 9}}, x_thread: {"name": "post.published", "data": {"draft_id": "x_thread", "channel": "x", "format": "thread", "title": "Three lessons from building an agent that uses past experience", "text": "A short thread: record outcomes, compare candidate actions, and check whether the recommendation actually helped.", "topic": "agent_experience", "audience": {"segment": "founders_and_builders", "roles": ["founder", "software_engineer"], "interests": ["coding_agents", "developer_tools"], "language": "en"}, "published_hour_utc": 9}}, }, predictions: { engagement: {"event": "post.engaged", "horizon": "24h"}, audience_growth: {"event": "audience.subscribed", "horizon": "7d"}, }, }); let chosen: string | undefined; let best = -Infinity; for (const action of ["blog_guide", "linkedin_story", "x_thread"] as const) { const engagement = navigation.actions?.[action]?.predictions.engagement; if (!engagement || !("probability" in engagement) || typeof engagement.probability !== "number") continue; const audience_growth = navigation.actions?.[action]?.predictions.audience_growth; if (!audience_growth || !("probability" in audience_growth) || typeof audience_growth.probability !== "number") continue; const utility = engagement.probability + audience_growth.probability; if (utility > best) { best = utility; chosen = action; } } console.log(JSON.stringify({ chosen }, null, 2)); ``` ## Example output **Builders seeking implementation details** ```json { "chosen": "blog_guide" } ``` Publish the chosen format and record engagement and audience growth for the same campaign through their respective observation windows. --- # Choose a retention offer Source: https://www.spacefolder.com/docs/benchmarks/retention **KPI** · Expected 90-day renewal contribution ($50 no offer, $40 credit, $45 pause on renewal).  ## After 1,000 navigations per World Spacefolder chose the highest-value action on **96 of 96** held-out navigations. | Approach | Expected utility | Score / 100 | | --- | ---: | ---: | | Spacefolder | 35.580 | 100.00 | | Vector search + SQL for matching situations¹ | 35.580 | 100.00 | | SQL for all situations¹ | 31.341 | 65.29 | | First listed action | 19.818 | 11.05 | | Ground truth | 35.580 | 100.00 | ¹ Stack analogies. The replay averaged each action’s outcomes in memory, grouping by exact situation for the first baseline and pooling all situations for the second. ## TypeScript SDK example [TypeScript SDK](/docs/reference/sdks#typescript-and-javascript) · [Navigate API](/docs/reference/api/navigate/navigate) ```ts import { SpacefolderClient } from "@spacefolder/sdk"; const sf = new SpacefolderClient(); const navigation = await sf.navigate({ nav_id: crypto.randomUUID(), world_id: "retention_example", entity_type: "cancellation_attempt", entity_id: "cancel-001", context: { scene: "Subscriber cites price" }, actions: { no_offer: {"name": "retention.choice", "data": {"offer": "none"}}, credit: {"name": "retention.choice", "data": {"offer": "credit"}}, pause: {"name": "retention.choice", "data": {"offer": "pause"}}, }, predictions: { renewed: {"event": "subscription.renewed", "horizon": "90d"}, }, }); const margin = { no_offer: 50, credit: 40, pause: 45 }; let chosen: string | undefined; let best = -Infinity; for (const action of ["no_offer", "credit", "pause"] as const) { const renewed = navigation.actions?.[action]?.predictions.renewed; if (!renewed || !("probability" in renewed) || typeof renewed.probability !== "number") continue; const utility = renewed.probability * margin[action]; if (utility > best) { best = utility; chosen = action; } } console.log(JSON.stringify({ chosen }, null, 2)); ``` ## Example output **Subscriber cites price** ```json { "chosen": "credit" } ``` Apply the selected offer to the cancellation attempt. Join a paid renewal back to that attempt and close the account's 90-day window before learning from a negative. --- # Correct a robot placement Source: https://www.spacefolder.com/docs/benchmarks/robotics **KPI** · Placement success probability minus contact probability.  ## After 1,000 navigations per World Spacefolder chose the highest-value action on **83 of 96** held-out navigations. | Approach | Expected utility | Score / 100 | | --- | ---: | ---: | | Spacefolder | 0.589 | 98.25 | | Vector search + SQL for matching situations¹ | 0.589 | 98.25 | | SQL for all situations¹ | 0.448 | 68.53 | | First listed action | 0.086 | 0.00 | | Ground truth | 0.597 | 100.00 | ¹ Stack analogies. The replay averaged each action’s outcomes in memory, grouping by exact situation for the first baseline and pooling all situations for the second. ## TypeScript SDK example [TypeScript SDK](/docs/reference/sdks#typescript-and-javascript) · [Navigate API](/docs/reference/api/navigate/navigate) ```ts import { SpacefolderClient } from "@spacefolder/sdk"; const sf = new SpacefolderClient(); const navigation = await sf.navigate({ nav_id: crypto.randomUUID(), world_id: "robotics_example", entity_type: "task_attempt", entity_id: "placement-042", context: { scene: "Part displaced mainly along the fixture x axis" }, actions: { no_action: {"name": "decision.configuration_retained", "data": {}}, correct_x: {"name": "robot.pose_correction", "data": {"frame": "fixture", "translation_m": {"x": -0.002, "y": 0, "z": 0}}}, correct_xyz: {"name": "robot.pose_correction", "data": {"frame": "fixture", "translation_m": {"x": -0.002, "y": 0.001, "z": -0.0005}}}, adjust_grasp: {"name": "robot.grasp_correction", "data": {"grasp_id": "grasp-7", "gripper_width_m": 0.03, "grip_force_n": 9.0}}, }, predictions: { success: {"event": "task.succeeded", "horizon": "5s"}, contact: {"event": "safety.contact_detected", "horizon": "5s"}, }, }); let chosen: string | undefined; let best = -Infinity; for (const action of ["no_action", "correct_x", "correct_xyz", "adjust_grasp"] as const) { const success = navigation.actions?.[action]?.predictions.success; if (!success || !("probability" in success) || typeof success.probability !== "number") continue; const contact = navigation.actions?.[action]?.predictions.contact; if (!contact || !("probability" in contact) || typeof contact.probability !== "number") continue; const utility = success.probability - contact.probability; if (utility > best) { best = utility; chosen = action; } } console.log(JSON.stringify({ chosen }, null, 2)); ``` ## Example output **Part displaced mainly along the fixture x axis** ```json { "chosen": "correct_x" } ``` Dispatch the controller-permitted correction in the virtual workcell. Attribute placement and contact observations to the same attempt over five seconds. --- # ZOZO Open Bandit Dataset Source: https://www.spacefolder.com/docs/benchmarks/shopping On 30,188 held-out impressions, Spacefolder and cached popularity tied at **22.53 estimated clicks per 1,000 impressions**. The specialist logistic recommender scored **16.89**.  Personalization changed 33 picks. The randomized logger displayed the new pick on none of those impressions, so their click value remains uncertain. The chart estimates clicks by weighting observations by inverse display probability. Each policy was frozen before the test period. **About the dataset** ZOZO logged which fashion item appeared on ZOZOTOWN, its probability of being shown and whether the shopper clicked. This replay uses the first recommendation slot in the randomized men’s campaign. [Explore the ZOZO dataset](https://research.zozo.com/data.html) --- # Recover an inventory lookup Source: https://www.spacefolder.com/docs/benchmarks/tools **KPI** · Probability of delivering a valid inventory response in five seconds.  ## After 1,000 navigations per World Spacefolder chose the highest-value action on **96 of 96** held-out navigations. | Approach | Expected utility | Score / 100 | | --- | ---: | ---: | | Spacefolder | 0.667 | 100.00 | | Vector search + SQL for matching situations¹ | 0.667 | 100.00 | | SQL for all situations¹ | 0.550 | 54.69 | | First listed action | 0.455 | 48.96 | | Ground truth | 0.667 | 100.00 | ¹ Stack analogies. The replay averaged each action’s outcomes in memory, grouping by exact situation for the first baseline and pooling all situations for the second. ## TypeScript SDK example [TypeScript SDK](/docs/reference/sdks#typescript-and-javascript) · [Navigate API](/docs/reference/api/navigate/navigate) ```ts import { SpacefolderClient } from "@spacefolder/sdk"; const sf = new SpacefolderClient(); const navigation = await sf.navigate({ nav_id: crypto.randomUUID(), world_id: "tools_example", entity_type: "tool_attempt", entity_id: "tools-001", context: { scene: "Primary service recovering after a timeout" }, actions: { retry_primary: {"name": "tools.action", "data": {"choice": "retry_primary"}}, refresh_cache: {"name": "tools.action", "data": {"choice": "refresh_cache"}}, query_replica: {"name": "tools.action", "data": {"choice": "query_replica"}}, }, predictions: { on_time: {"event": "inventory.valid_response", "horizon": "5s"}, }, }); let chosen: string | undefined; let best = -Infinity; for (const action of ["retry_primary", "refresh_cache", "query_replica"] as const) { const on_time = navigation.actions?.[action]?.predictions.on_time; if (!on_time || !("probability" in on_time) || typeof on_time.probability !== "number") continue; const utility = on_time.probability; if (utility > best) { best = utility; chosen = action; } } console.log(JSON.stringify({ chosen }, null, 2)); ``` ## Example output **Primary service recovering after a timeout** ```json { "chosen": "retry_primary" } ``` After the timeout, issue exactly one lookup through the selected path. Record a success only when a valid inventory response arrives within five seconds. --- # Large Adaptive World Model Source: https://www.spacefolder.com/docs/concepts/large-adaptive-world-model A **Large Adaptive World Model (LAWM)** learns a representation of a changing world from experience and uses that representation to predict possible futures. Spacefolder separates learning and prediction into two complementary models: **Fold** updates the world representation from observations, actions, and outcomes; **Navigate** reasons over that representation to predict outcomes and compare possible actions. ## Fold learns from what happens Fold is a small model designed to run close to your data, on your infrastructure. It continuously learns from observations, actions, and outcomes, turning application activity into compact learned trajectories. These trajectories represent how the world changes over time. As new activity arrives, Fold updates the learned state with that experience. ## Navigate predicts what could happen Navigate is a large model that runs on Spacefolder infrastructure. It combines folded state with the current user or task context, a predictive question, and optional candidate actions to predict outcomes for the decision at hand. When objectives compete, Navigate can describe a Pareto frontier: the options for which improving one objective requires giving something up on another. ## A continuous learning loop Learning and prediction form a continuous loop: 1. **Observe:** your application records what happened, including actions taken and their measured outcomes. 2. **Fold:** Fold incorporates that activity into learned trajectories and world state. 3. **Navigate:** Navigate combines the state with current context to predict outcomes and compare candidate actions. 4. **Measure:** your application chooses what to do, measures the result, and feeds that experience back into the loop. Navigate does not execute the actions it compares. Your software remains responsible for decisions, constraints, and execution. ## Predictions grounded in experience Spacefolder preserves history and traces sources so predictions can be compared with actual outcomes. Measured outcomes become new experience for Fold, connecting future predictions to what actually happened. Read [Primitives](/docs/concepts/primitives) for Worlds, events, predictions, actions, and objectives. --- # Primitives Source: https://www.spacefolder.com/docs/concepts/primitives 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](/docs/reference/api/worlds/create-world) ## Fold Fold records events in a World. Reuse the same event ID when retrying so each event is counted once. [Fold API reference](/docs/reference/api/fold/fold) ### 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. ```json { "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](/docs/reference/api/navigate/navigate) ### 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.