pub struct CognitionRuntime { /* private fields */ }Expand description
In-memory cognition runtime for perpetual persona swarms.
Implementations§
Source§impl CognitionRuntime
impl CognitionRuntime
Sourcepub fn new_from_env() -> Self
pub fn new_from_env() -> Self
Build runtime from environment feature flags.
Sourcepub fn new_with_options(options: CognitionRuntimeOptions) -> Self
pub fn new_with_options(options: CognitionRuntimeOptions) -> Self
Build runtime from explicit options.
Sourcepub fn is_enabled(&self) -> bool
pub fn is_enabled(&self) -> bool
Whether cognition is enabled by feature flag.
Sourcepub fn subscribe_events(&self) -> Receiver<ThoughtEvent>
pub fn subscribe_events(&self) -> Receiver<ThoughtEvent>
Subscribe to thought events for streaming.
Sourcepub async fn start(
&self,
req: Option<StartCognitionRequest>,
) -> Result<CognitionStatus>
pub async fn start( &self, req: Option<StartCognitionRequest>, ) -> Result<CognitionStatus>
Start the perpetual cognition loop.
Sourcepub async fn stop(&self, reason: Option<String>) -> Result<CognitionStatus>
pub async fn stop(&self, reason: Option<String>) -> Result<CognitionStatus>
Stop the perpetual cognition loop.
Sourcepub async fn create_persona(
&self,
req: CreatePersonaRequest,
) -> Result<PersonaRuntimeState>
pub async fn create_persona( &self, req: CreatePersonaRequest, ) -> Result<PersonaRuntimeState>
Create a persona record.
Sourcepub async fn spawn_child(
&self,
parent_id: &str,
req: SpawnPersonaRequest,
) -> Result<PersonaRuntimeState>
pub async fn spawn_child( &self, parent_id: &str, req: SpawnPersonaRequest, ) -> Result<PersonaRuntimeState>
Spawn a child persona under an existing parent.
Sourcepub async fn reap_persona(
&self,
persona_id: &str,
req: ReapPersonaRequest,
) -> Result<ReapPersonaResponse>
pub async fn reap_persona( &self, persona_id: &str, req: ReapPersonaRequest, ) -> Result<ReapPersonaResponse>
Reap one persona or the full descendant tree.
Sourcepub async fn latest_snapshot(&self) -> Option<MemorySnapshot>
pub async fn latest_snapshot(&self) -> Option<MemorySnapshot>
Get latest memory snapshot, if any.
Sourcepub async fn lineage_graph(&self) -> LineageGraph
pub async fn lineage_graph(&self) -> LineageGraph
Build lineage graph from current persona state.
Sourcepub async fn status(&self) -> CognitionStatus
pub async fn status(&self) -> CognitionStatus
Return a summary status.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for CognitionRuntime
impl !RefUnwindSafe for CognitionRuntime
impl Send for CognitionRuntime
impl Sync for CognitionRuntime
impl Unpin for CognitionRuntime
impl !UnwindSafe for CognitionRuntime
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
Mutably borrows from an owned value. Read more
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>
Converts
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>
Converts
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