pub struct HiveMind { /* private fields */ }Expand description
The central orchestrator of PulseHive.
Owns the substrate, LLM providers, approval handler, and event bus.
Constructed exclusively via HiveMind::builder().
Implementations§
Source§impl HiveMind
impl HiveMind
Sourcepub fn builder() -> HiveMindBuilder
pub fn builder() -> HiveMindBuilder
Creates a new builder for constructing a HiveMind.
Sourcepub fn substrate(&self) -> &dyn SubstrateProvider
pub fn substrate(&self) -> &dyn SubstrateProvider
Access the substrate provider for direct operations.
Sourcepub async fn deploy(
&self,
agents: Vec<AgentDefinition>,
tasks: Vec<Task>,
) -> Result<Pin<Box<dyn Stream<Item = HiveEvent> + Send>>>
pub async fn deploy( &self, agents: Vec<AgentDefinition>, tasks: Vec<Task>, ) -> Result<Pin<Box<dyn Stream<Item = HiveEvent> + Send>>>
Deploy agents to execute tasks. Returns a stream of events.
Each agent is spawned as a Tokio task and dispatched via
the workflow module’s dispatch_agent() which handles all agent kinds
(LLM, Sequential, Parallel, Loop).
Automatically subscribes to the PulseDB Watch system for the collective,
forwarding substrate change events as HiveEvent::WatchNotification.
If Watch subscription fails, agents still execute normally (graceful degradation).
Sourcepub async fn record_experience(
&self,
experience: NewExperience,
) -> Result<ExperienceId>
pub async fn record_experience( &self, experience: NewExperience, ) -> Result<ExperienceId>
Record an experience in the substrate.
Stores the experience via PulseDB, emits an ExperienceRecorded event,
runs the RelationshipDetector to infer relations, and triggers the
InsightSynthesizer if a cluster exceeds the density threshold.
Sourcepub fn shutdown(&self)
pub fn shutdown(&self)
Signal shutdown to all background tasks (Watch system).
Sets the shutdown flag, causing the Watch background task to stop after processing its current event. This is non-blocking.
Sourcepub fn is_shutdown(&self) -> bool
pub fn is_shutdown(&self) -> bool
Returns true if shutdown has been signaled.
Sourcepub async fn redeploy(
&self,
agents: Vec<AgentDefinition>,
task: Task,
) -> Result<()>
pub async fn redeploy( &self, agents: Vec<AgentDefinition>, task: Task, ) -> Result<()>
Redeploy agents on the existing substrate and event bus.
Use this to restart failed agents. Products typically call this when
they observe AgentCompleted { outcome: Error { .. } } on the event stream.
The collective is created/resolved from the task, same as in HiveMind::deploy().
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for HiveMind
impl !RefUnwindSafe for HiveMind
impl Send for HiveMind
impl Sync for HiveMind
impl Unpin for HiveMind
impl UnsafeUnpin for HiveMind
impl !UnwindSafe for HiveMind
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more