config

package
v0.8.4 Latest Latest
Warning

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

Go to latest
Published: Feb 4, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultProxyPort                  = 8080
	DefaultExtractionBufferBytes      = 16384 // 16KB default
	DefaultLLMBaseURL                 = "http://localhost:11434/v1"
	DefaultCoVeConfidenceThreshold    = 0.6
	DefaultCoVeMaxCandidates          = 20
	DefaultCoVeTimeoutSeconds         = 30
	DefaultCoVeModel                  = "" // Empty = use default LLM
	DefaultDBAutoMaintenance          = true
	DefaultDBMaintenanceIntervalHours = 24
	DefaultDBRetentionMaxAgeDays      = 0 // 0 = unlimited
	DefaultDBRetentionMaxCount        = 0 // 0 = unlimited
)

Variables

This section is empty.

Functions

func EnsureTinyMemDirs

func EnsureTinyMemDirs(tinyMemDir string) error

EnsureTinyMemDirs creates the necessary .tinyMem subdirectories

func FindProjectRoot

func FindProjectRoot() (string, error)

FindProjectRoot looks for the .tinyMem directory starting from the current working directory and moving up the directory tree

func GenerateProjectID

func GenerateProjectID(projectRoot string) string

GenerateProjectID creates a consistent project ID from the project root path. It uses the absolute path to ensure uniqueness across different working directories but normalizes it to be filesystem-agnostic for consistency (e.g., replaces backslashes with forward slashes).

func GetTinyMemDir

func GetTinyMemDir(projectRoot string) string

GetTinyMemDir returns the path to the .tinyMem directory relative to the project root

func SaveAgentContractChoice added in v0.5.3

func SaveAgentContractChoice(projectRoot, contract string) error

SaveAgentContractChoice records the selected agent contract type in config.toml.

func WithConfig

func WithConfig(ctx context.Context, cfg *Config) context.Context

WithConfig adds the config to the context

Types

type Config

type Config struct {
	ProxyPort                     int
	LLMBaseURL                    string
	LLMAPIKey                     string
	LLMModel                      string
	EvidenceAllowCommand          bool
	EvidenceAllowedCommands       []string
	EvidenceCommandTimeoutSeconds int
	SearchEnabled                 bool
	Streaming                     bool
	LogLevel                      string
	LogFile                       string
	DBPath                        string
	ConfigPath                    string
	TinyMemDir                    string
	ProjectRoot                   string
	ExtractionBufferBytes         int
	RecallMaxItems                int
	RecallMaxTokens               int
	AlwaysIncludeUserPrompt       bool
	// Metrics configuration
	MetricsEnabled bool
	// CoVe (Chain-of-Verification) configuration
	CoVeEnabled             bool
	CoVeConfidenceThreshold float64
	CoVeMaxCandidates       int
	CoVeTimeoutSeconds      int
	CoVeModel               string
	CoVeRecallFilterEnabled bool
	// Database maintenance configuration
	DBAutoMaintenance          bool
	DBMaintenanceIntervalHours int
	DBRetentionMaxAgeDays      int
	DBRetentionMaxCount        int
	DBRetentionExcludeTypes    []string
	// Agent contract selection (`large` or `small`)
	AgentContract string
}

Config holds the application configuration

func FromContext

func FromContext(ctx context.Context) *Config

FromContext retrieves the config from the context

func LoadConfig

func LoadConfig() (*Config, error)

LoadConfig loads configuration from file, environment variables, and defaults

func (*Config) Validate

func (c *Config) Validate() error

Validate verifies the configuration is usable.

Jump to

Keyboard shortcuts

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