Expand description
The Semantic Infrastructure for Intelligent Applications
Enabling enterprises to build secure, scalable, and intelligent distributed systems
Features • Quick Start • Platforms • ESP32 Setup • Website
§AIngle Minimal
Ultra-lightweight AIngle node for IoT devices with < 1MB RAM footprint. Supports ESP32, Raspberry Pi, and desktop platforms.
§Features
| Feature | Description | Use Case |
|---|---|---|
coap | CoAP protocol (default) | IoT communication |
rest | REST API server | SDK integration |
sqlite | SQLite storage | Edge devices |
rocksdb | RocksDB storage | High-performance |
ble | Bluetooth LE (Desktop) | macOS/Linux/Windows |
ble-esp32 | Bluetooth LE (ESP32) | Embedded IoT |
webrtc | WebRTC transport | Browser nodes |
hw_wallet | Ledger/Trezor support | Secure signing |
smart_agents | HOPE AI agents | Edge intelligence |
§Quick Start
# Cargo.toml
[dependencies]
aingle_minimal = "0.3"use aingle_minimal::{MinimalNode, Config};
fn main() -> Result<(), Box<dyn std::error::Error>> {
let config = Config::iot_mode();
let mut node = MinimalNode::new(config)?;
smol::block_on(node.run())?;
Ok(())
}§REST API & SDKs
Enable the rest feature to expose an HTTP API for SDK integration:
# Run with REST API on port 8080
aingle-minimal run --rest-port 8080§Endpoints
| Method | Path | Description |
|---|---|---|
| GET | /api/v1/info | Node information |
| POST | /api/v1/entries | Create entry |
| GET | /api/v1/entries/:hash | Get entry |
| GET | /api/v1/peers | List peers |
| GET | /api/v1/stats | Statistics |
§Official SDKs
| Language | Package |
|---|---|
| JavaScript | @apilium/aingle-sdk |
| Python | aingle-sdk |
| Go | aingle-sdk-go |
| Swift | AIngleSDK |
| Kotlin | aingle-sdk |
§Platform Support
| Platform | Target | BLE Feature |
|---|---|---|
| macOS | aarch64-apple-darwin | ble |
| Linux | x86_64-unknown-linux-gnu | ble |
| Windows | x86_64-pc-windows-msvc | ble |
| ESP32 | xtensa-esp32-espidf | ble-esp32 |
| ESP32-C3 | riscv32imc-esp-espidf | ble-esp32 |
| ESP32-S3 | xtensa-esp32s3-espidf | ble-esp32 |
§ESP32 Setup
To compile for ESP32 with Bluetooth LE:
§1. Install ESP Toolchain
# Install espup (ESP Rust toolchain installer)
cargo install espup
espup install
# Source the environment (add to .bashrc/.zshrc)
. $HOME/export-esp.sh§2. Create sdkconfig.defaults
# Required for BLE
CONFIG_BT_ENABLED=y
CONFIG_BT_BLE_ENABLED=y
CONFIG_BT_BLUEDROID_ENABLED=n
CONFIG_BT_NIMBLE_ENABLED=y
# Optional: Persist bonding info
CONFIG_BT_NIMBLE_NVS_PERSIST=y§3. Build
# For ESP32
cargo build --target xtensa-esp32-espidf --features ble-esp32
# For ESP32-C3 (RISC-V)
cargo build --target riscv32imc-esp-espidf --features ble-esp32
# For ESP32-S3
cargo build --target xtensa-esp32s3-espidf --features ble-esp32§4. Flash
espflash flash target/xtensa-esp32-espidf/release/your-app§Memory Budget
| Component | Budget |
|---|---|
| Runtime | 128KB |
| Crypto | 64KB |
| Network | 128KB |
| Storage | 128KB |
| App | 64KB |
| Total | 512KB |
§License
Apache 2.0 - See LICENSE
§Links
§AIngle Minimal - Ultra-Lightweight IoT Node
Minimal AIngle node implementation optimized for resource-constrained IoT devices.
§Overview
This crate provides a complete AIngle node that runs on devices with less than 1MB RAM, making it suitable for ESP32, Arduino, Raspberry Pi Pico, and similar embedded systems.
§Features
- Ultra-light footprint: Target <512KB RAM, <5MB storage
- Sub-second confirmation: Configurable publish intervals (default 5s)
- Zero-fee transactions: No staking or gas fees required
- Mesh networking: WiFi Direct, BLE, LoRa, Zigbee support
- Battery-aware: Adaptive power modes (deep sleep, light sleep, active)
- CoAP Protocol: Lightweight alternative to HTTP for IoT
- DTLS Security: Encrypted communications with PSK or certificates
- OTA Updates: Secure over-the-air firmware updates
- Smart Agents: Optional AI capabilities for edge intelligence
§Quick Start
use aingle_minimal::{MinimalNode, Config};
fn main() -> Result<(), Box<dyn std::error::Error>> {
// Create node with IoT-optimized config
let config = Config::iot_mode();
let mut node = MinimalNode::new(config)?;
// Run the node
smol::block_on(node.run())?;
Ok(())
}§Advanced Examples
§Sensor Integration
use aingle_minimal::{MinimalNode, SensorManager, SensorType, Config};
fn main() -> Result<(), Box<dyn std::error::Error>> {
let mut node = MinimalNode::new(Config::iot_mode())?;
let mut sensors = SensorManager::new();
// Add temperature sensor
sensors.add_sensor(SensorType::Temperature, 0x48)?;
// Read and publish sensor data
let reading = sensors.read(SensorType::Temperature)?;
node.publish_sensor_data(reading)?;
Ok(())
}§CoAP Server
use aingle_minimal::{CoapServer, CoapConfig};
async fn run() -> Result<(), Box<dyn std::error::Error>> {
let config = CoapConfig::default();
let server = CoapServer::new(config).await?;
// Register resource handlers
server.register_resource("/temperature", |req| {
// Handle GET /temperature
Ok("23.5".into())
});
server.run().await?;
Ok(())
}§Power Management
use aingle_minimal::{PowerManager, PowerProfile, BatteryInfo};
fn main() -> Result<(), Box<dyn std::error::Error>> {
let mut power = PowerManager::new();
// Check battery and adjust power mode
let battery = power.battery_info()?;
if battery.percentage < 20.0 {
power.set_profile(PowerProfile::PowerSave)?;
}
// Sleep when idle
power.sleep(std::time::Duration::from_secs(10))?;
Ok(())
}§Smart Agent (Edge AI)
use aingle_minimal::{SmartNode, SmartNodeConfig, SensorAdapter};
let config = SmartNodeConfig::default();
let mut smart_node = SmartNode::new(config)?;
// Agent learns from sensor patterns
let adapter = SensorAdapter::new();
smart_node.attach_sensor(adapter);
// Run agent loop
loop {
smart_node.step()?;
smol::Timer::after(std::time::Duration::from_secs(1)).await;
}§Memory Budget
| Component | Budget |
|---|---|
| Runtime | 128KB |
| Crypto | 64KB |
| Network | 128KB |
| Storage | 128KB |
| App | 64KB |
| Total | 512KB |
§Feature Flags
| Feature | Description | Dependencies |
|---|---|---|
coap | CoAP server and client (default) | coap-lite |
sqlite | SQLite storage backend | rusqlite |
rocksdb | RocksDB storage backend (faster) | rocksdb |
webrtc | WebRTC transport for browsers | webrtc, bytes |
ble | Bluetooth LE for Desktop (macOS/Linux/Windows) | btleplug, uuid |
ble-esp32 | Bluetooth LE for ESP32 devices | esp32-nimble |
hw_wallet | Hardware wallet support (Ledger/Trezor) | ledger-transport-hid |
ai_memory | Titans memory system for agents | titans_memory |
smart_agents | HOPE agents integration | hope_agents |
no_std | Compile without standard library | - |
§Platform Support
| Platform | Target | BLE Feature |
|---|---|---|
| macOS | x86_64-apple-darwin, aarch64-apple-darwin | ble |
| Linux | x86_64-unknown-linux-gnu | ble |
| Windows | x86_64-pc-windows-msvc | ble |
| ESP32 | xtensa-esp32-espidf | ble-esp32 |
| ESP32-C3 | riscv32imc-esp-espidf | ble-esp32 |
| ESP32-S3 | xtensa-esp32s3-espidf | ble-esp32 |
| Raspberry Pi Pico | thumbv6m-none-eabi | - |
§ESP32 Setup (ble-esp32 feature)
To compile for ESP32 with Bluetooth LE support:
§1. Install ESP-IDF Toolchain
# Install espup (ESP Rust toolchain installer)
cargo install espup
espup install
# Source the environment
. $HOME/export-esp.sh§2. Create sdkconfig.defaults
CONFIG_BT_ENABLED=y
CONFIG_BT_BLE_ENABLED=y
CONFIG_BT_BLUEDROID_ENABLED=n
CONFIG_BT_NIMBLE_ENABLED=y
CONFIG_BT_NIMBLE_NVS_PERSIST=y§3. Build for ESP32
cargo build --target xtensa-esp32-espidf --features ble-esp32Re-exports§
pub use config::StorageBackendType;pub use storage_factory::DynamicStorage;pub use storage_trait::StorageBackend;pub use storage_trait::StorageStats;pub use coap::CoapConfig;pub use coap::CoapServer;pub use config::Config;pub use config::GossipConfig;pub use config::MeshMode;pub use config::PowerMode;pub use config::StorageConfig;pub use config::TransportConfig;pub use discovery::DiscoveredPeer;pub use discovery::Discovery;pub use dtls::DtlsConfig;pub use dtls::DtlsSession;pub use dtls::SecureCoap;pub use dtls::SecurityMode;pub use error::CryptoError;pub use error::Error;pub use error::GossipError;pub use error::NetworkError;pub use error::Result;pub use error::StorageError;pub use error::SyncError;pub use gossip::BloomFilter;pub use gossip::GossipManager;pub use gossip::GossipStats;pub use gossip::MessagePriority;pub use gossip::TokenBucket;pub use graph::GraphStats as SemanticGraphStats;pub use graph::SemanticGraph;pub use graph::SemanticQuery;pub use graph::SemanticTriple;pub use graph::TripleObject;pub use node::MinimalNode;pub use node::PeerRecord;pub use ota::OtaManager;pub use ota::UpdateChannel;pub use ota::UpdateInfo;pub use ota::UpdateState;pub use power::BatteryInfo;pub use power::PowerManager;pub use power::PowerProfile;pub use sensors::CalibrationParams;pub use sensors::Sensor;pub use sensors::SensorManager;pub use sensors::SensorReading;pub use sensors::SensorType;pub use sync::PeerSyncState;pub use sync::SyncManager;pub use sync::SyncResult;pub use sync::SyncStats;pub use types::*;
Modules§
- coap
- CoAP Transport for IoT nodes
- config
- Configuration for the minimal AIngle node.
- crypto
- Minimal cryptography for IoT nodes
- discovery
- Multi-protocol peer discovery for AIngle nodes
- dtls
- DTLS Security Layer for CoAP
- error
- Error types for the minimal AIngle node.
- gossip
- Optimized Gossip Protocol for AIngle Minimal
- graph
- Semantic Graph integration for AIngle Minimal
- network
- Minimal networking for IoT nodes
- node
- The main
MinimalNodeimplementation. - ota
- Over-The-Air (OTA) Update Manager for IoT Devices
- power
- Power Management for IoT Devices
- sensors
- Sensor Abstraction Layer for IoT Devices
- storage
- SQLite storage backend for IoT nodes
- storage_
factory - Storage factory for dynamic backend selection
- storage_
trait - Storage backend trait definition
- sync
- Node-to-node synchronization protocol
- types
- Core data types for the minimal AIngle node.
Constants§
- ENV_
IOT_ MODE - Environment variable for enabling IoT mode.
- ENV_
PUBLISH_ INTERVAL - Environment variable for configuring publish interval.
- MEMORY_
BUDGET - Target memory budget in bytes (512KB).
- MSRV
- Minimum supported Rust version.
- VERSION
- Version information for the crate.