Deterministic first, model second: an agent runtime with receipts
A local-first C++17 runtime that matches exact phrases before ever calling a model — and refuses to guess a tool call when the model misbehaves.

What it does
MasterAgent is an embeddable C++17 agent runtime: text in, validated tool execution out. Exact-phrase skills are matched deterministically first; only unmatched input reaches a model, and only if you’ve pointed the runtime at a local model server. Tool names and arguments must pass a host-defined schema — unknown tools and malformed model output produce an error, never a guessed call. It ships as a sparx CLI and an installable CMake SDK (MasterAgent::Core), and can be built with neither HTTP nor storage for a fully offline, model-free runtime.
The interesting bit
Tool execution is treated like a transaction. Context-aware tools receive a session identity, a stable scoped idempotency key, a deadline, and a cooperative cancellation signal, and must return committed, failed, or unknown; interrupted requests become UNKNOWN and wait for evidence-based reconciliation. The bundled inventory example deliberately drops a response after commit and proves no second stock decrement after either process restarts — failure-mode testing most agent frameworks don’t bother with.
Key highlights
- Deterministic skills need no model, credentials, or network — the demo runs against a simulated in-memory AC.
- The model adapter speaks plain
/v1/chat/completionsto a local server you start yourself; no model is downloaded and there’s no automatic cloud fallback. - Opt-in SQLite persistence adds request dedup across restarts, history recovery, and reconciliation; a database failure halts execution rather than silently degrading to memory.
- Release CI targets Linux and macOS; Apache-2.0.
- The README’s capability table is refreshingly explicit about what’s experimental versus actually shipped.
Caveats
- The repo tagline advertises sub-100ms latency on Qualcomm NPUs, but the README states QNN/Genie integration is “not verified by this release” and that evaluations are synthetic — no real-model or NPU performance evidence exists here.
- This is a small synchronous runtime: the “durable kernel” and multi-step DAG described by legacy headers under
include/master_agent/have no public implementations. - Persistence covers execution receipts only — no transaction spans a real device and SQLite, so it’s not exactly-once, and storage isn’t encrypted.
Verdict
Embedded and automotive developers who want agent tool calls with real idempotency and recovery semantics will find this genuinely useful. If you came for the on-device NPU agent stack in the description, that part isn’t in the open release.
Frequently asked
- What is OpenSparX/MasterAgent?
- A local-first C++17 runtime that matches exact phrases before ever calling a model — and refuses to guess a tool call when the model misbehaves.
- Is MasterAgent open source?
- Yes — OpenSparX/MasterAgent is open source, released under the Apache-2.0 license.
- What language is MasterAgent written in?
- OpenSparX/MasterAgent is primarily written in C++.
- How popular is MasterAgent?
- OpenSparX/MasterAgent has 1.6k stars on GitHub.
- Where can I find MasterAgent?
- OpenSparX/MasterAgent is on GitHub at https://github.com/OpenSparX/MasterAgent.