Overview

TARS memory operates across three layers: file-based narrative storage, Postgres structured data, and the wiki as the curated knowledge layer.

Architecture

Session History (raw)
  ~/.claude/projects/**/*.jsonl (1,266+ files, 177MB)
      │
      ▼ [learning-synthesis.ts hook at SessionEnd]
      │
  ┌───┴───────────────────────────┐
  │                               │
  ▼                               ▼
MEMORY/Learning/{PHASE}/     Postgres learnings table
  (markdown narrative)        (structured + embeddings)
  65+ files                   57+ rows
      │                               │
      ▼                               ▼
  Wiki (curated)              Postgres signals table
  wiki.tedlango.com           (ratings, failures, patterns)
  (published knowledge)       117+ rows

File-Based Memory (~/.claude/MEMORY/)

DirectoryPurposeStatus
Learning/{PHASE}/Narrative learnings by Algorithm phaseActive — 65+ files
Work/Fleet session logsActive — 17 files
State/Operational metricsRetired → Postgres
Signals/Quality signalsRetired → Postgres

Learning Phases

  • OBSERVE — Context gathering insights
  • THINK — Option generation patterns
  • PLAN — Approach selection learnings
  • BUILD — Implementation patterns
  • EXECUTE — Execution discoveries
  • VERIFY — Testing and validation insights
  • LEARN — Meta-learnings and corrections

Learning Pipeline

The learning pipeline runs at SessionEnd and processes the session’s JSONL transcript:

  1. Classify — Deterministic: count turns, tool calls, detect project. Skip trivial sessions.
  2. Extract — Heuristic: find corrections, error→fix patterns, decisions, discoveries.
  3. Write — Dual-write: markdown to MEMORY/Learning/ + row to Postgres with tags.
  4. Signal — Record quality signals (failures, patterns) to Postgres.

TELOS (Life Context)

Deep personal context at ~/pai/TELOS/:

  • MISSION.md, GOALS.md, PROJECTS.md, BELIEFS.md
  • MODELS.md, STRATEGIES.md, NARRATIVES.md
  • LEARNED.md, CHALLENGES.md, IDEAS.md

Loaded by skills that need personal context (PAIUpgrade, JobSearch, etc.).