Sovereign-NS: A Local-First Neuro-Symbolic Agent Architecture Combining PUCT-MCTS AST Synthesis, DreamCoder Library Compression, and Traceback-Guided Surgical Repair
Contemporary autonomous software agents overwhelmingly rely on cloud-hosted Large Language Models (LLMs), introducing external API dependencies, non-deterministic hallucinations, quota failures, and privacy risks. To address these limitations, we present Sovereign-NS, a 100% local-first, neuro-symbolic cognitive agent architecture built from scratch in Python, PyTorch, SymPy, and Z3 without relying on cloud LLM APIs. Sovereign-NS integrates: (i) an Observe-Orient-Decide-Act (OODA) execution graph with Tree-of-Thoughts exploration and formal static/SMT verification; (ii) a PUCT Monte Carlo Tree Search (MCTS) program synthesizer operating directly over typed Python Abstract Syntax Trees (ASTs), supporting linear pipelines, automatic conditional branching (if/else), and binary functions f(a, b); (iii) an AlphaZero-style PyTorch Policy-Value network and a Wake-Sleep DreamCoder library compressor that distills recurring AST subtrees into reusable macro-primitives; (iv) a deterministic Traceback-Guided Surgical AST Repair engine that heals runtime and syntax exceptions directly on the AST; and (v) a Living Knowledge Graph paired with a local BM25 Retrieval-Augmented Generation (RAG) index and an online continual-learning Transformer with experience replay. Across four reproducible local ablation benchmarks, our architecture achieves a 100.0% sandbox healing rate across 10 injected faults spanning 6 Python exception families, 100.0% canonical domain retention under online continual learning (loss 6.7460 -> 0.6505), 100.0% Recall@3 on multi-file codebase retrieval, and a 25.3% reduction in synthesized program Minimum Description Length (MDL) with 12.5% fewer MCTS simulations when combining AlphaZero Policy-Value guidance with DreamCoder macros. We also transparently analyze the branching-factor versus compression trade-off observed under fixed simulation budgets.
Authors
- Kaique Toffoli
Publication Details
- Journal
- Zenodo (CERN European Organization for Nuclear Research)
- Published
- 2026-11-27
- DOI
- https://doi.org/10.5281/zenodo.24575049
- Primary Topic
- AI-based Problem Solving and Planning
- Type
- preprint