Expand description
§OxiRouter - Autonomous Semantic Federation Engine for the Edge
OxiRouter is a Pure Rust + WASM library implementing learned source selection for SPARQL federated queries with context-awareness (geo, network, device, legal).
§Features
- Learned Source Selection: ML-based routing using Naive Bayes and neural networks
- Context-Aware: Integrates with 4 “brains” (physical, body, situation, social)
- Edge-Ready: Optimized for constrained environments with no_std support
- WASM Compatible: Runs in browsers and edge runtimes
§Quick Start
use oxirouter::{Router, DataSource, Query};
// Create a router
let mut router = Router::new();
// Register data sources
router.add_source(DataSource::new("dbpedia", "https://dbpedia.org/sparql"));
router.add_source(DataSource::new("wikidata", "https://query.wikidata.org/sparql"));
// Route a query
let query = Query::parse("SELECT ?s WHERE { ?s a <http://schema.org/Person> }").unwrap();
let sources = router.route(&query);§Feature Flags
std(default) - Standard library supportalloc(default) - Heap allocationno_std- Embedded/bare-metal environmentswasm- WebAssembly bindingsml- Machine learning inferencerl- Reinforcement learning feedbackcache- Query result and context caching with LRU evictionecosystem- Full ecosystem integration (4 brains)agent- Agent action primitives for LLM/agent runtime integration
Re-exports§
pub use crate::core::error::OxiRouterError;pub use crate::core::error::Result;pub use crate::core::query::Query;pub use crate::core::query_log::QueryLog;pub use crate::core::query_log::RoutingLogEntry;pub use crate::core::query_log::RoutingOutcome;pub use crate::core::query_log::SourceLogStats;pub use crate::core::router::CircuitBreakerConfig;pub use crate::core::router::Router;pub use crate::core::router::RouterConfig;pub use crate::core::router::RoutingExplanation;pub use crate::core::router::ScoreComponent;pub use crate::core::source::DataSource;pub use crate::core::source::SourceKind;pub use context::CombinedContext;pub use context::ContextProvider;pub use context::DefaultContextProvider;pub use context::DeviceContext;pub use context::DeviceType;pub use context::NetworkType;pub use context::CircuitState;pub use context::LoadContext;pub use context::LegalContext;pub use context::sensor;pub use context::DeviceSensor;pub use context::NullDeviceSensor;pub use context::LoadSensor;pub use context::NullLoadSensor;pub use context::NullPolicyEngine;pub use context::PolicyEngine;pub use federation::planner::DefaultPlanner;pub use federation::planner::FederatedPlan;pub use federation::planner::FederatedPlanner;pub use federation::planner::SubPlan;pub use federation::AggregatedResult;pub use federation::AggregationStrategy;pub use federation::Aggregator;pub use federation::Executor;pub use federation::QueryResult;pub use crate::core::term::StructuredTriple;pub use crate::core::term::Term;
Modules§
- context
- Context providers for the 4 brains integration
- core
- Core module - Platform-agnostic core logic for OxiRouter
- federation
- Federation execution module
- prelude
- Prelude module for convenient imports - use
use oxirouter::prelude::*
Structs§
- Router
State - Serializable snapshot of a
Router’s full learnable state.