NSM VB: A Local-First Neuro-Symbolic Cognitive Architecture for Mobile Devices
Persistent memory, symbolic inference, and local-first cognitive systems — running entirely on Android.
Large Language Models have revolutionized natural language processing, yet they suffer from fundamental limitations: high computational costs, severe hallucinations, lack of persistent episodic memory, and a reliance on cloud infrastructure. This paper introduces NSM VB (NeuraSaMu Virtual Brain), a lightweight, local-first cognitive architecture designed to run entirely on mobile Android devices. Unlike traditional auto-regressive models, NSM VB utilizes a hybrid approach combining Hyperdimensional Computing (HDC) for semantic memory, SQLite for episodic memory, a forward-chaining inference engine for logical reasoning, and Construction Grammar for sentence generation. We demonstrate that NSM VB can achieve persistent memory, zero-latency knowledge retrieval, and basic transitive reasoning without requiring GPUs or external APIs — successfully passing a suite of 176 unit tests on a mobile CPU.
1. Introduction
Modern Artificial Intelligence is dominated by massive Transformer-based models (e.g., GPT-4, Llama). While highly fluent, these models operate as statistical next-token predictors. They do not possess a true "understanding" of facts, they cannot update their internal weights on the fly without catastrophic forgetting, and they require massive energy resources.
To address these issues, we propose a paradigm shift towards Developmental Cognitive Architectures. NSM VB is built on the premise that intelligence can emerge through continuous, incremental interaction with a user. It abandons the billion-parameter neural network in favor of a highly optimized, rule-based, and vector-symbolic hybrid system. NSM VB runs 100% locally on an Android device, ensuring complete data privacy and zero API costs.
2. Architecture & Methodology
The NSM VB architecture is composed of four distinct subsystems:
2.1. Hyperdimensional Memory (HDC)
For semantic memory, NSM VB utilizes Hyperdimensional Computing (10,000-dimensional binary vectors). Words and concepts are represented as random binary vectors. Relations are bound using the XOR operation, and concepts are bundled using majority voting. This allows NSM to represent hierarchical structures (e.g., Dog IS Animal) and retrieve concepts using Hamming distance, bypassing the need for neural embeddings.
2.2. Episodic & Fact Memory
Unlike LLMs that have a fixed context window, NSM VB uses a local SQLite database. Every conversation, fact, and emotional state is stored in a structured JSON format. This grants the system "Infinite Memory." Furthermore, a specific Forget System allows users to explicitly delete specific memories — a capability inherently impossible in standard LLMs.
2.3. Reasoning & Inference Engine
NSM VB is not just a lookup table; it reasons. The system features a forward-chaining inference engine based on graph traversal. If the system knows Dog IS Animal and Animal CAN Breathe, it algorithmically deduces Dog CAN Breathe. This ensures hallucination-free logical deductions.
2.4. Construction Grammar & Production
To generate language, NSM VB uses Construction Grammar, mapping "Form" (sentence structure) to "Meaning" (semantic representation). The Parser extracts meaning from input, and the Realizer generates grammatically correct sentences based on stored facts and tenses (Past, Present, Future).
3. The "Curiosity Loop"
A novel feature of this architecture is the Curiosity Loop. When NSM VB encounters a word not present in its 86,000-word dictionary, it does not hallucinate an answer. Instead, it triggers a question: "I know the word 'X' but I don't know its meaning. Can you tell me?" It recursively asks about unknown words in the explanation, mimicking the learning process of a human child.
4. Implementation
- Core Engine: Python.
- Deployment: The Python runtime is embedded into an Android APK using Chaquopy. The UI is a custom HTML/JS WebView.
- Optional Teacher Mode: While independent, the system can optionally connect to a tiny local LLM (e.g., SmolLM 360M via LM Studio/SaMu Lab) using an OpenAI-compatible API. The LLM acts only as a language polisher, ensuring fluency without overriding NSM's core reasoning.
5. Evaluation & Results
The system was evaluated using a custom test suite of 176 unit tests covering memory retention, logical inference, grammar generation, and multi-user isolation. The tests achieved a 100% pass rate on a mobile CPU. The system demonstrated:
- Zero API Latency: Local retrieval happens in milliseconds.
- Perfect Memory Retention: Facts learned days ago are retrieved accurately.
- Zero Hallucination in Logic: Inference tasks (e.g., A → B → C) are strictly deterministic.
6. Limitations & Future Work
Currently, NSM VB requires structured input formats to generate complex grammar. Future iterations will focus on expanding the Construction Grammar registry to support passive voice, multi-clause sentences, and integrating multi-modal inputs (vision and audio) to allow the system to learn from the physical world.
7. Conclusion
NSM VB demonstrates that a lightweight, explainable, and reasoning-capable AI can run on consumer mobile hardware without reliance on cloud servers. By combining Hyperdimensional Computing, Construction Grammar, and incremental learning, this research provides a viable, privacy-first alternative to traditional Large Language Models.