pub struct Config {
pub embedding_provider: EmbeddingProvider,
pub embedding_dimension: EmbeddingDimension,
pub default_collective: Option<CollectiveId>,
pub cache_size_mb: usize,
pub sync_mode: SyncMode,
pub hnsw: HnswConfig,
pub activity: ActivityConfig,
pub watch: WatchConfig,
}Expand description
Database configuration options.
All fields have sensible defaults. Use struct update syntax to override specific settings:
use pulsedb::Config;
let config = Config {
cache_size_mb: 256,
..Default::default()
};Fields§
§embedding_provider: EmbeddingProviderHow embeddings are generated or provided.
embedding_dimension: EmbeddingDimensionEmbedding vector dimension (must match provider output).
default_collective: Option<CollectiveId>Default collective for operations when none specified.
cache_size_mb: usizeCache size in megabytes for the storage engine.
Higher values improve read performance but use more memory. Default: 64 MB
sync_mode: SyncModeDurability mode for write operations.
hnsw: HnswConfigHNSW vector index parameters.
Controls the quality and performance of semantic search.
See HnswConfig for tuning guidelines.
activity: ActivityConfigAgent activity tracking parameters.
Controls staleness detection for agent heartbeats.
See ActivityConfig for details.
watch: WatchConfigWatch system parameters.
Controls the in-process event notification channel.
See WatchConfig for details.
Implementations§
Source§impl Config
impl Config
Sourcepub fn with_builtin_embeddings() -> Self
pub fn with_builtin_embeddings() -> Self
Creates a Config for builtin embedding generation.
This requires the builtin-embeddings feature to be enabled.
§Example
use pulsedb::Config;
let config = Config::with_builtin_embeddings();Sourcepub fn with_external_embeddings(dimension: EmbeddingDimension) -> Self
pub fn with_external_embeddings(dimension: EmbeddingDimension) -> Self
Creates a Config for external embedding provider.
When using external embeddings, you must provide pre-computed embedding vectors when recording experiences.
§Example
use pulsedb::{Config, EmbeddingDimension};
// OpenAI ada-002 uses 1536 dimensions
let config = Config::with_external_embeddings(EmbeddingDimension::Custom(1536));Trait Implementations§
Auto Trait Implementations§
impl Freeze for Config
impl RefUnwindSafe for Config
impl Send for Config
impl Sync for Config
impl Unpin for Config
impl UnsafeUnpin for Config
impl UnwindSafe for Config
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
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