pub struct ContextRequest {
pub collective_id: CollectiveId,
pub query_embedding: Vec<f32>,
pub max_similar: usize,
pub max_recent: usize,
pub include_insights: bool,
pub include_relations: bool,
pub include_active_agents: bool,
pub filter: SearchFilter,
pub recall_weights: Option<RecallWeights>,
}Expand description
Request for unified context retrieval.
Configures which primitives to query and how many results to return.
Pass this to PulseDB::get_context_candidates().
§Required Fields
collective_id- The collective to search within (must exist)query_embedding- Embedding vector for similarity and insight search (must match the collective’s embedding dimension)
§Example
use pulsedb::{ContextRequest, SearchFilter};
let candidates = db.get_context_candidates(ContextRequest {
collective_id,
query_embedding: query_vec,
max_similar: 10,
max_recent: 5,
include_insights: true,
filter: SearchFilter {
domains: Some(vec!["rust".to_string()]),
..SearchFilter::default()
},
..ContextRequest::default()
})?;Fields§
§collective_id: CollectiveIdThe collective to search within (must exist).
query_embedding: Vec<f32>Query embedding vector for similarity search and insight retrieval.
Must match the collective’s configured embedding dimension.
max_similar: usizeMaximum number of similar experiences to return (1-1000, default: 20).
max_recent: usizeMaximum number of recent experiences to return (1-1000, default: 10).
include_insights: boolWhether to include derived insights in the response (default: true).
include_relations: boolWhether to include relations for returned experiences (default: true).
include_active_agents: boolWhether to include active agent activities (default: true).
filter: SearchFilterFilter criteria applied to similar and recent experience queries.
recall_weights: Option<RecallWeights>Optional recall weights for similarity and temporal energy.
Forwarded to search() for the similar-experience query. Precedence:
these weights > the collective’s configured default_recall_weights
(per-collective stored config, else the global Config.decay) > legacy
pure-similarity ranking. So None preserves legacy ranking only when no
default is configured.
Trait Implementations§
Source§impl Clone for ContextRequest
impl Clone for ContextRequest
Source§fn clone(&self) -> ContextRequest
fn clone(&self) -> ContextRequest
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ContextRequest
impl Debug for ContextRequest
Auto Trait Implementations§
impl Freeze for ContextRequest
impl RefUnwindSafe for ContextRequest
impl Send for ContextRequest
impl Sync for ContextRequest
impl Unpin for ContextRequest
impl UnsafeUnpin for ContextRequest
impl UnwindSafe for ContextRequest
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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