Commit Graph

12 Commits

Author SHA1 Message Date
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
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
026ae27366 Scope memories by API token and add shared-token e2e coverage 2026-04-01 23:30:58 -04:00
Agent Zero
1d485ca5c9 Fix dedup threshold postgres type 2026-03-24 06:07:06 +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
Agent Zero
5d5c042dd1 Add TTL expiry for transient facts 2026-03-24 03:20:10 +00:00
Agent Zero
1314015479 Fix hybrid query parameter types 2026-03-24 02:12:41 +00:00
Agent Zero
0ba37f8573 Add hybrid text plus vector memory search 2026-03-22 22:38:14 +00:00
Agent Zero
03e8f246d1 Implement batch_store endpoint for Issue #12 2026-03-19 15:59:34 +00:00
Agent Zero
403b95229e feat: implement batch_store endpoint (Issue #12)
- Add batch_store tool accepting 1-50 entries per call
- Single DB transaction for atomicity
- Returns individual IDs/status per entry
- Add batch_store_memories() to Database layer
- Add 6 test cases
- Backward compatible - existing store unchanged

Expected impact: 50-60% reduction in store API calls
2026-03-19 15:30:32 +00:00
Agent Zero
774982dc5a Initial public release 2026-03-07 13:41:36 -05:00