Layered Architecture

A sophisticated multi-layered hierarchy that creates functional clinical intelligence through unified memory-knowledge-reasoning integration

Amigo's memory architecture employs a sophisticated, multi-layered hierarchy (L0, L1, L2, L3) that creates functional clinical intelligence with perfect memory as one of its capabilities. This isn't just a memory system—it's a complete cognitive framework that generates multiple interconnected feedback loops between global patient understanding and local processing. The architecture operates through distinct post-processing and live session phases, serving as a critical component of the unified Memory-Knowledge-Reasoning (M-K-R) system.

Why Four Layers: Maintaining Sufficient Statistics Across Timescales

The hierarchical structure isn't an architectural preference—it emerges from maintaining information at multiple temporal scales. Each layer compresses what came before while preserving what matters for outcomes:

  • L0: Raw transcripts—complete history

  • L1: Information gain—what's genuinely new

  • L2: Episodic patterns—recurring structure over weeks/months

  • L3: Functional dimensions—stable patterns across episodes

Think of it like a funnel: raw observations (thousands of details) → what's new and relevant → recurring patterns → stable dimensions that drive outcomes. L3 ultimately contains a sparse set of functional dimensions that explain substantial outcome variance, even though raw observations have thousands of dimensions.

Why temporal aggregation matters: Some patterns are invisible at short timescales. A patient's medication adherence looks random day-to-day, but monthly accumulation reveals 2-3 week cycles tied to work stress. You can't detect monthly cycles from daily snapshots—you need L2's episodic accumulation bridging L1 (daily extractions) and L3 (stable dimensions across time).

For technical readers: Information-theoretic foundation

Each layer solves a specific compression problem: preserve information about outcomes Y while discarding noise and redundancy. The goal is to maintain sufficient statistics—compressed representations that preserve all outcome-relevant information.

The mathematical formulation: each layer maintains sufficiency (preserving predictive information about outcomes) while increasing compression. This follows the data processing inequality where information about outcomes can only decrease or stay constant as we compress representations.

In practice, this means L3's sparse dimensions are sufficient for prediction even though they're dramatically compressed from thousands of raw observation dimensions. The sparsity emerges from the true causal structure being low-dimensional—work stress, circadian rhythms, medication timing—while most observations are noise.

Live Conversation Processing

During live interactions, L3 provides memory at the right interpretation, precision, and depth to power knowledge application and reasoning without retrieval latency that would degrade reasoning quality:

  1. L3 (Always Available)

  • Memory maintained at the specific precision and depth required for different clinical reasoning tasks with immediate availability

  • Professional identity ensures memory interpretation matches knowledge application requirements without retrieval delays

  • Healthcare decisions powered by memory-knowledge-reasoning unity where current symptoms connect to patterns through proper contextual depth AND zero-latency access

  • Unified context with immediate availability enables high-quality reasoning because memory, knowledge application, and reasoning operate on consistently interpreted information without retrieval interruption

  1. Rare Recontextualization (Adds Latency)

  • Complete Memory-Reasoning Foundation: L3 provides complete memory at the interpretation depth needed for clinical reasoning with immediate availability

  • Targeted Historical Insight Extraction: Expansion occurs when L3-guided reasoning identifies opportunities to extract additional insights from historical context

  • Complete Context Expansion: Queries generated with full L3 context enable precise extraction of genuinely valuable historical insights

  • Perfect Recontextualization: Past L0 conversations recontextualized through L3's complete unified context, enabling reasoning that extracts maximum value from historical information

  • Complete Professional Integration: Clinical knowledge fully integrated through L3's comprehensive professional context

  • Unified Memory-Knowledge-Reasoning: L3 enables complete coherent reasoning across all information with the precision depth required for clinical intelligence

Post-Processing Memory Management

Amigo implements a sophisticated post-processing cycle that creates L3 through progressive synthesis:

1

L0 → L1: Memory Extraction with L3 Anchoring

L3-Guided Extraction: Every memory extraction from raw transcripts operates with complete awareness of the existing L3

  • Net-New Information Determination: L3 determines what constitutes genuinely new information worth extracting from L0 transcripts

  • Contextual Interpretation: L3 provides the interpretive lens for understanding L0 conversations from complete historical perspective

  • Professional Identity Targeting: Service provider background shapes what information is deemed critical for extraction

  • Dimensional Blueprint Guidance: L3's dimensional framework guides extraction targeting based on functional importance

  • Perfect Source Linking: Each L1 memory maintains linkage to source L0 for future recontextualization needs

Why unfiltered extraction matters: L1 captures ALL deviations from L3's current model—even seemingly irrelevant details. Consider a patient whose blood sugar seems randomly unstable. When they mention "work deadlines Tuesday" or "feeling stressed Thursday," these seem unrelated to blood sugar control. But unfiltered capture allows L2 to later discover the stress-medication-timing pattern that causes instability. If we filtered "irrelevant" mentions early, we'd never discover this hidden structure.

2

L1 → L2: Episodic Synthesis when Accumulation Threshold Reached

  • L3-Anchored Synthesis: L1 memories synthesized into L2 episodic model with complete L3 awareness

  • Information Density Management: Prevents explosion while maintaining critical insights

  • Dimensional Organization: Professional identity guides how information is structured in episodic model

  • Temporal Coherence: Maintains chronological understanding while creating episodic synthesis

  • Boundary Prevention: L3 anchoring prevents information loss at processing boundaries

How temporal aggregation reveals structure: Continuing with our blood sugar example: daily L1 extractions ("work deadline," "stressed," "missed dose") look disconnected. But accumulating them over weeks/months allows L2 synthesis to identify the 2-3 week cycle: work stress → medication timing disruption → blood sugar instability. The pattern becomes visible only through sufficient temporal aggregation.

Efficient updates: The system doesn't reprocess all history. Updates cascade through layers while maintaining sufficiency and keeping computation tractable.

3

L2 → L3: Global Model Evolution through Boundary-Crossing Synthesis

  • Boundary-Crossing Synthesis: Merges L2 episodic models while preventing information density explosion

  • Complete Temporal Coverage: Creates unified understanding across entire patient history

  • Dimensional Evolution: User dimensions refined based on patterns discovered across episodes

  • Professional Identity Integration: Maintains clinically relevant interpretation throughout merger

  • Continuous Improvement: Each L3 evolution incorporates new insights while preserving historical understanding

Cross-episode analysis discovers dimensions: Completing our blood sugar example: one L2 episode might show a stress-medication pattern, but could be coincidence. When this same pattern appears in three separate quarterly episodes with L3 anchoring, it's not random—it's a stable functional dimension that becomes part of the patient's dimensional blueprint. Now the system can proactively intervene when work stress patterns emerge.

Boundary loss prevention: Naive merging loses information at episode transitions. L3 anchoring solves this by balancing two objectives: find shared patterns across episodes (cross-episode coherence) while preserving what L3 already knows (preventing divergence from current understanding). Think of it like maintaining a stable reference point while charting new territory—you need both the map you have and the new discoveries.

Emergent sparsity at scale: Across populations, a sparse set of functional dimensions explains substantial outcome variance. This isn't imposed by regularization—it emerges because true causal structure is sparse. Work stress patterns, circadian rhythms, medication adherence styles—these patterns generalize across patients while noise averages out.

Dimensional Evolution and Clinical Intelligence

The system creates multiple interconnected feedback loops between global patient understanding and local processing:

1. Professional Identity-Driven Evolution
  • Professional identity guides interpretation at every level of the memory hierarchy

  • System evolves attention patterns based on discovered patient patterns

  • Drift Detection and Correction: When system detects drift between user dimension definitions and optimal interpretation patterns for a patient group, dimensional definitions can be modified

  • Complete Temporal Backfill: Modified dimensional blueprints trigger replay-based reprocessing across all historical time, regenerating L0→L1 extraction, L1→L2 episodic synthesis, and L2→L3 global model evolution with superior interpretation framework

  • Functional Optimization: This dimensional evolution and backfill process improves patient safety, clinical experience, and medical outcomes through evolved professional interpretation frameworks

  • Population-Level Intelligence: Enables reinterpretation of entire patient populations with optimal information interpretation, depth, granularity, and angle based on discovered clinical patterns

  • Clinical Outcome Optimization: As understanding of patient groups evolves, dimension definitions can be updated with system backfilling by recomputing interpretations based on new dimensional understanding

2. Global-Local Context Bridge
  • Dual Anchoring Mechanism: L3 serves as anchor point for both expansion query generation (present context) and historical interpretation (past context)

  • Query Generation: Expansion queries generated with respect to current L3 state against present live session context

  • Historical Interpretation: Query answering from past L0 sessions is anchored against L3, merging past raw events with present global understanding across time

  • Temporal Synthesis: This creates coherent interpretation where historical events are understood through the lens of complete current patient understanding, not isolated past context

  • Professional identity creates better targeting for recontextualization during live sessions through this dual anchoring mechanism

3. Functional Clinical Intelligence
  • This comprehensive contextual awareness is essential for medical intelligence performance

  • Healthcare decisions require understanding how current symptoms connect to established patterns, medication interactions, family history, and treatment responses

  • System knows everything already learned about a patient, enabling focus on genuinely new information

  • Rapid clinical decision-making achieved with complete context through L3

High-Bandwidth Cross-Layer Integrations

  • Contextualized Historical Access: L3 provides interpretive context for direct L0 access during recontextualization

  • Temporal Bridging: L3 serves as bridge between present understanding and raw historical events

  • Selective Retrieval: L3 dimensions guide which L0 sessions are relevant for expansion queries

  • Interpretive Anchoring: Raw L0 data interpreted through L3 global context rather than isolated historical perspective

User Understanding ↔ Dimension Definition Feedback Loops

Direct User Understanding

  • Immediate Clinical Context: User understanding directly informs clinical decision-making in live sessions

  • Dimensional Application: Current dimensional definitions applied to interpret patient information

  • Professional Identity Filtering: User understanding filtered through professional identity lens

  • Real-Time Contextualization: Present user state contextualized against historical understanding

Continuous Enhancement: These nested feedback loops create a self-improving clinical intelligence system where user understanding, dimensional definitions, and framework optimization continuously enhance each other through high-bandwidth cross-layer integration.

Overcoming the Token Bottleneck

The layered memory system functions as an external high-dimensional memory store that preserves information that would otherwise be lost in token-based reasoning. This is crucial for the integrated M-K-R cycle:

While token-based reasoning loses significant information density, our L0 layer maintains complete, verbatim records with perfect fidelity, forming a reliable Memory base for the M-K-R system.

For details on the upcoming Memory‑Reasoning Bridge planned for Agent V2, see Advanced Topics › Memory‑Reasoning Bridge.

Last updated

Was this helpful?