
StateSet NSR Engine
A Rust-built, symbolic-first reasoning engine that plans, acts, and verifies - delivering explainable autonomy for commerce.

Dominic Steil
Founder & CEO at StateSet
TL;DR
We built the StateSet NSR (Neuro-Symbolic Reasoning) Engine to bridge deterministic logic with probabilistic LLMs. It is symbolic-first: the engine plans, applies rules, and references knowledge before ever calling a model. The result is an explainable, fast, and reliable operating system for commerce decisions.
Everything runs in Rust for memory safety and sub-millisecond latency, with observability, fuzz tests, and local inference baked in.
Unlike GenAI wrappers that ask an LLM to guess, the NSR Engine follows a Symbolic-First Architecture. It prioritizes logic, planning, and knowledge bases, and only then augments with LLM inference when it improves utility. That is how we get accuracy, explanations, and efficiency in one system.
1) What we built: the architecture
The NSR Engine is composed of three layers engineered in Rust. It is designed to decompose tasks, prove results, and keep performance predictable under load.
Hybrid Reasoning Engine
Recursive Plan → Act → Reflect loop decomposes tasks; Prolog-style inference handles forward and backward chaining; program synthesis writes small scripts for numerical and data-heavy problems.
Advanced Cognitive Primitives
Research-grade reasoning with MCTS to simulate branches, Graph of Thoughts for non-linear exploration, and VSA to blend embeddings with symbolic operations.
Enterprise Infrastructure
Built in Rust for memory safety and sub-millisecond latency; OpenTelemetry + Prometheus observability; fuzz and property testing; local ONNX/Candle inference for sensitive workloads.
The recursive loop
Plan → Act → Reflect. The engine decomposes complex requests into sub-tasks, solves them, and iterates until the goal is achieved or a constraint blocks progress.
Logic before LLM
Prolog-style inference and constraint solving run first. LLM calls are used sparingly for language understanding or synthesis when rules alone are insufficient.
2) The interface: reasoning as a microservice
The `stateset-nsr` API runs as a containerized microservice (`nsr-server`). External systems send objectives; NSR returns structured, reasoned answers.
Ingest (POST /api/v1/knowledge)
Push facts, rules, and constraints into NSR active memory. Everything is versioned and addressable.
Reason (POST /api/v1/reason)
Send a goal like "Is this return valid based on history?" NSR composes symbolic rules first, falls back to LLMs when needed.
Response (JSON)
Returns the answer, confidence score (0.0-1.0), and a trace of the rules applied so teams can see the why.
What the response contains
- The answer: deterministic or probabilistic result.
- Confidence score: 0.0-1.0.
- The trace: step-by-step log of rules applied (the why).
3) Use case: autonomous commerce operations
Standard chatbots cannot safely process refunds or obey policy edge cases. The NSR Engine becomes the policy brain - executing business logic with proofs while agents handle the conversation.
The "VIP auto-refund" workflow
- Input: Ticket 1024 - "My package arrived damaged! I want a refund."
- Context: Order total $450, tier VIP, status Delivered.
- Execution: Evaluate `vip_doa_auto_refund` from `ecommerce_support_rules.json`.
{
"rule": "vip_doa_auto_refund",
"if": [
{"fact": "issue_type", "args": ["?ticket", "damaged_on_arrival"]},
{"fact": "customer_tier", "args": ["?customer", "vip"]},
{"fact": "order_total", "args": ["?order", "?total"]}
],
"constraints": [
{"op": "<=", "left": "?total", "right": 500.0}
],
"then": [
{"action": "authorize_refund", "args": ["?order", "full"]},
{"action": "waive_return_shipping", "args": ["?order", true]},
{"action": "respond_with", "args": ["?ticket", "instant_vip_refund_template"]}
]
}The engine returns actions, not just text: authorize_refund(Order-123, "full"), waive_return_shipping(Order-123), and respond_with the instant VIP template.
Auditability
Every action is bound to a Rule ID and trace so finance, CX, and risk teams can see why a decision happened.
Safety
Hard constraints (e.g., never refund above a threshold without approval) are enforced at the symbolic layer.
Speed
Rust + symbolic-first flow returns answers in milliseconds, even under heavy load.
4) Why this wins
- Auditable: every action ties back to a rule and traceable evidence.
- Safe: hard constraints cannot be overruled by an LLM.
- Fast: Rust-first pipeline and symbolic reasoning keep latency low.
- Ready: stable codebase with fuzz tests, property tests, and pilots underway.
See the NSR Engine in action
Deploy the recursive reasoning microservice into your stack and move from chat to true autonomy - backed by proofs, not guesses.
Enjoyed this article?
Get more insights on autonomous commerce, AI agents, and margin intelligence delivered to your inbox.