@@ -119,6 +119,14 @@ pub struct RecallRequest {
119119 pub include_stale : Option < bool > ,
120120 pub include_invalidated : Option < bool > ,
121121 pub time_range : Option < TimeRange > ,
122+ /// Point-in-time filter. Keeps rows whose validity window (`t_valid` or
123+ /// `created_at` through `t_invalid`) covered this instant.
124+ /// `include_invalidated = true` drops the end check.
125+ ///
126+ /// Scoring and `include_stale` still use the current clock, so a row that
127+ /// was fresh at `as_of` but is stale today still gets dropped. `as_of`
128+ /// asks "what did we know at T", it does not replay the whole pipeline at T.
129+ pub as_of : Option < DateTime < Utc > > ,
122130 pub validate_ids : Option < Vec < String > > ,
123131 pub explain : bool ,
124132}
@@ -151,6 +159,58 @@ pub struct StatsRequest {
151159 pub diagnostics : Option < bool > ,
152160}
153161
162+ #[ derive( Debug ) ]
163+ pub struct TimelineRequest {
164+ pub entity : String ,
165+ pub namespace : Option < String > ,
166+ pub limit : Option < usize > ,
167+ pub types : Option < Vec < MemoryType > > ,
168+ pub include_invalidated : Option < bool > ,
169+ }
170+
171+ #[ derive( Debug , Serialize ) ]
172+ pub struct TimelineEntry {
173+ pub memory : Memory ,
174+ pub occurred_at : DateTime < Utc > ,
175+ }
176+
177+ #[ derive( Debug , Serialize ) ]
178+ pub struct TimelineResponse {
179+ pub entity : String ,
180+ pub resolved_entity_id : Option < String > ,
181+ pub entries : Vec < TimelineEntry > ,
182+ }
183+
184+ #[ derive( Debug ) ]
185+ pub struct TaxonomyRequest {
186+ pub namespace : Option < String > ,
187+ pub limit : Option < usize > ,
188+ }
189+
190+ #[ derive( Debug , Serialize ) ]
191+ pub struct TaxonomyEntityEntry {
192+ pub name : String ,
193+ pub memory_count : u64 ,
194+ }
195+
196+ #[ derive( Debug , Serialize ) ]
197+ pub struct TaxonomyPredicateEntry {
198+ pub predicate : String ,
199+ pub count : u64 ,
200+ }
201+
202+ #[ derive( Debug , Serialize ) ]
203+ pub struct TaxonomyResponse {
204+ pub namespace : String ,
205+ pub total_memories : u64 ,
206+ pub by_type : HashMap < MemoryType , u64 > ,
207+ pub top_entities : Vec < TaxonomyEntityEntry > ,
208+ pub top_predicates : Vec < TaxonomyPredicateEntry > ,
209+ /// Distinct namespaces with live memories. `None` when the request was scoped.
210+ #[ serde( skip_serializing_if = "Option::is_none" ) ]
211+ pub all_namespaces : Option < Vec < String > > ,
212+ }
213+
154214#[ derive( Debug , Serialize ) ]
155215pub struct StoreResponse {
156216 pub id : String ,
0 commit comments