Commit Graph

59 Commits

Author SHA1 Message Date
Agent Zero
770828f7e9 merge: resolve conflict with evaluate tool in mod.rs 2026-04-04 10:03:18 +00:00
02a9d74be9 Merge pull request 'feat(tools): add evaluate MCP tool (#37)' (#50) from feature/truth-evaluate-tool into main
Merge evaluate MCP tool (#37)
2026-04-04 10:02:27 +00:00
d826e2310a Merge pull request 'feat(truth): add background truth scoring worker (#36)' (#49) from feature/truth-worker into main
Merge background truth scoring worker (#36)
2026-04-04 10:02:22 +00:00
Agent Zero
e181dad8c7 fix: add missing warn import, cast f64 similarity to f32 2026-04-04 09:47:10 +00:00
Agent Zero
8d0f944513 feat(truth): add background truth scoring worker (#36) 2026-04-04 04:07:58 +00:00
Agent Zero
40d5ab2595 feat(tools): add truth_status MCP tool (#38) 2026-04-04 04:07:28 +00:00
Agent Zero
38a621da55 feat(tools): add evaluate MCP tool (#37) 2026-04-04 04:05:11 +00:00
50d0a944b5 Merge pull request 'feat(truth): add scoring pipeline module (#34)' (#48) from feature/truth-scorer into main
Merge truth scoring pipeline module (#34)
2026-04-04 03:57:59 +00:00
075d06a2ec Merge pull request 'feat(query): surface truth scoring fields in query responses (#39)' (#47) from feature/truth-query into main
Merge enhanced query responses with truth fields (#39)
2026-04-04 03:57:52 +00:00
f0bbe99ebf Merge pull request 'feat(db): add truth scoring database helpers (#35)' (#46) from feature/truth-db-helpers into main
Merge truth scoring database helpers (#35)
2026-04-04 03:57:46 +00:00
Agent Zero
a7a070024a feat(truth): add scoring pipeline module (#34)
Implement truth scoring orchestrator that ties PLN + ECAN together:

New types:
- TruthCategory: verified/plausible/unverified/contradicted enum
- ScorerConfig: pipeline configuration (thresholds, ECAN params)
- RelatedMemory: cross-reference result with similarity + existing scores
- ScoringResult: complete scoring output with TV, confidence, category, ECAN

Core functions:
- score_memory(): orchestrates evidence classification, PLN scoring,
  ECAN computation, and categorization
- is_contradiction(): heuristic negation-asymmetry detection
- categorize(): rule-based category assignment

Scoring pipeline:
1. Classify related memories as confirmations or contradictions
2. Scale confidence by cosine similarity (closer = stronger evidence)
3. Apply PLN score_with_evidence for truth value computation
4. Run ECAN cycle (re-score) or initialize (first score)
5. Categorize based on TV, confirmations, and contradictions

13 unit tests covering all scoring paths, categories, contradiction
detection, ECAN initialization/cycling, and output bounds.

Part of #29
2026-04-04 03:15:17 +00:00
Agent Zero
6c280849c0 feat(query): surface truth scoring fields in query responses (#39) 2026-04-04 03:13:11 +00:00
Agent Zero
04f4809b7c feat(db): add truth scoring database helpers (#35)
New structs:
- TruthScoreUpdate: parameters for updating truth scores
- TruthStats: aggregated truth scoring statistics
- ScoringCandidate: lightweight record for the scoring worker

New Database methods:
- get_unscored_memories(): fetch unscored memories FIFO
- get_stale_memories(): fetch memories due for re-evaluation
- update_truth_score(): update single memory truth fields
- batch_update_truth_scores(): transactional batch update
- get_truth_stats(): aggregate stats with category breakdown

Uses partial index idx_memories_truth_unevaluated for efficient
unscored memory queries.

Part of #29
2026-04-04 03:11:38 +00:00
2fe656a63f Merge pull request 'feat(truth): add ECAN attention economy module (#33)' (#44) from feature/truth-ecan into main
Merge ECAN attention economy module (#33)
2026-04-04 03:09:59 +00:00
Agent Zero
b6ce2fdeda merge: resolve conflict with main — combine PLN and ECAN in truth/mod.rs 2026-04-04 03:09:48 +00:00
cdbc8529a2 Merge pull request 'feat(truth): add PLN deduction engine (#32)' (#45) from feature/truth-pln into main
Merge PLN deduction engine (#32)
2026-04-04 03:09:04 +00:00
f0235d8e6e Merge pull request 'feat(db): add truth scoring columns migration (#31)' (#43) from feature/truth-migration into main
Merge truth scoring columns migration (#31)
2026-04-04 03:08:58 +00:00
4f4d860f41 Merge pull request 'feat(config): add TruthConfig for truth scoring engine (#30)' (#42) from feature/truth-config into main
Merge TruthConfig foundation (#30)
2026-04-04 03:08:52 +00:00
Agent Zero
3f11f8f531 fix(config): close missing brace in Default impl for Config 2026-04-04 02:29:51 +00:00
Agent Zero
1672d5a145 feat(truth): add PLN deduction engine (#32)
Implement Probabilistic Logic Networks (PLN) inference rules:
- TruthValue struct with clamped strength/confidence
- deduction(): chain two implications A->B and B->C
- revision(): merge two independent truth estimates
- negation(): logical NOT (inverts strength, preserves confidence)
- conjunction(): logical AND (multiply strength, min confidence)
- score_with_evidence(): combine base score with confirmations and contradictions

10 unit tests covering basic operations, boundary cases,
symmetry, zero-confidence handling, and output bounds.

Part of #29
2026-04-04 02:14:01 +00:00
Agent Zero
5e746e4425 feat(truth): add ECAN attention economy module (#33)
Implement Economic Attention Network (ECAN) for memory importance management:
- EcanParams: decay_rate, beta, spread_factor, threshold
- decay_sti(): STI decay toward zero over time
- update_lti(): LTI accumulation weighted by STI, penalized below threshold
- spread(): boost STI for confirmed memories
- cycle(): full decay + LTI update weighted by truth value
- initialize(): compute initial STI/LTI from truth value and confidence

14 unit tests covering decay convergence, LTI growth/penalty,
spread clamping, cycle behavior, initialization, and bounds.

Part of #29
2026-04-04 02:12:47 +00:00
Agent Zero
5f9d884187 feat(db): add truth scoring columns migration (#31)
Add V5__truth_scoring.sql migration:
- truth_value (REAL): 0.0-1.0 truth score from PLN reasoning
- truth_confidence (REAL): 0.0-1.0 confidence in the score
- truth_category (TEXT): verified/plausible/unverified/contradicted
- truth_evaluated_at (TIMESTAMPTZ): when last scored
- ecan_sti (REAL): Short-Term Importance (recency-weighted)
- ecan_lti (REAL): Long-Term Importance (reliability)

Partial indexes for efficient unscored memory queries.
Update MemoryRecord struct with optional truth fields.

Part of #29
2026-04-04 02:10:15 +00:00
Agent Zero
38b1150838 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
2026-04-04 02:05:36 +00:00
b19f65dc0b Merge pull request 'Scope memories by API token and add shared-token e2e coverage' (#28) from codex/shared-token-memory into main
Reviewed-on: Ingwaz/openbrain-mcp#28
2026-04-02 04:01:39 +00:00
Agent Zero
026ae27366 Scope memories by API token and add shared-token e2e coverage 2026-04-01 23:30:58 -04:00
98baa27c90 docs: add Agent Identity & Source Tagging section to README
- Add source_agent directive to developer prompt code block
- Add full Agent Identity & Source Tagging section with setup guide
- Add source tagging rules, example payload, and multi-agent scenarios
2026-03-28 02:36:05 +00:00
cb28b99343 docs: fix AGENTS.md - replace broken include placeholder with actual content
- Add Agent Identity & Source Tagging section
- Define source_agent metadata requirement for fact traceability
- Add setup guide for agent identity via promptinclude files
- Add source tagging rules and example metadata payload
- Add multi-agent scenario guidance table
2026-03-28 02:30:19 +00:00
784aa2653f docs: add Agent Identity & Source Tagging section to AGENTS.md
- Define source_agent metadata requirement for fact traceability
- Add setup guide for agent identity via promptinclude files
- Add source tagging rules and example metadata payload
- Add multi-agent scenario guidance table
2026-03-28 02:26:52 +00:00
Agent Zero
35e23c0af6 Anonymize README deployment details 2026-03-24 11:52:45 +00:00
88404e0f0f Merge pull request 'Fix dedup threshold postgres type' (#27) from codex/issue-14-dedup-ingest into main
Reviewed-on: Ingwaz/openbrain-mcp#27
2026-03-24 06:11:51 +00:00
Agent Zero
1d485ca5c9 Fix dedup threshold postgres type 2026-03-24 06:07:06 +00:00
60d45fea84 Merge pull request 'Add server-side deduplication on ingest' (#26) from codex/issue-14-dedup-ingest into main
Reviewed-on: Ingwaz/openbrain-mcp#26
2026-03-24 05:55:41 +00:00
Agent Zero
9be138db94 Fix dedup database client trait import 2026-03-24 05:45:07 +00:00
Agent Zero
61d6448b44 Add server-side deduplication on ingest 2026-03-24 05:40:30 +00:00
8d003be33d Merge pull request 'Add TTL expiry for transient facts' (#25) from codex/issue-16-ttl-expiry into main
Reviewed-on: Ingwaz/openbrain-mcp#25
2026-03-24 03:29:16 +00:00
Agent Zero
5d5c042dd1 Add TTL expiry for transient facts 2026-03-24 03:20:10 +00:00
7a75e88eb0 Merge pull request 'Fix hybrid query float4 parameter bindings' (#24) from codex/fix-query-float4-bindings into main
Reviewed-on: Ingwaz/openbrain-mcp#24
2026-03-24 02:24:02 +00:00
Agent Zero
1314015479 Fix hybrid query parameter types 2026-03-24 02:12:41 +00:00
4d6458f2d3 Merge pull request 'Use ephemeral API key for VPS e2e tests' (#23) from codex/issue-e2e-vps into main
Reviewed-on: Ingwaz/openbrain-mcp#23
2026-03-24 01:18:48 +00:00
Agent Zero
1b4fc85ff2 Use ephemeral API key for VPS e2e tests 2026-03-23 23:54:53 +00:00
Agent Zero
b001d627e1 Provision auth key sets for VPS-backed e2e 2026-03-23 03:00:32 +00:00
971fdda6c6 Merge pull request 'Run e2e tests against deployed VPS' (#22) from codex/issue-e2e-vps into main
Reviewed-on: Ingwaz/openbrain-mcp#22
2026-03-23 01:42:37 +00:00
Agent Zero
cb6ccd5394 Run e2e tests against deployed VPS 2026-03-22 22:54:20 +00:00
8a581b2a2f Merge pull request 'Add hybrid text plus vector memory search' (#21) from codex/issue-17-hybrid-search into main
Reviewed-on: Ingwaz/openbrain-mcp#21
2026-03-22 22:47:44 +00:00
Agent Zero
0ba37f8573 Add hybrid text plus vector memory search 2026-03-22 22:38:14 +00:00
Agent Zero
347805cc29 Restore baseline migration checksum 2026-03-22 21:11:56 +00:00
Agent Zero
c4275e3e84 Merge remote-tracking branch 'origin/main' into main 2026-03-22 14:22:26 +00:00
Agent Zero
3853fa408c Merge branch 'codex/issue-12-repair' 2026-03-22 14:21:57 +00:00
Agent Zero
c3ea583f98 Provision database config in deploy workflow 2026-03-22 14:19:06 +00:00
294ffdf7a5 Merge pull request 'Use secrets for VPS deploy settings' (#20) from codex/issue-12-repair into main
Reviewed-on: Ingwaz/openbrain-mcp#20
2026-03-22 12:56:28 +00:00