Skip to main content
Status: EXPERIMENTAL — Architecture designed, implementation in progress. This page describes the planned system.

Overview

The Consciousness Memory layer is the bridge between ArgentOS’s raw memory substrates and the Consciousness Kernel. It introduces Knowledge Observations — durable synthesized claims derived from consolidating memory items, entities, reflections, and lessons into a governed truth layer. Today, ArgentOS has four adjacent but distinct memory substrates: What is missing is a first-class layer for “current believed truth” with explicit evidence links, contradiction tracking, revision chains, freshness semantics, and deterministic retrieval precedence. Without this, retrieval repeatedly infers truth from raw facts at answer time — expensive, noisy, and hard to audit.

Knowledge Observations

A Knowledge Observation is a durable synthesized claim that represents what the agent currently believes to be true. Unlike raw memory items (which capture moments), observations represent consolidated understanding. Example observations:
  • “User prefers PostgreSQL over MongoDB for ACID compliance”
  • “Project callscrub.io is in active development, targeting Q2 launch”
  • “The Telegram channel processes approximately 40 messages per day”
  • “User responds best to concise technical summaries, not verbose explanations”

Observation Kinds

Observations are strictly typed by kind, each with distinct retrieval ranking, freshness rules, and revalidation cadences:

Subject Types

Each observation is scoped to a subject:

Observation Status

Observation Evidence

Every observation maintains explicit links to its source evidence. Evidence links connect observations back to the raw substrates they were derived from.

Evidence Sources

An evidence link can reference:
  • A memory_item (raw fact)
  • A lesson (SIS-derived actionable compression)
  • A reflection (periodic summary)
  • An entity (entity context)

Evidence Stance

Each evidence link carries a stance:

Evidence Weight

Each link carries a weight (default 1.0) indicating the relative strength of that piece of evidence. Operator-confirmed evidence receives a boost.

The Consolidation Process

1

Source Gathering

Memory items, entities, reflections, and lessons feed into the consolidator. Sources are grouped by topic using canonical key matching.
2

Claim Synthesis

The consolidator generates synthesized claims from grouped evidence. For example, three memory items about “user prefers PostgreSQL” become a single observation with all three linked as supporting evidence.
3

Evidence Linking

Each observation is connected to its source evidence with stance annotations. A single observation might have 5 supporting links, 1 contradicting link, and 2 context links.
4

Canonical Key Assignment

Observations receive deterministic canonical keys generated by code (not LLM output):
A partial unique index ensures only one active observation per canonical key per agent:
5

Confidence Scoring

Each observation receives an anatomical confidence score (not a vibe score) composed of:The composite score is clamped to [0, 1] and stored alongside its components for full explainability.

Freshness and Supersession

Freshness vs Confidence

Freshness and confidence answer different questions:
  • Confidence: “How well supported is this belief?”
  • Freshness: “How current is this belief?”
An observation can be highly confident but stale (well-supported months ago, no recent evidence) or fresh but low-confidence (recently observed but only once).

Revalidation Jobs

Periodic freshness jobs check whether observations are still valid:
  1. Scan observations where revalidationDueAt has passed
  2. Check for new supporting or contradicting evidence since lastSupportedAt
  3. Update freshness score based on evidence recency
  4. Mark observations as stale if freshness drops below threshold
  5. Mark as invalidated if contradicting evidence outweighs support

Revalidation Cadence by Kind

Different observation kinds have different default revalidation intervals:

Supersession

When new evidence materially changes a belief, the consolidator creates a new observation and links it to the old one via supersedes_observation_id. The old observation is marked superseded but preserved for historical context.
Hard invariant: Observations never cite other observations as evidence. The only permitted observation-to-observation relationship is supersession.

Context Assembly Integration

The retrieval router includes observations in the ranked merge alongside other retrieval sources: Active observations with high confidence are injected as high-priority context, reducing the need for the agent to re-derive truth from raw facts at query time.

Runtime Use

Observations are injected into agent prompts through the existing system prompt injection path (src/agents/system-prompt.ts). The injection includes:
  • The observation summary
  • Confidence level indicator
  • Last supported timestamp
  • Evidence count
This gives the agent immediate access to consolidated knowledge without needing to perform retrieval and synthesis on every turn.

Feedback Loop

User feedback and reinforcement flow back to update observation confidence:
  1. Operator confirmation: Thumbs up or explicit confirmation boosts observation confidence via operatorConfirmedBoost
  2. Contradiction: User corrections create contradicting evidence, potentially triggering supersession
  3. Reinforcement: Repeated user behavior that aligns with an observation increases its support weight
  4. Memory recall success: When an observation-derived answer satisfies the user, the observation is reinforced

Proposed Schema

PostgreSQL Tables

Two new tables in src/data/pg/schema.ts:

Indexes

  • (agent_id, kind, status) — Kind-filtered queries
  • (agent_id, canonical_key) — Canonical key lookups
  • (agent_id, revalidation_due_at) — Revalidation job scans
  • (agent_id, confidence DESC, freshness DESC) — Ranked retrieval
  • HNSW on embedding — Semantic search
  • GIN FTS on summary || detail || tags — Full-text search
  • Partial unique: UNIQUE (agent_id, canonical_key) WHERE status = 'active'

Hard Invariants

These rules are non-negotiable:
  1. Observations may only derive from memory_items, lessons, reflections, and entity context
  2. Observations may not cite other observations as evidence
  3. The only observation-to-observation link is supersedes_observation_id
  4. Material truth changes create a new row — never rewrite prior truth in place
  5. Contradiction evidence must be preserved
  6. Raw evidence must always remain reachable through observation links
  7. Canonical key generation must be deterministic and code-driven

Key Files