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,
pub read_only: bool,
}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.
read_only: boolRead-only mode.
When true, all mutation methods (record_experience, store_relation,
etc.) return PulseDBError::ReadOnly. Read operations work normally.
Use this for read-only consumers like PulseVision that open the same database file a writer is using.
Default: false
Implementations§
Source§impl Config
impl Config
Sourcepub fn read_only() -> Self
pub fn read_only() -> Self
Creates a Config for read-only access.
All mutation methods will return PulseDBError::ReadOnly.
Use this for read-only consumers like visualization tools that
open the same database file a writer is using.
§Example
use pulsedb::Config;
let config = Config::read_only();
assert!(config.read_only);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