# Byte-identical to Python's memory/consolidate.yaml EXCEPT the
# `consolidator:` section. Python uses `mode: callable` with
# module/function pointers; Rust has no equivalent of Python's dynamic
# `importlib.import_module`, so the Rust port wires the consolidator via
# a trait at compile time (RM-A spec §3.4) and the YAML names a built-in
# mode (`extractive` for v1). Everything else — schema/table defaults,
# promote_metadata, embedder/framer/chunker structure — matches Python
# byte-for-byte so the same `agent_memory.memory` table is interchangeable
# across languages.
cell_name: memory_consolidate
source:
  type: session_staging
  # `dsn` is Python; `dsn_env` is Rust. See realtime.yaml comment.
  dsn: "${CHUNKSHOP_MEMORY_DSN}"
  dsn_env: CHUNKSHOP_MEMORY_DSN
  staging_table: chunkshop_staging
  staging_schema: public
  mode: consolidate
  min_age_seconds: 3600
framer:
  type: session_episode
  max_gap_seconds: 1800
  max_turns: 40
  max_words: 1200
chunker:
  type: consolidation
  base:
    type: sentence_aware
    max_chars: 2000
    min_chars: 200
  consolidator:
    mode: extractive
  fact_max_chars: 1200
embedder:
  type: fastembed
  model_name: Xenova/bge-small-en-v1.5-int8
  dim: 384
  threads: 4
target:
  type: postgres
  dsn: "${CHUNKSHOP_MEMORY_DSN}"
  dsn_env: CHUNKSHOP_MEMORY_DSN
  database: agent_memory
  table: memory
  mode: create_if_missing
  source_tag: default
  memory:
    tier: consolidated
    supersede: true
  promote_metadata:
    - path: kind
      type: text
    - path: session_id
      type: text
    - path: namespace
      type: text
    - path: tier
      type: text
    - path: recorded_at
      type: timestamptz
    - path: subject
      type: text
    - path: predicate
      type: text
    - path: object
      type: text
    - path: support_span
      type: text
    - path: confidence
      type: text
    - path: effective_from
      type: timestamptz
    - path: effective_to
      type: timestamptz
    - path: retracted
      type: boolean
    - path: retracted_at
      type: timestamptz
    - path: source_chunk_seq
      type: int
    - path: extractor
      type: text
runtime:
  omp_num_threads: 2
  heartbeat_every: 25
