pub struct RotaryMemoryBridge { /* private fields */ }Expand description
Bridge that wraps rx4’s GraphMemory for agent memory (concepts, decisions, patterns, bugs) while keeping apollo’s SurrealDB for channel state, swarm coordination, and cron scheduling.
rx4’s GraphMemory is an in-memory knowledge graph with PageRank, community detection, and JSON persistence. It does not require SQLite (unlike rx4’s MemoryStore which uses rusqlite 0.37).
This bridge provides:
- Graph-based agent memory via rx4::GraphMemory (concepts, decisions, patterns)
- Conversation extraction via rx4::ConversationExtractor
- JSON persistence for the graph
TODO: Enable rx4’s memory feature to also get SQLite FTS5 full-text search
via rx4::MemoryStore. For now, apollo’s SurrealDB backend remains
the primary persistent memory for conversation history and key-value store.
Implementations§
Source§impl RotaryMemoryBridge
impl RotaryMemoryBridge
Sourcepub fn extract_conversation(
&mut self,
conversation: &[ConversationTurn],
) -> ExtractionResult
pub fn extract_conversation( &mut self, conversation: &[ConversationTurn], ) -> ExtractionResult
Extract memory nodes and edges from a conversation and add them to the graph.
This uses rx4’s ConversationExtractor to identify concepts, decisions, and patterns from the conversation, then adds them as nodes in the GraphMemory.
Sourcepub fn search(&self, query: &str) -> Vec<&GraphMemoryNode>
pub fn search(&self, query: &str) -> Vec<&GraphMemoryNode>
Search the graph memory for nodes matching the query.
Sourcepub fn pagerank(&self) -> Vec<(String, f64)>
pub fn pagerank(&self) -> Vec<(String, f64)>
Get PageRank scores for all nodes (identifies the most important concepts/decisions in the agent’s memory).
Sourcepub fn stats(&self) -> GraphStats
pub fn stats(&self) -> GraphStats
Get graph statistics (node count, edge count, etc.)
Sourcepub fn save(&self) -> Result<(), GraphMemoryError>
pub fn save(&self) -> Result<(), GraphMemoryError>
Save the graph to disk (JSON format).
Sourcepub fn load(&mut self) -> Result<(), GraphMemoryError>
pub fn load(&mut self) -> Result<(), GraphMemoryError>
Load the graph from disk (JSON format).
Sourcepub fn graph(&self) -> &GraphMemory
pub fn graph(&self) -> &GraphMemory
Get a reference to the inner GraphMemory.
Sourcepub fn graph_mut(&mut self) -> &mut GraphMemory
pub fn graph_mut(&mut self) -> &mut GraphMemory
Get a mutable reference to the inner GraphMemory.
Auto Trait Implementations§
impl Freeze for RotaryMemoryBridge
impl RefUnwindSafe for RotaryMemoryBridge
impl Send for RotaryMemoryBridge
impl Sync for RotaryMemoryBridge
impl Unpin for RotaryMemoryBridge
impl UnsafeUnpin for RotaryMemoryBridge
impl UnwindSafe for RotaryMemoryBridge
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
impl<A, B, T> HttpServerConnExec<A, B> for Twhere
B: Body,
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