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/)
| Directory | Purpose | Status |
|---|---|---|
Learning/{PHASE}/ | Narrative learnings by Algorithm phase | Active — 65+ files |
Work/ | Fleet session logs | Active — 17 files |
State/ | Operational metrics | Retired → Postgres |
Signals/ | Quality signals | Retired → 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:
- Classify — Deterministic: count turns, tool calls, detect project. Skip trivial sessions.
- Extract — Heuristic: find corrections, error→fix patterns, decisions, discoveries.
- Write — Dual-write: markdown to MEMORY/Learning/ + row to Postgres with tags.
- 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.).
Linked from (3)
- Hook System
infrastructure
Overview
Hooks are TypeScript scripts that fire on Claude Code lifecycle events. …
- Postgres Knowledge Layer
infrastructure
Overview
Neon Postgres serves as the structured data backend for TARS. It …
- TARS Architecture Overview
infrastructure
System Architecture
TARS is a Personal AI Infrastructure built on Claude Code …