This is the Policy Guide endpoint. Given the current context, it recommends the next best action based on past experiences and learned strategies.
Query parameters
Context fingerprint (computed from the current context).
Last action node ID. Set to null to get suggestions from the start.
Maximum number of suggestions to return.
Response
Returns an array of ActionSuggestionResponse objects.
Probability of success (0.0–1.0).
Number of supporting past examples.
Explanation for why this action is recommended.
[
{
"action_name": "check_seat_availability",
"success_probability": 0.94,
"evidence_count": 12,
"reasoning": "After confirming the movie title, checking availability has a 94% success rate based on 12 past interactions."
}
]
Usage with the SDK
const suggestions = await client.getActionSuggestions(contextHash, lastActionNode, 3);
if (suggestions.length > 0) {
const best = suggestions[0];
console.log(`Recommended: ${best.action_name} (${(best.success_probability * 100).toFixed(0)}% success)`);
console.log(`Reasoning: ${best.reasoning}`);
}