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.8.tar.gz (46.5 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.8-cp310-cp310-macosx_11_0_arm64.whl (593.4 kB view details)

Uploaded CPython 3.10macOS 11.0+ ARM64

File details

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

File metadata

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

File hashes

Hashes for sara_engine-0.4.8.tar.gz
Algorithm Hash digest
SHA256 18821c1f9c23d268514bc0f91673ba6ec855c86a3733878e15156fdb6350bcb9
MD5 822aa6599c66638f97dd31ea7b984f9b
BLAKE2b-256 ba100bbdbdf9aca5d6d9e3f3d585be8ecfb31d335b766588afe0afce2deb549d

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for sara_engine-0.4.8-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 f0d3f55a6a5e2399d89a914a6740c8c16682d69edb640fb1e3637a0a1087a8d0
MD5 7668a29cd52f127f397f77ce2e532ff8
BLAKE2b-256 bbcfacb78cf3f1e354d8e9a6dc82a09a29fe3cad9628b647d770bf0b33bec9d4

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