Overview

Neon Postgres serves as the structured data backend for TARS. It replaced the SQLite coordination DB and the empty MEMORY/State/ and MEMORY/Signals/ files as of 2026.04.23.

Connection

  • Host: ep-fancy-sky-anz2ekip-pooler.c-6.us-east-1.aws.neon.tech
  • Database: neondb
  • Project: Ted Wiki (independent from WFM Labs)
  • Extension: pgvector (768-dim embeddings)
  • Client: ~/.claude/hooks/lib/postgres.ts
  • Credential: NEON_DATABASE_URL in secrets.yaml + settings.json env

Schema (6 tables)

TablePurposeKey Columns
projectsAll 74+ projects Ted works onslug, name, category, status, r2_path, telos_goal
learningsSynthesized insights from sessionsphase, content, tags, source_session, embedding
signalsQuality signals (ratings, failures, sentiment)type, source, score, content
activitySession audit trail (from hooks)session_id, agent_name, event_type, cost_cents
wiki_pagesWiki page metadata and search indexslug, title, page_type, tags, embedding
upgradesPAI self-modification changelogversion, category, description, changes

What Postgres Owns vs Files

PostgresFiles
Project status and metadataNarrative learnings (MEMORY/Learning/)
Activity audit trailSession transcripts (JSONL)
Cost trackingSkill definitions (SKILL.md)
Evaluator ratingsTELOS context (goals, beliefs)
Wiki page indexProject working files (R2)
Cross-project queriesWiki source content (markdown)

Lookup Rule

  1. Current state → Query Postgres
  2. Narrative/reasoning → Read wiki or markdown files
  3. Active project context → Read file system
  4. Postgres holds pointers (file paths, wiki slugs) to resolve structured queries to narrative artifacts