Status: Draft architecture overview (descriptive synthesis + gap register). Normative DDL remains in the per-store specs named below.
Date: October 2026
Authority for: How Layer 7 platforms relate; what is schema-complete vs open. Not authority for table DDL (see Agent DB Schema, Goal Model Spec, Outcome Spec, Identity Spec, Task Graph Spec, Observability Metrics Spec, Memory Runtime Integration Guide, Trading TRD DDL Spec, Trading alignment).


1. Purpose

Answer two questions after the Layer 7 schema completion work:

  1. Is the data-layer schema design complete for Synedrix OS core and the Trading domain pack?
  2. How do Supabase, Redis, Qdrant, Neo4j, and QuestDB relate as one governed memory fabric?

2. Verdict

Largely complete for OS + Trading schema specification after Architecture §6 items 2–5.
Remaining gaps are mainly Trading Qdrant contracts, Observability §8 satellite ownership, deferred hosting/erasure ADRs, and build-phase application of published DDL.

SliceCompleteness (estimate)
OS Agent DB Groups A–H (listed tables)~98% (v1.4: Group H inventory + workflow_outcomes + lineage vocab)
OS hot / vector / trend store contracts~85%
OS work model (Goals + Task Graph + Outcomes)~95% (Goal + workflow_outcomes DDL present)
Identity / approval persistence~80% (Group H DDL present; Draft enforcement procedures open)
Trading TRD vs OS alignment + Phase‑1 DDL~95% (alignment v2.5; TRD DDL Spec v1.1; C5 Specified)
OS + Trading end-to-end as specified~85%

3. High-level design — store relationships

3.1 Non-overlapping roles (Layer 7 five-store substrate)

flowchart TB
  subgraph L7["Layer 7 — Memory & Data"]
    SB[(Supabase PG17<br/>canonical relational truth)]
    RD[(Redis<br/>working / coordination)]
    QD[(Qdrant<br/>semantic vector index)]
    NJ[(Neo4j<br/>graph projection)]
    QS[(QuestDB<br/>temporal / trends)]
  end

  ORCH[n8n Orchestration L3] --> SB
  ORCH --> RD
  RT[LangGraph Agent Runtime L4] --> SB
  RT --> RD
  RT --> QD
  GOV[Governance L9] --> SB
  OBS[Observability L10] --> QS
  OBS --> SB

  SB -->|rebuildable projection| QD
  SB -->|rebuildable projection| NJ
  SB -->|derived samples| QS
  RD -.->|never SoR| SB

Rule of truth. Supabase is write-authoritative for every audit-bearing record. Redis holds reconstructible hot state only. Qdrant and Neo4j are rebuildable projections. QuestDB holds temporal series and dashboard trends that must not be recomputed ad hoc from Supabase.

3.2 Write paths vs read paths

flowchart LR
  subgraph Writers["Governed writers"]
    N8N[n8n workflows]
    LG[LangGraph agents]
    MC[os-agt-010 Memory Curator]
    ORCH2[os-agt-001 Orchestrator]
  end

  subgraph Postgres["Supabase PG17"]
    DEF[Groups A–C definitions/policy]
    EXEC[Group D invocations/outcomes]
    MEM[Group G memory_*]
    RTG[runtime.* task graphs]
    TRD[(trading.* TRD)]
  end

  subgraph Projections["Projections / hot"]
    QDr[(Qdrant mem_* / KB)]
    NJr[(Neo4j Agent/Outcome/Task graph)]
    RDr[(Redis os:* keys)]
    QSr[(QuestDB metrics_samples)]
  end

  N8N --> EXEC
  N8N --> RTG
  N8N --> TRD
  LG --> EXEC
  ORCH2 --> RTG
  MC --> MEM
  MEM --> QDr
  EXEC --> NJr
  MEM --> NJr
  DEF --> NJr
  EXEC --> QSr
  N8N --> RDr
  LG --> RDr

3.3 Memory fabric tiers → stores

flowchart TB
  W[working] --> Redis
  E[episodic] --> Supabase
  E --> Qdrant
  S[semantic] --> Supabase
  S --> Qdrant
  P[procedural] --> Supabase
  P --> Qdrant
  Pr[profile] --> Supabase
  Pr --> Qdrant
  Pr --> Neo4j
  Rel[relational] --> Supabase
  G[graph lineage] --> Supabase
  G --> Neo4j
  T[temporal] --> QuestDB

Normative collection names for indexed tiers: mem_episodic, mem_semantic, mem_procedural, mem_profile (Memory Runtime Integration Guide §2.3). KB consumers (e.g. synedrix_os_kb) are a separate collection class.

3.4 Runtime object chain (Postgres)

erDiagram
  GOAL_INSTANCE ||--o{ TASK_GRAPH : "plans"
  TASK_GRAPH ||--|{ TASK : "contains"
  TASK ||--o{ TASK_EDGE : "connects"
  TASK ||--o{ EXECUTION : "attempts"
  EXECUTION ||--o| AGENT_INVOCATION : "invocation_id"
  EXECUTION ||--o| OUTCOME : "outcome_id"
  AGENT_INVOCATION ||--|| AGENT_INVOCATION_OUTCOME : "terminates"
  WORKFLOW_RUN ||--|| WORKFLOW_OUTCOME : "terminates"

  GOAL_INSTANCE {
    text tenant_id
    text goal_id
    text goal_type
  }
  TASK_GRAPH {
    text tenant_id
    text task_graph_id
    int graph_version
  }
  EXECUTION {
    text execution_id
    text outcome_id
    uuid invocation_id
  }
  WORKFLOW_OUTCOME {
    text outcome_id
    text status
  }

Solid runtime-chain entities with normative DDL: Goal Instance (Goal Model Spec v0.3), workflow_outcomes (Outcome Spec v0.3 / Agent DB Group D), runtime.* (Task Graph Spec), and agent_invocation_*.

3.5 Trading domain pack placement

flowchart TB
  subgraph OS["OS public schema"]
    A[Groups A–G]
    R[runtime.*]
  end
  subgraph TRD["trading schema — 26 TRD tables"]
    CORE[orders · signals_log · consensus_log · …]
    EXT[trades · agent_health · broker_sessions · …]
  end
  TRD -->|agent_scope FK| A
  TRD -->|lineage via agent_lineage_links| A
  TRD -->|hot keys pack-local| RedisT[Redis domain keys]
  TRD -.->|regime / sentiment vectors TBD| QdT[Qdrant Trading collections]

Trading alignment v2.5 verifies all 26 tables against OS Groups A–G. Physical DDL is published as TRD DDL Spec v1.1; applying it remains Phase 1 build work.

3.6 Observability split

flowchart LR
  EVT[Event bus] --> SB2[Supabase audit rows]
  EVT --> QS2[QuestDB metrics_samples]
  SB2 -->|must not ad-hoc recompute for dashboards| GRAF[Grafana]
  QS2 --> GRAF
  LF[Langfuse traces] -.->|trace_id correlate| SB2

4. Completeness matrix

4.1 Synedrix OS core

AreaSpecStatus
Agent definition / registry / policy / execution / eval / lineage / memory CP / identity inventoryAgent DB Schema v1.4Groups A–G DDL + Group H inventory; workflow_outcomes; lineage vocab unified
Task Graph runtime.*Task Graph Spec v0.3Normative SQL present
Goal Type / Goal Instance tablesGoal Model Spec v0.3DDL present
workflow_outcomesOutcome Spec v0.3DDL present (mirrored in Agent DB Group D)
Observability satellite tables §8.2–8.6Observability Metrics Spec v1.2Tenant-led sketches; full ownership vs Agent DB tool/eval tables still deferred
QuestDB trendsObservability §14ametrics_samples DDL present
Redis OS keysTask Graph + RedisNormative templates present
Qdrant fabric + KB classMemory Runtime Guide v0.2Collection/payload contract present
Neo4j Agent / Outcome graphAgent Graph Data Model + Neo4j guide v0.2Specified; Postgres↔Cypher lineage mapping present
Neo4j Task Graph projectionTask Graph SpecIllustrative only
Identity / tenant / user / approval tablesIdentity Spec v0.3Group H DDL present; Agent DB inventories Group H
Temporal memory QuestDB (non-metrics)Memory FabricConcept only

4.2 Trading domain pack

AreaStatus
26-table C1–C6 vs OS Groups A–GComplete in Trading DB Schema Alignment v2.5
OS-facing ↔ source name map§3.1 present
Formal CREATE TABLE for 26 TRD + tenant columnsPublished — TRD DDL Spec v1.1
Numeric SMALLINT agent ids → canonical TEXT + agent_scopeDDL’d in TRD DDL Spec (build applies)
FILLED Step 5 Neo4j-before-Postgres (C5)Specified (Step 5a/5b in TRD DDL Spec §6; contracts/skill remain build)
Trading Qdrant collection contractsMissing
Trading Redis keys without tenant_idDocumented pack-local exception

5. Gap register

5.1 Blocking

#GapWhere
B1Goal Type / Goal Instance Supabase DDLDone — Goal Model Spec v0.3
B2workflow_outcomes DDLDone — Outcome Spec v0.3 / Agent DB v1.4
B3memory_promotions dual PKFixed in Agent DB Schema v1.3
B4memory_tombstones missing PKFixed in Agent DB Schema v1.3
B5agent_lineage_links missing UNIQUE (tenant_id, id)Fixed in Agent DB Schema v1.3
B6Postgres relation vocabulary vs Neo4j Outcome edge typesDone — Agent DB v1.4 + Neo4j guide v0.2 mapping
B7TRD Phase‑1 DDL + tenant boundary + agent-id migrationDone — TRD DDL Spec v1.0 (apply in build)
B8FILLED write-order Step 5a/5b remediationSpecified — TRD DDL Spec §6 / alignment v2.5 (contracts/skill remain build)
B9Identity / organisation / user / role-assignment / approval persistenceDDL shape Done (Identity Spec v0.2 Group H); Draft — last-owner / grant auth / active-delegation procedure bodies remain open
B10Trading Qdrant collection contracts (regime / sentiment / scenario)Trading domain pack

5.2 Deferred (explicit open / ADR)

  • Groups D/G hosting (Tenancy Spec §9)
  • Offboarding / erasure of indefinitely retained tables
  • Metering / entitlement ledger (ADR-OS-012)
  • Memory Fabric 7-store vs 5 Layer‑7 platforms framing
  • Task Graph Neo4j projection schema; Agent Graph registry sync trigger
  • Observability §8.2–8.6 ownership vs Agent DB tool/eval tables
  • Temporal QuestDB memory beyond metrics
  • Trading Redis tenant-prefix rename

5.3 Editorial

  • Domain pack text may still say “13 tables” vs alignment’s 26
  • camel-concat vs snake_case physical rename
  • Recommended agent_config → trd_agent_config

  1. Agent DB Schema v1.3 — fix B3–B5 (done).
  2. Goal Model Spec v0.3 — goal_types / goal_instances DDL (done).
  3. Outcome Spec / Agent DB — workflow_outcomes DDL (done).
  4. Identity schema companion — Group H DDL (DDL done; Draft enforcement procedures still open).
  5. Trading TRD DDL Spec v1.0 — formal SQL for 26 tables (done; alignment stays verification-only).
  6. Trading store contracts addendum — Redis namespace + Qdrant collections.
  7. Neo4j lineage mapping — single relation vocabulary (done in Agent DB v1.4 + Neo4j guide v0.2).


Versioning

  • Version: 0.2
  • Supersedes: v0.1