feat(config): add TruthConfig for truth scoring engine (#30)

Add TruthConfig struct to config.rs with all truth engine parameters:
- enabled, scoring_interval_seconds, batch_size, rescore_after_seconds
- pln_base_confidence, ecan_decay_rate, ecan_spread_factor
- contradiction_threshold, verification_threshold, cross_ref_limit

All settings configurable via OPENBRAIN__TRUTH__* env vars with sensible defaults.
Update .env.example with full documentation of new variables.
Update Config::load() builder and Default impl.

Part of #29
This commit is contained in:
Agent Zero
2026-04-04 02:05:36 +00:00
parent b19f65dc0b
commit 38b1150838
2 changed files with 139 additions and 1 deletions

View File

@@ -42,3 +42,27 @@ OPENBRAIN__AUTH__ENABLED=false
# Logging
RUST_LOG=info,openbrain_mcp=debug
# Truth Engine (optional)
# Enable the background truth scoring worker. When enabled, stored memories
# are continuously evaluated for truthfulness using PLN deduction, ECAN
# attention economy, and cross-referencing against related memories.
OPENBRAIN__TRUTH__ENABLED=false
# Seconds between scoring cycles (default: 300 = 5 minutes)
OPENBRAIN__TRUTH__SCORING_INTERVAL_SECONDS=300
# Number of memories to score per cycle (default: 50)
OPENBRAIN__TRUTH__BATCH_SIZE=50
# Seconds before a scored memory is re-evaluated (default: 86400 = 24 hours)
OPENBRAIN__TRUTH__RESCORE_AFTER_SECONDS=86400
# PLN base confidence for deduction chains (0.01.0, default: 0.85)
OPENBRAIN__TRUTH__PLN_BASE_CONFIDENCE=0.85
# ECAN STI decay rate per cycle (0.01.0, default: 0.95)
OPENBRAIN__TRUTH__ECAN_DECAY_RATE=0.95
# ECAN attention spread factor (default: 0.05)
OPENBRAIN__TRUTH__ECAN_SPREAD_FACTOR=0.05
# Similarity threshold for contradiction detection (0.01.0, default: 0.85)
OPENBRAIN__TRUTH__CONTRADICTION_THRESHOLD=0.85
# Truth value threshold for "verified" categorization (0.01.0, default: 0.8)
OPENBRAIN__TRUTH__VERIFICATION_THRESHOLD=0.8
# Max related memories to cross-reference per scoring (default: 10)
OPENBRAIN__TRUTH__CROSS_REF_LIMIT=10