interplane.Get Omega
Read in your language

spark-hive

Multi-agent swarm coordination and peer routing engine

Brought by drakestapleton

branch main Branches Tags History

spark-hive / README.md

129 lines · 4535 bytes Raw Blame History Source

<p align="center"> <img src="assets/avatar.jpg" width="140" height="140" alt="AIEN Sovereign Intelligence" style="border-radius: 50%; border: 2px solid #f59e0b;"> </p>

spark-hive

Crates.io License Build

Native sovereign agent hive engine with 2D axial hexagonal geometry and autonomous consumer model adapter pipeline.

Overview

spark-hive is an autonomous multi-agent coordination engine written in native Rust. It organizes agent thoughts, Socratic inquiries, and subagent task completions onto a spatial 2D axial hexagonal lattice (q, r).

It includes a built-in Consumer Model Adapter Engine that benchmarks, optimizes, and generates upstream contribution pull requests for everyday open-weight models running on consumer hardware:

Features

Coordinate System

The engine uses standard axial coordinates (q, r) mapped to the six primary neighbor vectors:

DirectiondqdrLabel
0+10East
1+1-1Northeast
20-1Northwest
3-10West
4-1+1Southwest
50+1Southeast

Pixel mapping follows the flat-topped hexagonal layout with default radius R = 88px:

Quickstart

Add to your Cargo.toml:

[dependencies]
spark-hive = { git = "https://github.com/aien-dev/spark-hive.git" }

Basic Placement Example

use spark_hive::store::{CombStore, PlaceCombInput};

fn main() -> Result<(), Box<dyn std::error::Error>> {
    let store = CombStore::open_in_memory()?;
    
    // 1. Place genesis comb at origin (0, 0)
    let genesis = store.place_comb(PlaceCombInput {
        q: Some(0),
        r: Some(0),
        author: "AIEN".into(),
        role: Some("coordinator".into()),
        content: "Sovereign Hive Initialized".into(),
        intent: Some("independent".into()),
        parent_id: None,
    })?;

    // 2. Auto-place adjacent neighbor linked to genesis
    let child = store.place_comb(PlaceCombInput {
        q: None,
        r: None,
        author: "AIEN (Subagent)".into(),
        role: Some("researcher".into()),
        content: "Consumer adapter pipeline validated".into(),
        intent: Some("join".into()),
        parent_id: Some(genesis.id),
    })?;

    println!("Placed child comb at coordinates ({}, {})", child.q, child.r);
    Ok(())
}

Socratic Adapter Evaluation

use spark_hive::adapter_engine::{find_or_create_adapter, ConsumerModel, UpstreamEngine};

fn main() {
    let spec = find_or_create_adapter(ConsumerModel::Qwen2_5Coder1_5B, UpstreamEngine::Candle);
    println!("Adapter: {}", spec.title);
    println!("Estimated Latency: {}ms TTFT", spec.telemetry.time_to_first_token_ms);
}

Testing

Run the test suite:

cargo test

Verification covers:

Authors

License

Licensed under either of:

at your option.