config

package
v0.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 8, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Storage       StorageConfig       `mapstructure:"storage"`
	Embedding     EmbeddingConfig     `mapstructure:"embedding"`
	Summarization SummarizationConfig `mapstructure:"summarization"`
	Conversation  ConversationConfig  `mapstructure:"conversation"`
	Knowledge     KnowledgeConfig     `mapstructure:"knowledge"`
	Context       ContextConfig       `mapstructure:"context"`
	Entity        EntityConfig        `mapstructure:"entity"`
	Retention     RetentionConfig     `mapstructure:"retention"`
	Namespace     NamespaceConfig     `mapstructure:"namespace"`
	Server        ServerConfig        `mapstructure:"server"`
}

Config holds all configuration for Cortex.

func DefaultConfig

func DefaultConfig() *Config

DefaultConfig returns a Config with default values.

func Load

func Load(configPath string) (*Config, error)

Load loads configuration from file and environment variables.

type ContextConfig

type ContextConfig struct {
	TTLCleanupInterval   time.Duration `mapstructure:"ttl_cleanup_interval"`
	HistoryRetentionDays int           `mapstructure:"history_retention_days"`
}

ContextConfig configures workflow context.

type ConversationConfig

type ConversationConfig struct {
	AutoSummarizeThreshold int  `mapstructure:"auto_summarize_threshold"`
	DefaultHistoryLimit    int  `mapstructure:"default_history_limit"`
	SemanticSearchEnabled  bool `mapstructure:"semantic_search_enabled"`
}

ConversationConfig configures conversation memory.

type EmbeddingConfig

type EmbeddingConfig struct {
	Provider   string `mapstructure:"provider"`
	Model      string `mapstructure:"model"`
	Dimensions int    `mapstructure:"dimensions"`
	BatchSize  int    `mapstructure:"batch_size"`
	CacheSize  int    `mapstructure:"cache_size"`
}

EmbeddingConfig configures embedding generation.

type EntityConfig

type EntityConfig struct {
	ExtractionMode               string        `mapstructure:"extraction_mode"` // "off", "sampled", "whitelist", "full"
	ExtractionModel              string        `mapstructure:"extraction_model"`
	ExtractionBatchSize          int           `mapstructure:"extraction_batch_size"`
	ExtractionInterval           time.Duration `mapstructure:"extraction_interval"`
	SampleRate                   float64       `mapstructure:"sample_rate"`
	WhitelistKeywords            []string      `mapstructure:"whitelist_keywords"`
	SummaryRegenerationThreshold int           `mapstructure:"summary_regeneration_threshold"`
	MinConfidence                float64       `mapstructure:"min_confidence"`
	MinMentionsToKeep            int           `mapstructure:"min_mentions_to_keep"`
	AliasFuzzyThreshold          float64       `mapstructure:"alias_fuzzy_threshold"`
	ExtractionMaxAttempts        int           `mapstructure:"extraction_max_attempts"`
	ExtractionBackoff            string        `mapstructure:"extraction_backoff"`            // "fixed", "exponential"
	ExtractionDeadLetterPolicy   string        `mapstructure:"extraction_dead_letter_policy"` // "retain", "drop"
}

EntityConfig configures entity memory.

type KnowledgeConfig

type KnowledgeConfig struct {
	DefaultChunkStrategy  string `mapstructure:"default_chunk_strategy"`
	DefaultChunkMaxTokens int    `mapstructure:"default_chunk_max_tokens"`
	DefaultChunkOverlap   int    `mapstructure:"default_chunk_overlap"`
	DefaultSearchTopK     int    `mapstructure:"default_search_top_k"`
}

KnowledgeConfig configures the knowledge store.

type NamespaceConfig

type NamespaceConfig struct {
	AllowedNamespaces []string `mapstructure:"allowed_namespaces"`
}

NamespaceConfig configures namespace isolation.

type RetentionConfig

type RetentionConfig struct {
	ConversationRetentionDays int           `mapstructure:"conversation_retention_days"`
	EntityStaleDays           int           `mapstructure:"entity_stale_days"`
	ContextRunRetentionDays   int           `mapstructure:"context_run_retention_days"`
	GCInterval                time.Duration `mapstructure:"gc_interval"`
}

RetentionConfig configures data lifecycle.

type ServerConfig

type ServerConfig struct {
	LogLevel          string `mapstructure:"log_level"`
	MetricsEnabled    bool   `mapstructure:"metrics_enabled"`
	MetricsPort       int    `mapstructure:"metrics_port"`
	StructuredLogging bool   `mapstructure:"structured_logging"`
	RequestIDHeader   string `mapstructure:"request_id_header"`
}

ServerConfig configures the server.

type StorageConfig

type StorageConfig struct {
	Backend     string `mapstructure:"backend"`      // "sqlite" or "pgvector"
	DataDir     string `mapstructure:"data_dir"`     // For SQLite
	DatabaseURL string `mapstructure:"database_url"` // For pgvector
}

StorageConfig configures the storage backend.

type SummarizationConfig

type SummarizationConfig struct {
	Provider  string `mapstructure:"provider"`
	Model     string `mapstructure:"model"`
	MaxTokens int    `mapstructure:"max_tokens"`
}

SummarizationConfig configures LLM summarization.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL