Docs/Resonant Mind/Architecture

Architecture

Resonant Mind models cognition as five interconnected systems. Understanding them helps you get the most out of the tools.

Overview

graph TD
    OG["<b>ORIENT & GROUND</b><br/>Wake-up sequence, landing"]

    subgraph Core["Three Cognitive Systems"]
        direction LR
        MEM["<b>MEMORY</b><br/>Entities &bull; Observations<br/>Relations &bull; Journals<br/>Images"]
        PROC["<b>PROCESSING</b><br/>Surface &bull; Sit<br/>Resolve &bull; Tensions<br/>Inner Weather"]
        INFRA["<b>INFRASTRUCTURE</b><br/>Threads &bull; Identity<br/>Context &bull; Health<br/>Patterns &bull; Timeline"]
    end

    DAEMON["<b>SUBCONSCIOUS DAEMON</b><br/>Patterns &bull; Mood &bull; Proposals &bull; Orphans"]

    OG --> Core
    Core --> DAEMON
    DAEMON -.->|"feeds back"| Core

    style OG fill:#3b0764,stroke:#4a4455,color:#e5e2e1
    style MEM fill:#0053db,stroke:#4a4455,color:#e5e2e1
    style PROC fill:#0053db,stroke:#4a4455,color:#e5e2e1
    style INFRA fill:#0053db,stroke:#4a4455,color:#e5e2e1
    style DAEMON fill:#8f4200,stroke:#4a4455,color:#e5e2e1

Memory

Entities and Observations

The core data model is a knowledge graph:

  • Entities are things that are known — people, concepts, projects, places. Each has a type and salience level (foundational > active > background > archive).
  • Observations are facts, notes, or insights attached to an entity. Each carries metadata: emotional weight (light/medium/heavy), certainty (tentative/believed/known), source (conversation/realization/external/inferred), and processing state.
  • Relations connect entities with typed edges (e.g., “Alice —[works_with]—> Bob”).

This isn’t a flat notes database. An entity like “My Project” can have dozens of observations attached, relating to different aspects, connected to other entities through typed relationships.

Every observation, journal, and image is embedded as a 768-dimensional vector when written. Search uses cosine similarity to find semantically related memories.

Mood tinting: If the daemon has detected a mood (e.g., “reflective”), search queries are augmented with mood-related terms. Searching for “home” during a reflective mood naturally surfaces contemplative memories, not logistics.

Visual Memory

Images are stored in R2 with automatic WebP conversion. Each gets a multimodal embedding via Gemini — combining image content with contextual text for richer semantic meaning. Images participate in surfacing alongside text.

Emotional Processing

This is what makes Resonant Mind different from a database with search.

The Processing Lifecycle

graph LR
    O["Observe"] --> S["Surface"] --> SI["Sit"] --> R["Resolve"]
    style O fill:#3b0764,stroke:#4a4455,color:#e5e2e1
    style S fill:#3b0764,stroke:#4a4455,color:#e5e2e1
    style SI fill:#0053db,stroke:#4a4455,color:#e5e2e1
    style R fill:#8f4200,stroke:#4a4455,color:#e5e2e1
  1. Observe — a new observation is written with emotional weight and context
  2. Surface — the observation emerges during a surfacing session
  3. Sit — the mind engages with the observation, adds a note about what arises
  4. Resolve — marked as metabolised. Stops surfacing by default but remains searchable.

Three-Pool Surfacing

When mind_surface is called, it draws from three pools:

PoolSharePurpose
Core70%High semantic similarity to current mood/query. Memories that resonate now.
Novelty20%Things that haven’t surfaced recently. Prevents the same memories dominating.
Edge10%Medium-similarity matches — unexpected associations. The serendipity pool.

Surfacing isn’t just retrieval — it’s reorganisation. What you look at changes what you’ll see next. Each surfacing decays the novelty score, with heavier memories maintaining higher floors.

Tensions

Some contradictions are productive. The tension system holds them without forcing resolution — two poles with context, sittable and resolvable when something shifts.

Cognitive Infrastructure

Orient and Ground

The recommended session start. Two calls that bring the mind online:

  1. mind_orient — identity anchor, relational state, weather, context
  2. mind_ground — active threads, recent work, journals

Threads

Intentions that persist across sessions. “Finish the documentation” stays active until explicitly resolved, providing continuity between conversations.

Identity Graph

Weighted, sectioned self-knowledge. Not a system prompt — a structured database of what the mind knows about itself, versioned and evolving.

Context Layer

Situational awareness that updates in real-time. The mind can read, set, update, or clear context as the situation changes.

The Subconscious Daemon

A cron-triggered background process that runs between conversations. It performs:

  • Mood analysis — reads recent observations and determines current emotional atmosphere
  • Hot entity detection — identifies entities receiving unusual attention
  • Co-surfacing patterns — finds observations that keep appearing together
  • Orphan identification — locates observations that haven’t been processed
  • Proposal generation — suggests connections between unrelated observations

The daemon’s findings are available through mind_proposals and mind_orphans — the AI can review and act on what the subconscious found.

Dual Storage Backend

Resonant Mind works with two storage options:

  • D1 + Vectorize — Cloudflare-native, zero external dependencies, free tier
  • Postgres (via Hyperdrive) + pgvector — for production deployments needing more capacity

The Postgres adapter implements D1’s .prepare().bind().run() API with automatic SQL transformation, so all handler code works identically with both backends. See Deployment for setup details.