You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Knowledge graph entries should only be created when a learning or insight crosses a confidence threshold established by the EIDOS prediction-outcome loop. Confidence becomes the promotion gate between ephemeral memory (event store) and durable knowledge (Aho-Corasick KG).
Core Insight
Currently, KG entries are manually curated -- a human writes markdown files in docs/src/kg/, which get compiled into Aho-Corasick automata. This is high-quality but doesn't scale.
The proposed flow inverts the direction: learnings enter the system as low-confidence events (#599), get validated through predict-evaluate cycles (#601), and only when confidence crosses a threshold do they get promoted to KG entries that the Aho-Corasick engine indexes.
Event Capture (low confidence, ephemeral)
|
v
Event Store (#597) -- all events persisted, queryable
|
v
EIDOS Loop (#601) -- predict, observe, evaluate, distill
|
v (confidence > promotion_threshold)
|
KG Entry Created -- durable, indexed by Aho-Corasick automata
|
v
Automata Rebuilt -- new patterns available in search
Why This Matters
Self-Growing Knowledge Graph
The KG currently grows only when a human adds entries. With confidence-driven promotion, the KG grows autonomously as the system validates insights through real-world outcomes. The growth is quality-gated -- only validated knowledge enters the graph.
Deterministic-First Preserved
This preserves terraphim's deterministic-first philosophy. Once promoted, entries ARE the Aho-Corasick automata -- sub-millisecond, deterministic matching. The LLM/statistical reasoning is confined to the promotion decision, not the runtime lookup. The graph itself remains fast and deterministic.
Natural Pruning
Entries that stop being validated (confidence decays over time if not re-confirmed) could be demoted or flagged for review. This prevents KG bloat from stale patterns.
~1 day for promotion engine + KG entry generation. Contradiction detection and confidence decay are follow-ups.
Key Design Decision
The promotion threshold should be conservative by default (0.8 confidence, 5+ validations). It is better to miss a valid insight and let a human add it manually than to pollute the KG with unvalidated patterns. The KG's value comes from its precision -- every entry in the Aho-Corasick automata fires reliably. False positives in the KG are worse than false negatives.
Part of
Epic #595 (Ouroboros-inspired patterns -- extends the agent evolution theme)
Completes the pipeline:
Event Capture (#599) -> Event Store (#597) -> EIDOS (#601) -> Promotion (this issue) -> KG Entry -> Aho-Corasick Automata
Summary
Knowledge graph entries should only be created when a learning or insight crosses a confidence threshold established by the EIDOS prediction-outcome loop. Confidence becomes the promotion gate between ephemeral memory (event store) and durable knowledge (Aho-Corasick KG).
Core Insight
Currently, KG entries are manually curated -- a human writes markdown files in
docs/src/kg/, which get compiled into Aho-Corasick automata. This is high-quality but doesn't scale.The proposed flow inverts the direction: learnings enter the system as low-confidence events (#599), get validated through predict-evaluate cycles (#601), and only when confidence crosses a threshold do they get promoted to KG entries that the Aho-Corasick engine indexes.
Why This Matters
Self-Growing Knowledge Graph
The KG currently grows only when a human adds entries. With confidence-driven promotion, the KG grows autonomously as the system validates insights through real-world outcomes. The growth is quality-gated -- only validated knowledge enters the graph.
Deterministic-First Preserved
This preserves terraphim's deterministic-first philosophy. Once promoted, entries ARE the Aho-Corasick automata -- sub-millisecond, deterministic matching. The LLM/statistical reasoning is confined to the promotion decision, not the runtime lookup. The graph itself remains fast and deterministic.
Natural Pruning
Entries that stop being validated (confidence decays over time if not re-confirmed) could be demoted or flagged for review. This prevents KG bloat from stale patterns.
Promotion Criteria
An insight is promoted to a KG entry when ALL of:
KG Entry Format
Promoted entries are written as standard terraphim KG markdown:
These files are placed in a designated directory (e.g.,
docs/src/kg/promoted/) and compiled into automata on the next rebuild.Implementation Plan
1. Promotion Engine (new module in terraphim_agent_evolution)
2. KG Entry Generator (extend terraphim_automata or terraphim_rolegraph)
docs/src/kg/promoted/directory3. Confidence Decay (in terraphim_agent_evolution)
4. Contradiction Detection (in terraphim_automata)
Affected Crates
terraphim_agent_evolution(primary -- promotion engine + confidence decay)terraphim_automata(contradiction detection + incremental rebuild)terraphim_rolegraph(KG entry creation from promoted insights)terraphim_types(PromotionCandidate, PromotionDecision types)Dependencies
Estimated Effort
~1 day for promotion engine + KG entry generation. Contradiction detection and confidence decay are follow-ups.
Key Design Decision
The promotion threshold should be conservative by default (0.8 confidence, 5+ validations). It is better to miss a valid insight and let a human add it manually than to pollute the KG with unvalidated patterns. The KG's value comes from its precision -- every entry in the Aho-Corasick automata fires reliably. False positives in the KG are worse than false negatives.
Part of
Epic #595 (Ouroboros-inspired patterns -- extends the agent evolution theme)
Completes the pipeline:
Event Capture (#599) -> Event Store (#597) -> EIDOS (#601) -> Promotion (this issue) -> KG Entry -> Aho-Corasick Automata