curl --request POST \
--url 'https://api.nsr.stateset.com/api/v1/forward-chain' \
--header "X-API-Key: $STATESET_NSR_API_KEY" \
--header 'Content-Type: application/json' \
--data '{
"include_details": true,
"limit": 20,
"max_depth": 1,
"max_iterations": 8,
"rule_ids": [
"3fa85f64-5717-4562-b3fc-2c963f66afa6"
]
}'
{
"execution_time_ms": 250,
"inferred_facts": [
{
"confidence": 7.5,
"predicate": "string",
"rule_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"substitution": {},
"terms": []
}
],
"iterations_used": 8,
"rules_fired": [
"string"
],
"total_inferred": 1
}
Forward chaining endpoint with parameters
Derives new facts by applying rules to the knowledge base. Supports fine-grained control over inference depth, iterations, and which rules to apply…
POST
/
api
/
v1
/
forward-chain
curl --request POST \
--url 'https://api.nsr.stateset.com/api/v1/forward-chain' \
--header "X-API-Key: $STATESET_NSR_API_KEY" \
--header 'Content-Type: application/json' \
--data '{
"include_details": true,
"limit": 20,
"max_depth": 1,
"max_iterations": 8,
"rule_ids": [
"3fa85f64-5717-4562-b3fc-2c963f66afa6"
]
}'
{
"execution_time_ms": 250,
"inferred_facts": [
{
"confidence": 7.5,
"predicate": "string",
"rule_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"substitution": {},
"terms": []
}
],
"iterations_used": 8,
"rules_fired": [
"string"
],
"total_inferred": 1
}
Derives new facts by applying rules to the knowledge base.
Supports fine-grained control over inference depth, iterations, and which rules to apply.
Run forward-chaining inference over the knowledge base.
Required scope:
write
Request body
ForwardChainRequest
boolean
Include full fact details in response (subject, predicate, object)
integer
Maximum number of results to return (default: 1000)
integer
Maximum depth of rule application (default: config value, max: 100)
integer
Maximum number of inference iterations (default: config value, max: 10000)
string[]
Optional list of rule IDs to apply (if empty, applies all enabled rules)
Response
ForwardChainResponse
integer (int64)
required
Execution time in milliseconds
InferredFactResponse[]
required
integer
required
Number of iterations performed
string[]
required
Rules that fired during inference
integer
required
Total number of facts inferred (before limit)
Status codes
| Code | Meaning |
|---|---|
200 | Inference completed |
400 | Invalid parameters |
401 | Unauthorized — missing or invalid credentials |
403 | Forbidden — the key/token lacks the required scope |
429 | Rate limited — see Retry-After / X-RateLimit-Reset |
curl --request POST \
--url 'https://api.nsr.stateset.com/api/v1/forward-chain' \
--header "X-API-Key: $STATESET_NSR_API_KEY" \
--header 'Content-Type: application/json' \
--data '{
"include_details": true,
"limit": 20,
"max_depth": 1,
"max_iterations": 8,
"rule_ids": [
"3fa85f64-5717-4562-b3fc-2c963f66afa6"
]
}'
{
"execution_time_ms": 250,
"inferred_facts": [
{
"confidence": 7.5,
"predicate": "string",
"rule_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"substitution": {},
"terms": []
}
],
"iterations_used": 8,
"rules_fired": [
"string"
],
"total_inferred": 1
}
Last modified on August 31, 2026