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.
  • Shared TurboQuant-style quantization utilities for compact SNN memory and checkpoint handling.

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

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.7.tar.gz (46.4 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.7-cp310-cp310-macosx_11_0_arm64.whl (586.6 kB view details)

Uploaded CPython 3.10macOS 11.0+ ARM64

File details

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

File metadata

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

File hashes

Hashes for sara_engine-0.4.7.tar.gz
Algorithm Hash digest
SHA256 7cf1b07e15a1bb08e91e474d007652e85f2d3907b1099ec82e8c90e4d9916136
MD5 7311f6d22b7581ae40042e451681f4a1
BLAKE2b-256 9f42c25a4b0764007c4d7b7d2966cdd46b342223ad2199ef4b34d267c6f5539e

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for sara_engine-0.4.7-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 cafeb8e0710dde61ac140deee7b27c7b4cee7da00838224f861994b5ce674b69
MD5 0e072d0601e153f2faa44a247c3a7a7e
BLAKE2b-256 4244beb509aad860dd1080295792564b0a7f073eeca0d14d17ad2ad26bac6a21

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