Skip to main content

A CPU-first bio-inspired Spiking Neural Network engine with bounded-state CLI, evaluation, and release validation flows.

Project description

SARA Engine

SARA (Spiking Architecture for Reasoning and Adaptation) Engine is a CPU-first spiking AI framework for learning, inference, and lightweight agent workflows without backpropagation-heavy runtime assumptions.

The project combines an event-driven Rust core with Python model, evaluation, and CLI layers. It prioritizes biological plausibility, bounded runtime state, and managed output paths suitable for local and edge-oriented deployment.

Key Features

  • Rust-accelerated event-driven SNN core for CPU-focused execution.
  • Backpropagation-free, matrix-light learning flows centered on STDP, predictive coding, FORCE, and direct memory updates.
  • Spiking language and agent components including SaraInference, SpikingLLM, and SaraAgent.
  • Managed release validation with soak reports, release gates, and Phase 3 quality benchmarks.
  • Shipping gates now require both stage_a_acceptance and stage_b_readiness, including lightweight world-model minimums such as transition, command, predictor snapshot, runtime tracking, and shift tracking readiness.
  • Shared TurboQuant-style quantization utilities for compact SNN memory and checkpoint handling.
  • Fluid-inspired supplementary dynamics for bounded predictive support tracing without backpropagation or matrix-heavy runtime dependencies.

Installation

Ensure Python 3.10+ and a working Rust toolchain are available.

git clone https://github.com/matsushibadenki/sara-engine-project.git
cd sara-engine-project
pip install -e .

If Rust core changes are not reflected, rerun pip install -e ..

CLI

Interactive chat with a saved memory model:

sara-chat --model models/distilled_sara_llm.msgpack

Dialogue memory training from JSONL:

sara-train data/raw/chat_data.jsonl --model models/distilled_sara_llm.msgpack

JSONL format:

{"user": "こんにちは", "sara": "こんにちは。SARAです。"}
{"user": "SARAって何?", "sara": "私はスパイキングニューラルネットワークで動くローカルAIエンジンです。"}

Subword SNN LM training with optional TurboQuant-style checkpoint compression:

python scripts/train/train_snn_lm.py \
  --corpus data/processed/corpus.txt \
  --save-dir models/snn_lm_pretrained \
  --turboquant

Managed Output Policy

Generated artifacts must stay inside managed directories:

  • data/raw, data/interim, data/processed
  • workspace
  • models

Repository-root outputs and ad hoc directories are not part of the supported production flow. Path helpers live in src/sara_engine/utils/project_paths.py.

Release Validation

Recommended pre-release flow:

pytest -q tests/test_release_soak.py tests/test_sara_cli_dispatch.py tests/test_cli_entrypoints.py tests/test_inference_reliability.py tests/test_inference_memory_io.py tests/test_spiking_llm_memory_io.py tests/test_direct_map_utils.py tests/test_chat_agent_calculator.py tests/test_sara_agent_dialogue.py tests/test_practical_reliability.py
python scripts/eval/release_soak.py --include-accuracy
python scripts/eval/release_gate.py

The release path now expects Phase 3 results to satisfy both the Stage A evaluation gate and the Stage B lightweight world-model gate. In practice, the human-readable summaries should show PASS for stage_a_acceptance, stage_b_readiness, the Stage B minimum checks, and the operator/speculative trace checks such as stage_b_operator_consistency_ready and stage_b_speculative_acceptance_ready.

For final shipping decisions, use the extended soak profile:

python scripts/eval/release_soak.py --profile extended --include-accuracy

Managed outputs:

  • Soak report: workspace/release/release_soak_report.json
  • Soak summary: workspace/release/release_soak_summary.txt
  • Phase 3 accuracy suite: workspace/evaluation/phase3_accuracy_suite.json

Core Modules

  • sara_engine.core: low-level spiking layers and Rust-facing building blocks.
  • sara_engine.models: prebuilt SNN language, classifier, reservoir, and multimodal models.
  • sara_engine.learning: plasticity, predictive coding, FORCE, and structural update rules.
  • sara_engine.memory: SDR, hippocampal memory, long-term memory, and vector-store components.
  • sara_engine.agent: bounded-state agent runtime and tool integration.
  • sara_engine.evaluation: release, reliability, and Phase 3 benchmark evaluators.

Documentation

  • doc/ROADMAP.md: implementation priorities and milestone status.
  • doc/RELEASE_CHECKLIST.md: pre-release validation and packaging checklist.
  • doc/RELEASE_NOTES.md: current pre-release changes and known gaps.
  • doc/SARA-Engine_Documentation_Hub.md: broader documentation hub.

License

MIT License.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

sara_engine-0.4.9.tar.gz (46.6 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

sara_engine-0.4.9-cp310-cp310-macosx_11_0_arm64.whl (606.8 kB view details)

Uploaded CPython 3.10macOS 11.0+ ARM64

File details

Details for the file sara_engine-0.4.9.tar.gz.

File metadata

  • Download URL: sara_engine-0.4.9.tar.gz
  • Upload date:
  • Size: 46.6 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: maturin/1.11.5

File hashes

Hashes for sara_engine-0.4.9.tar.gz
Algorithm Hash digest
SHA256 c0a18a114b4213c12ff48857141d06ceeabcba3b6594e36dd66d437b2c289e87
MD5 cc777a1706dfb71e8290709d0652a107
BLAKE2b-256 6a0fd0c7b8b1f890fbe872305ce49e61745d14dd6221106f3638c32aaa5c90dd

See more details on using hashes here.

File details

Details for the file sara_engine-0.4.9-cp310-cp310-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for sara_engine-0.4.9-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 dae7541d6f9e61fa7b754eeab201c4385b0f5d6e390ac9a188e64f99c8196eed
MD5 b515c9fb143f110d4059acd539fbbdd9
BLAKE2b-256 5032540a925999edb33b43b640986af2a04565481e8c22381d518577e3a00221

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page