OxiRouter
Autonomous Semantic Federation Engine for the Edge — Learned source selection for SPARQL federated queries with context-awareness.
Status
| Version | 0.1.0 (initial release, 2026-05-03) |
| Status | Alpha — feature-complete for 0.1.x, API may evolve |
| Tests | 501 unit/integration + 6 doc tests (all passing) |
| Lines of code | 23,361 Rust (96 files) |
| Edition / MSRV | 2024 / 1.85 |
| License | Apache-2.0 |
| CLI | oxirouter-cli — route, explain, void-import, state save/load |
Features
| Feature | Default | Description |
|---|---|---|
std |
yes | Standard library support (thiserror, serde/std) |
alloc |
yes | Heap allocation support for no_std targets |
http |
no | HTTP client for live federation execution via ureq |
wasm |
no | WebAssembly bindings (wasm-bindgen, js-sys) |
edge |
no | Edge device compile-time gates |
ml |
no | Neural-network inference engine (no-std compatible via libm) |
dropout |
no | Dropout regularization layer (requires ml) |
rl |
no | Reinforcement learning policy (UCB, Q-learning) |
cache |
no | In-memory query result cache with TTL |
p2p |
no | P2P / IPFS source kind — type-level scoring, no network deps |
agent |
no | Self-describing action primitives for LLM agent runtimes |
sparql |
no | Pure-Rust SPARQL prefix expansion and projection extraction |
void |
no | Declarative source registration via VoID/Turtle (Router::register_from_void_ttl) |
geo |
no | Physical-brain context via oxigdal-core / oxigdal-proj |
device |
no | Body-brain context via mielin-hal |
load |
no | Situation-brain context via celers-core |
legal |
no | Social-brain context via legalis-core |
ecosystem |
no | All four brains: geo + device + load + legal |
full |
no | ml + rl + cache + ecosystem |
observability |
no | tracing spans + metrics counters/histograms (zero-cost when disabled) |
cli |
no | Activates everything required by the oxirouter-cli binary (std + agent + sparql + void) |
Quick Start
Add to Cargo.toml:
[]
= "0.1"
use SourceCapabilities;
use *;
Learning from outcomes
let ranking = router.route_and_log?;
let query_id = query.predicate_hash;
// After executing the query, feed back the observed outcome:
router.learn_from_outcome?;
SPARQL Integration
Enable with features = ["sparql"].
Query::from_sparql performs accurate PREFIX-declaration parsing and projection
extraction. Router::route_sparql is the single-call convenience wrapper:
Agent Actions
Enable with features = ["agent"]. OxiRouter exposes three self-describing
actions compatible with the OpenAI tool-call and Anthropic tool-use protocols.
| Action name | Description |
|---|---|
oxirouter.route |
Rank sources for a SPARQL query |
oxirouter.learn |
Record an observed query outcome |
oxirouter.explain |
Return a human-readable routing explanation |
oxirouter.route input schema (excerpt)
oxirouter.learn input fields
| Field | Type | Description |
|---|---|---|
query_id |
u64 |
Hash from a prior route call (Query::predicate_hash()) |
source_id |
string |
Source that was used |
success |
bool |
Whether the query executed successfully |
latency_ms |
u32 |
Observed latency in milliseconds |
result_count |
u32 |
Number of results returned |
oxirouter.explain output fields
| Field | Type | Description |
|---|---|---|
explanation |
string |
Human-readable routing rationale |
ranked_sources |
array |
Ranked source objects (id, endpoint, confidence, reason) |
Edge / WASM Deployment
OxiRouter targets wasm32-unknown-unknown with the release-edge profile
(fat LTO, opt-level = "z", panic = "abort", stripped symbols).
# Install the WASM target once
# Standard edge build (features: alloc,wasm,ml,rl,cache)
# Minimal build without ML (smaller binary)
OXIROUTER_FEATURES=wasm
# Use the lighter release-wasm profile
OXIROUTER_PROFILE=release-wasm
The script validates the target, runs cargo build --no-default-features --features "alloc,${OXIROUTER_FEATURES}", reports the artifact size, and
runs wasm-opt -Oz --strip-debug automatically when binaryen is available.
Output artifact: target/wasm32-unknown-unknown/release-edge/oxirouter.wasm
License
Licensed under the Apache License, Version 2.0 (see LICENSE).