striatum is a dedicated, high-level client wrapper for the AHEM (Autonomous Hybrid Evaluation Module) neuro-symbolic engine. It abstracts the underlying TensorLogic compilation, grounding region partitioning, and token mapping to expose a clean, out-of-the-box router interface.
striatum acts as the semantic routing boundary for edge-deployed Large Feature Models (LFMs):
- FSM Route Initialization: Loads the TensorLogic-compiled FSM rules specifying execution bounds between local tools and cloud engines.
- Token Constraint Mapping: Automatically registers cloud routing tokens (
[route_cloud/12300) and local execution tokens ([exec_local/12400). - Continuous Latent Evaluation: Routes continuous 3D latent trajectories
[batch, sequence, features]to allow normal text generation, while automatically issuing veto decisions and cache rollbacks upon routing mismatch.
To use striatum in your Rust project, configure your Cargo.toml:
[dependencies]
striatum = { path = "path/to/striatum" }
scirs2-core = "0.3"Because striatum wraps ahem, running it requires access to the compiled MNN shared libraries:
export MNN_LIB_DIR=path/to/MNN/build
export LD_LIBRARY_PATH=path/to/MNN/build:path/to/MNN/build/expressHere is a quick example of initializing the edge router and evaluating a continuous latent state:
use striatum::{init_default_edge_router, RouteDecision};
use scirs2_core::ndarray::Array3;
fn main() -> Result<(), Box<dyn std::error::Error>> {
// 1. Initialize the default FSM edge router
let mut router = init_default_edge_router()?;
// 2. Simulate a continuous latent trajectory (e.g. [batch=1, seq=1, feat=1024])
// Features 0..100 are active, signifying Cloud Intent
let mut latent = Array3::<f64>::zeros((1, 1, 1024));
for i in 0..100 {
latent[(0, 0, i)] = 1.0;
}
// 3. Evaluate routing decisions before token execution
let route_cloud_token = 12300;
let exec_local_token = 12400;
// Rule 1 Violation: Cloud Intent + Local Tool token -> VETO
let decision = router.route(&latent, exec_local_token)?;
assert_eq!(decision, RouteDecision::Veto);
// Conformance: Cloud Intent + Cloud Routing token -> ALLOW
let decision = router.route(&latent, route_cloud_token)?;
assert_eq!(decision, RouteDecision::Allow);
println!("Routing constraints successfully validated.");
Ok(())
}Run the local integration tests to verify the FSM routing contracts:
cargo test