Choose a publishing format
Navigation quality, TypeScript SDK example and recorded choice for the personal_brand benchmark.
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
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
{
"chosen": "blog_guide"
}
Publish the chosen format and record engagement and audience growth for the same campaign through their respective observation windows.