pub struct RootIndex {
pub version: u64,
pub updated_at: DateTime<Utc>,
pub active_context: Vec<RootEntry>,
pub recent_patterns: Vec<String>,
pub historical_summary: Vec<HistoricalPeriod>,
pub topics: Vec<TopicEntry>,
}Expand description
ROOT index — the “table of contents” for all agent knowledge.
Agents use this to understand what they know at a glance (O(1) lookup). Dream automatically rebuilds this on every run.
Fields§
§version: u64Index version (incremented on each dream).
updated_at: DateTime<Utc>Last update timestamp.
active_context: Vec<RootEntry>Active context entries (recent ~7 days).
recent_patterns: Vec<String>Recent patterns observed across sessions.
historical_summary: Vec<HistoricalPeriod>Historical summary (monthly breakdowns).
topics: Vec<TopicEntry>Topic index — all known topics with type and freshness.
Implementations§
Source§impl RootIndex
impl RootIndex
Sourcepub fn estimated_tokens(&self) -> usize
pub fn estimated_tokens(&self) -> usize
Estimate token count for this index (4 chars ≈ 1 token).
Sourcepub fn topic_matches_query(&self, topic: &TopicEntry, query: &str) -> bool
pub fn topic_matches_query(&self, topic: &TopicEntry, query: &str) -> bool
Check if a topic matches a query string.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for RootIndex
impl<'de> Deserialize<'de> for RootIndex
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for RootIndex
impl RefUnwindSafe for RootIndex
impl Send for RootIndex
impl Sync for RootIndex
impl Unpin for RootIndex
impl UnsafeUnpin for RootIndex
impl UnwindSafe for RootIndex
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