pulsehive 2.0.0

Shared Consciousness SDK for Multi-Agent AI Systems
Documentation

PulseHive

Shared Consciousness SDK for Multi-Agent AI Systems

PulseHive is a Rust SDK where AI agents share knowledge through a persistent substrate (PulseDB) instead of passing messages. Agents perceive each other's experiences through configurable lenses, enabling implicit coordination without explicit communication.

This is the meta-crate — it re-exports pulsehive-core and pulsehive-runtime with optional LLM providers.

Quick Start

[dependencies]
pulsehive = { version = "1.0", features = ["openai"] }
tokio = { version = "1", features = ["rt-multi-thread", "macros"] }
use pulsehive::prelude::*;
use pulsehive::{HiveMind, Task};

#[tokio::main]
async fn main() -> Result<()> {
    let hive = HiveMind::builder()
        .substrate_path("my_project.db")
        .llm_provider("openai", my_provider)
        .build()?;

    let agent = AgentDefinition {
        name: "analyzer".into(),
        kind: AgentKind::Llm(Box::new(LlmAgentConfig {
            system_prompt: "You are a code analysis expert.".into(),
            tools: vec![],
            lens: Lens::new(["code", "architecture"]),
            llm_config: LlmConfig::new("openai", "gpt-4"),
            experience_extractor: None,
            refresh_every_n_tool_calls: None,
        })),
    };

    let mut stream = hive.deploy(vec![agent], vec![Task::new("Analyze codebase")]).await?;
    while let Some(event) = stream.next().await {
        println!("{event:?}");
    }
    Ok(())
}

Feature Flags

Flag Enables Dependency
openai OpenAI, Azure, Ollama, vLLM, Groq, Together pulsehive-openai
anthropic Claude Opus, Sonnet, Haiku pulsehive-anthropic

Core Primitives

Primitive Purpose
HiveMind Orchestrator — deploys agents, manages substrate
Agent LLM-powered or workflow (Sequential/Parallel/Loop)
Tool Pluggable capability given to agents
Lens Perception filter — how an agent sees the substrate
Experience Knowledge unit stored in PulseDB

Multi-Agent Workflows

// Sequential: each agent perceives previous results via substrate
let pipeline = AgentDefinition {
    name: "pipeline".into(),
    kind: AgentKind::Sequential(vec![researcher, summarizer]),
};

// Parallel: agents work concurrently, sharing substrate in real-time
let team = AgentDefinition {
    name: "team".into(),
    kind: AgentKind::Parallel(vec![frontend_reviewer, backend_reviewer]),
};

// Loop: repeat until [LOOP_DONE] or max iterations
let refiner = AgentDefinition {
    name: "refiner".into(),
    kind: AgentKind::Loop { agent: Box::new(writer), max_iterations: 5 },
};

Language Bindings

Links

License

AGPL-3.0-only