pub struct ServerConfig {Show 19 fields
pub host: String,
pub port: u16,
pub storage_path: PathBuf,
pub max_users_in_memory: usize,
pub audit_max_entries_per_user: usize,
pub audit_rotation_check_interval: usize,
pub audit_retention_days: u64,
pub rate_limit_per_second: u64,
pub rate_limit_burst: u32,
pub max_concurrent_requests: usize,
pub request_timeout_secs: u64,
pub is_production: bool,
pub cors: CorsConfig,
pub maintenance_interval_secs: u64,
pub activation_decay_factor: f32,
pub backup_interval_secs: u64,
pub backup_max_count: usize,
pub backup_enabled: bool,
pub max_entities_per_memory: usize,
}Expand description
Server configuration loaded from environment with defaults
Fields§
§host: StringServer host address (default: 127.0.0.1) Set to 0.0.0.0 for Docker or network-accessible deployments
port: u16Server port (default: 3030)
storage_path: PathBufStorage path for RocksDB (default: platform data dir, e.g. ~/.local/share/shodh-memory/)
max_users_in_memory: usizeMaximum users to keep in memory LRU cache (default: 1000)
audit_max_entries_per_user: usizeMaximum audit log entries per user (default: 10000)
audit_rotation_check_interval: usizeAudit log rotation check interval (default: 100)
audit_retention_days: u64Audit log retention days (default: 30)
rate_limit_per_second: u64Rate limit: requests per second (default: 4000 - LLM-friendly)
rate_limit_burst: u32Rate limit: burst size (default: 8000 - allows rapid agent bursts)
max_concurrent_requests: usizeMaximum concurrent requests (default: 200)
request_timeout_secs: u64Request timeout in seconds (default: 60) Requests exceeding this duration are terminated with 408 status
is_production: boolWhether running in production mode
cors: CorsConfigCORS configuration
maintenance_interval_secs: u64Memory maintenance interval in seconds (default: 300 = 5 minutes) Controls how often consolidation and activation decay run
activation_decay_factor: f32Activation decay factor per maintenance cycle (default: 0.95) Memories lose 5% activation each cycle: A_new = A_old * 0.95
backup_interval_secs: u64Backup configuration Automatic backup interval in seconds (default: 86400 = 24 hours) Set to 0 to disable automatic backups
backup_max_count: usizeMaximum backups to keep per user (default: 7) Older backups are automatically purged
backup_enabled: boolWhether backups are enabled (default: true in production, false in dev)
max_entities_per_memory: usizeMaximum entities extracted per memory for graph insertion (default: 10) Caps the number of NER/tag/regex entities to prevent O(n²) edge explosion in the knowledge graph. 10 entities → max 45 co-occurrence edges.
Implementations§
Trait Implementations§
Source§impl Clone for ServerConfig
impl Clone for ServerConfig
Source§fn clone(&self) -> ServerConfig
fn clone(&self) -> ServerConfig
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ServerConfig
impl Debug for ServerConfig
Auto Trait Implementations§
impl Freeze for ServerConfig
impl RefUnwindSafe for ServerConfig
impl Send for ServerConfig
impl Sync for ServerConfig
impl Unpin for ServerConfig
impl UnsafeUnpin for ServerConfig
impl UnwindSafe for ServerConfig
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> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>, which can then be
downcast into Box<dyn ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>, which can then be further
downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSend for T
impl<T> DowncastSend for T
Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
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