Action suggestions
curl --request GET \
--url https://api.example.com/api/suggestionsimport requests
url = "https://api.example.com/api/suggestions"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://api.example.com/api/suggestions', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.example.com/api/suggestions",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/api/suggestions"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.example.com/api/suggestions")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/api/suggestions")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body{
"action_name": "<string>",
"success_probability": 123,
"evidence_count": 123,
"reasoning": "<string>"
}Strategies & policy
Action suggestions
The Policy Guide endpoint — ask ‘What should the agent do next?’
GET
/
api
/
suggestions
Action suggestions
curl --request GET \
--url https://api.example.com/api/suggestionsimport requests
url = "https://api.example.com/api/suggestions"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://api.example.com/api/suggestions', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.example.com/api/suggestions",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/api/suggestions"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.example.com/api/suggestions")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/api/suggestions")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body{
"action_name": "<string>",
"success_probability": 123,
"evidence_count": 123,
"reasoning": "<string>"
}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
integer
required
Context fingerprint (computed from the current context).
integer
Last action node ID. Set to
null to get suggestions from the start.integer
default:"10"
Maximum number of suggestions to return.
Response
Returns an array ofActionSuggestionResponse objects.
string
Suggested action name.
number
Probability of success (
0.0–1.0).integer
Number of supporting past examples.
string
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}`);
}
