Skip to content
Raul Cardenas Montoya edited this page Sep 17, 2026 · 5 revisions

brainstem-daemon

Wiki hero

Generated with Grok Build: Grok 4.5 · xAI Imagine (/imagine)

High-performance spiking neural-network runtime written in Rust.

Version: 0.1.2 | Edition: 2024 | License: MIT OR Apache-2.0

brainstem-daemon is the headless inference process for the Limen SNN stack: it loads a TOML config, steps a neuromod::SpikingNetwork on a fixed tick, ingests stimuli through a pluggable backend, and publishes spikes. Training and weight optimization live in plasticity-lab — this crate is inference-only.

What This Crate Covers

  • Library: BrainstemDaemon, DaemonConfig, config-driven ServiceRegistry
  • Pluggable I/O: StimulusSource / SpikeSink / BackendPair (local types)
  • Default stub backend (no libzmq; core builds and tests stay pure Rust)
  • Optional corpus-ipc feature: ZeroMQ PUB/SUB via corpus-ipc + zmq
  • Binary: brainstem-daemon — thin CLI wrapper over the library (renamed from soma-daemon in #37)
  • Dual Docker targets (core / full) and GitHub Actions CI

Start Here

Page Description
Overview Full page map of this wiki
Getting Started Build, config, run, feature flags
Project Structure Layout, modules, Cargo features
Architecture Runtime model and tick pipeline
Configuration TOML fields, paths, validation
Backend I/O Traits, stub, ZMQ implementations
Service Registry Named services, enable/disable
Tick Loop Ingress → decode → step → emit
Public API Exported library surface
brainstem-daemon Binary CLI, graceful shutdown, env vars, systemd notes
Docker Multi-stage core / full images
CI and Quality GitHub Actions, local gates
Testing Unit tests and backend coverage
Role and Boundaries Ownership matrix vs sibling repos
Glossary Terms and constants

Ecosystem Role

Layer Responsibility Entity
Encoding Continuous → spikes axon-encoder
Reservoir / cortex (GPU) Large LSM LiquidCortex.jl
SNN core library LIF / Izhikevich network + neuromodulators neuromod
Headless runtime Tick loop, config, ingress/egress brainstem-daemon
IPC fabric ZMQ spine, message types corpus-ipc (optional dep)
Critic / modulators Upstream dopamine etc. limbic-critic (via ingress)
Downstream consumers Spike stream consumers silicon-bridge, others
Training Plasticity / weight ops plasticity-lab

Quick Commands

cargo build --release --bin brainstem-daemon
cargo test --all-features
cargo clippy --all-targets --all-features -- -D warnings
cargo fmt --check

Default (no features) uses the stub backend. Enable ZeroMQ with --features corpus-ipc (needs libzmq3-dev / vendored zmq as appropriate). The daemon shuts down gracefully on SIGINT (all platforms) and SIGTERM (Unix): the tick loop breaks, then the sink is flushed and the source shut down.

License

Dual-licensed under MIT or Apache-2.0 at your option.


Last updated: 2026-09-16 Updated by: KAI Package tip reference: 083cdea (main)

Clone this wiki locally