AgenticDB

Struct AgenticDB 

Source
pub struct AgenticDB { /* private fields */ }
Expand description

Main AgenticDB interface

Implementations§

Source§

impl AgenticDB

Source

pub fn new(options: DbOptions) -> Result<Self>

Create a new AgenticDB with the given options and default hash-based embeddings

Source

pub fn with_embedding_provider( options: DbOptions, embedding_provider: BoxedEmbeddingProvider, ) -> Result<Self>

Create a new AgenticDB with a custom embedding provider

§Example with API embeddings
use ruvector_core::{AgenticDB, ApiEmbedding};
use ruvector_core::types::DbOptions;
use std::sync::Arc;

let mut options = DbOptions::default();
options.dimensions = 1536; // OpenAI embedding dimensions
options.storage_path = "agenticdb.db".to_string();

let provider = Arc::new(ApiEmbedding::openai("sk-...", "text-embedding-3-small"));
let db = AgenticDB::with_embedding_provider(options, provider)?;
§Example with Candle (requires feature flag)
use ruvector_core::{AgenticDB, CandleEmbedding};
use ruvector_core::types::DbOptions;
use std::sync::Arc;

let mut options = DbOptions::default();
options.dimensions = 384; // MiniLM dimensions
options.storage_path = "agenticdb.db".to_string();

let provider = Arc::new(CandleEmbedding::from_pretrained(
    "sentence-transformers/all-MiniLM-L6-v2",
    false
)?);
let db = AgenticDB::with_embedding_provider(options, provider)?;
Source

pub fn with_dimensions(dimensions: usize) -> Result<Self>

Create with default options and hash-based embeddings

Source

pub fn embedding_provider_name(&self) -> &str

Get the embedding provider name (for debugging/logging)

Source

pub fn insert(&self, entry: VectorEntry) -> Result<VectorId>

Insert a vector entry

Source

pub fn insert_batch(&self, entries: Vec<VectorEntry>) -> Result<Vec<VectorId>>

Insert multiple vectors in a batch

Source

pub fn search(&self, query: SearchQuery) -> Result<Vec<SearchResult>>

Search for similar vectors

Source

pub fn delete(&self, id: &str) -> Result<bool>

Delete a vector by ID

Source

pub fn get(&self, id: &str) -> Result<Option<VectorEntry>>

Get a vector by ID

Source

pub fn store_episode( &self, task: String, actions: Vec<String>, observations: Vec<String>, critique: String, ) -> Result<String>

Store a reflexion episode with self-critique

Source

pub fn retrieve_similar_episodes( &self, query: &str, k: usize, ) -> Result<Vec<ReflexionEpisode>>

Retrieve similar reflexion episodes

Source

pub fn create_skill( &self, name: String, description: String, parameters: HashMap<String, String>, examples: Vec<String>, ) -> Result<String>

Create a new skill in the library

Source

pub fn search_skills( &self, query_description: &str, k: usize, ) -> Result<Vec<Skill>>

Search skills by description

Source

pub fn auto_consolidate( &self, action_sequences: Vec<Vec<String>>, success_threshold: usize, ) -> Result<Vec<String>>

Auto-consolidate action sequences into skills

Source

pub fn add_causal_edge( &self, causes: Vec<String>, effects: Vec<String>, confidence: f64, context: String, ) -> Result<String>

Add a causal edge (supporting hypergraphs with multiple causes/effects)

Source

pub fn query_with_utility( &self, query: &str, k: usize, alpha: f64, beta: f64, gamma: f64, ) -> Result<Vec<UtilitySearchResult>>

Query with utility function: U = α·similarity + β·causal_uplift − γ·latency

Source

pub fn start_session( &self, algorithm: String, state_dim: usize, action_dim: usize, ) -> Result<String>

Start a new learning session

Source

pub fn add_experience( &self, session_id: &str, state: Vec<f32>, action: Vec<f32>, reward: f64, next_state: Vec<f32>, done: bool, ) -> Result<()>

Add an experience to a learning session

Source

pub fn predict_with_confidence( &self, session_id: &str, state: Vec<f32>, ) -> Result<Prediction>

Predict action with confidence interval

Source

pub fn get_session(&self, session_id: &str) -> Result<Option<LearningSession>>

Get learning session by ID

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts 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
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more