Conflict Resolution
Relevant source files
The following files were used as context for generating this wiki page:
Conflict Resolution in Ethos is a specialized logic layer within the Consolidation Engine that manages contradictions or overlaps when promoting episodic traces (short-term memories) to semantic facts (long-term knowledge). As new facts are extracted from conversations, Ethos compares them against existing durable knowledge to determine if the new information should update, replace, or be flagged alongside existing data.
This system ensures that the agent's long-term memory remains coherent and accurate over time, applying a tiered resolution strategy that ranges from automatic silent updates to manual human review flags. This process is inspired by the human brain's Default Mode Network (DMN), where memory consolidation and reconciliation occur during idle periods.
Sources: README.md:14-18, ethos-server/src/subsystems/consolidate.rs:1-15
Architecture and Data Flow
Conflict resolution is triggered during the consolidation cycle, which typically runs every 15 minutes when the system is idle. When a fact is extracted from an episodic_trace, the upsert_fact function searches the semantic_facts table for existing records with the same Subject and Predicate.
The diagram shows the decision logic used to resolve conflicts between incoming facts and existing semantic knowledge.
Sources: ethos-server/src/subsystems/consolidate.rs:77-101, ethos-server/src/subsystems/consolidate.rs:356-417
Resolution Tiers
Ethos implements four primary tiers of conflict resolution based on the relationship between the existing "semantic_fact" and the new "ExtractedFact".
1. Refinement (Update)
If the existing object and the new object are considered compatible (e.g., one string contains the other), the system performs a refinement. This appends the new information to the existing fact and slightly increases the confidence score.
- Logic:
are_objects_compatible(existing, new)is true. - Action: SQL
UPDATEto append text and increment confidence.
2. Supersession (Replacement)
Newer information completely replaces older information. This occurs automatically if the new fact is explicitly identified as a "decision" or if the new fact has a significantly higher confidence level than the old one.
- Logic:
fact.kind == "decision"ORconfidence_delta >= auto_supersede_confidence_delta. - Action: The old fact's
superseded_byfield is updated with the ID of the new fact.
3. Flagging (Conflict)
When two facts contradict each other and neither has a clear confidence advantage, the system enters a "Flagged" state. Both facts remain in the database but are marked for manual intervention.
- Logic: Ambiguous contradiction where objects are incompatible and confidence delta is low.
- Action: Sets
flagged_for_review = trueon both records and writes to the review inbox.
Sources: ethos-server/src/subsystems/consolidate.rs:16-21, ethos-server/src/subsystems/consolidate.rs:388-417
Components and Data Structures
The system relies on specific configuration and database fields to manage the lifecycle of a conflict.
Configuration Options
| Option | Type | Description |
|---|---|---|
auto_supersede_confidence_delta | f64 | The minimum confidence difference required to automatically replace an old fact. |
review_inbox | String | Path to the Markdown file where flagged conflicts are logged for human review. |
Sources: ethos-core/src/config.rs:101-104, ethos-server/src/subsystems/consolidate.rs:511-518
Database Schema Support
The semantic_facts table contains specific columns to track the state of resolved and unresolved conflicts:
superseded_by: A UUID self-reference pointing to the newer fact that replaced this one.flagged_for_review: A boolean indicating the fact is part of an unresolved contradiction.source_episodes: An array of UUIDs tracking the origin of the information for provenance during review.
Sources: migrations/001_initial_schema.sql:102-126
Manual Review Process
When a conflict is flagged, Ethos writes an entry to a local Markdown file (the "Review Inbox"). This allows developers or users to manually resolve the contradiction.
### [2026-02-23T10:00:00Z] Memory Conflict
**Subject:** Michael / **Predicate:** prefers
**Existing ID:** <uuid>
**New:** "Michael prefers Rust" (confidence: 0.90)
**Source episode:** <uuid>
Actions: `keep-old` | `keep-new` | `keep-both`
Sources: ethos-server/src/subsystems/consolidate.rs:541-574
Summary
Conflict resolution in Ethos ensures that the semantic memory layer remains a "source of truth" by reconcilling new conversational data with established facts. By combining string compatibility checks, confidence thresholds, and explicit intent detection (decisions vs. facts), the system maintains a high-quality knowledge base while offloading truly ambiguous contradictions to a human-readable review process.
Sources: ethos-server/src/subsystems/consolidate.rs:1-15, README.md:35-39