pub struct ExtractionConfig {Show 16 fields
pub provider: LlmProvider,
pub api_key: Option<String>,
pub api_url: String,
pub model: String,
pub region: Option<String>,
pub max_extractions_per_conversation: usize,
pub quality_threshold: f32,
pub deduplication_threshold: f32,
pub enable_contradiction_check: bool,
pub enable_deduplication: bool,
pub extraction_passes: usize,
pub max_output_tokens: u32,
pub effort: Option<String>,
pub reader_model: Option<String>,
pub request_timeout_secs: u64,
pub connect_timeout_secs: u64,
}Expand description
Configuration for the extraction pipeline.
Fields§
§provider: LlmProviderWhich LLM provider to use.
api_key: Option<String>API key for the provider (not needed for Ollama).
api_url: StringAPI endpoint URL (defaults based on provider).
Ignored for the Bedrock provider, whose endpoint is derived from
region and model per-request.
model: StringModel name to use.
region: Option<String>AWS region for the Bedrock provider (e.g. “us-east-1”). Ignored by all
other providers. Defaults from MENTEDB_LLM_REGION/AWS_REGION.
max_extractions_per_conversation: usizeMaximum number of memories to extract from a single conversation.
quality_threshold: f32Minimum confidence score for a memory to be accepted (0.0 to 1.0).
deduplication_threshold: f32Embedding similarity above which a memory is considered a duplicate (0.0 to 1.0).
enable_contradiction_check: boolWhether to check new memories against existing ones for contradictions.
enable_deduplication: boolWhether to check new memories against existing ones for duplicates.
extraction_passes: usizeNumber of extraction passes (1 = single pass, 2 = first pass + verification).
max_output_tokens: u32Output token ceiling for each LLM call. Claude 5.5 models think before answering by default and the thinking counts against this budget, so it must leave room for both. Only tokens actually produced are billed.
effort: Option<String>Reasoning effort for Claude models, sent as output_config.effort
(“low”, “medium”, “high”). None keeps the model default. Lower effort
thinks less, which is faster and cheaper.
reader_model: Option<String>Model for judge and rerank calls (reading and comparing memories),
when it should differ from model, which stays the extraction and
enrichment model. None uses model for both.
request_timeout_secs: u64Whole request timeout for one LLM call, in seconds.
connect_timeout_secs: u64Connection timeout for one LLM call, in seconds.
Implementations§
Source§impl ExtractionConfig
impl ExtractionConfig
Sourcepub fn with_output_env(self) -> Self
pub fn with_output_env(self) -> Self
Apply MENTEDB_LLM_MAX_OUTPUT_TOKENS and MENTEDB_LLM_EFFORT from the
environment, keeping the current values when they are unset or invalid.
Sourcepub fn reader_config(&self) -> Self
pub fn reader_config(&self) -> Self
The config for judge and rerank calls: this one with model set to
reader_model when that is given.
Sourcepub fn openai(api_key: impl Into<String>) -> Self
pub fn openai(api_key: impl Into<String>) -> Self
Create a config for OpenAI with the given API key.