pub struct AgentDBClient { /* private fields */ }Implementations§
Source§impl AgentDBClient
impl AgentDBClient
pub fn new(base_url: String) -> Self
pub fn with_api_key(self, api_key: String) -> Self
pub fn with_timeout(self, timeout: Duration) -> Self
Sourcepub async fn insert<T: Serialize>(
&self,
collection: &str,
id: &[u8],
embedding: &[f32],
metadata: Option<&T>,
) -> Result<InsertResponse>
pub async fn insert<T: Serialize>( &self, collection: &str, id: &[u8], embedding: &[f32], metadata: Option<&T>, ) -> Result<InsertResponse>
Insert single document
Sourcepub async fn batch_insert<T: Serialize>(
&self,
collection: &str,
documents: Vec<BatchDocument<T>>,
) -> Result<BatchInsertResponse>
pub async fn batch_insert<T: Serialize>( &self, collection: &str, documents: Vec<BatchDocument<T>>, ) -> Result<BatchInsertResponse>
Batch insert documents
Sourcepub async fn vector_search<T: DeserializeOwned>(
&self,
query: VectorQuery,
) -> Result<Vec<T>>
pub async fn vector_search<T: DeserializeOwned>( &self, query: VectorQuery, ) -> Result<Vec<T>>
Vector similarity search
Sourcepub async fn metadata_search<T: DeserializeOwned>(
&self,
query: MetadataQuery,
) -> Result<Vec<T>>
pub async fn metadata_search<T: DeserializeOwned>( &self, query: MetadataQuery, ) -> Result<Vec<T>>
Metadata-only search
Sourcepub async fn get<T: DeserializeOwned>(
&self,
collection: &str,
id: &[u8],
) -> Result<Option<T>>
pub async fn get<T: DeserializeOwned>( &self, collection: &str, id: &[u8], ) -> Result<Option<T>>
Get document by ID
Sourcepub async fn create_collection(&self, config: CollectionConfig) -> Result<()>
pub async fn create_collection(&self, config: CollectionConfig) -> Result<()>
Create collection
Sourcepub async fn health_check(&self) -> Result<HealthResponse>
pub async fn health_check(&self) -> Result<HealthResponse>
Health check
Source§impl AgentDBClient
Query templates for common operations
impl AgentDBClient
Query templates for common operations
Sourcepub async fn find_similar_conditions(
&self,
current: &Observation,
k: usize,
time_window_hours: Option<i64>,
) -> Result<Vec<Observation>>
pub async fn find_similar_conditions( &self, current: &Observation, k: usize, time_window_hours: Option<i64>, ) -> Result<Vec<Observation>>
Find similar market conditions Target: <1ms for k=10
Sourcepub async fn get_signals_by_strategy(
&self,
strategy_id: &str,
min_confidence: f64,
limit: usize,
) -> Result<Vec<Signal>>
pub async fn get_signals_by_strategy( &self, strategy_id: &str, min_confidence: f64, limit: usize, ) -> Result<Vec<Signal>>
Get signals by strategy Target: <1ms
Sourcepub async fn find_similar_decisions(
&self,
signal: &Signal,
k: usize,
) -> Result<Vec<Signal>>
pub async fn find_similar_decisions( &self, signal: &Signal, k: usize, ) -> Result<Vec<Signal>>
Find similar trading decisions Target: <1ms for k=10
Sourcepub async fn get_top_strategies(
&self,
min_score: f64,
limit: usize,
) -> Result<Vec<(String, f64)>>
pub async fn get_top_strategies( &self, min_score: f64, limit: usize, ) -> Result<Vec<(String, f64)>>
Get top performing strategies Target: <50ms for 1000 traces
Sourcepub async fn get_observations_in_range(
&self,
symbol: &str,
start_us: i64,
end_us: i64,
) -> Result<Vec<Observation>>
pub async fn get_observations_in_range( &self, symbol: &str, start_us: i64, end_us: i64, ) -> Result<Vec<Observation>>
Get observations in time range Target: <5ms for 1-hour window
Auto Trait Implementations§
impl Freeze for AgentDBClient
impl !RefUnwindSafe for AgentDBClient
impl Send for AgentDBClient
impl Sync for AgentDBClient
impl Unpin for AgentDBClient
impl !UnwindSafe for AgentDBClient
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