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)
| Table | Purpose | Key Columns |
|---|
projects | All 74+ projects Ted works on | slug, name, category, status, r2_path, telos_goal |
learnings | Synthesized insights from sessions | phase, content, tags, source_session, embedding |
signals | Quality signals (ratings, failures, sentiment) | type, source, score, content |
activity | Session audit trail (from hooks) | session_id, agent_name, event_type, cost_cents |
wiki_pages | Wiki page metadata and search index | slug, title, page_type, tags, embedding |
upgrades | PAI self-modification changelog | version, category, description, changes |
What Postgres Owns vs Files
| Postgres | Files |
|---|
| Project status and metadata | Narrative learnings (MEMORY/Learning/) |
| Activity audit trail | Session transcripts (JSONL) |
| Cost tracking | Skill definitions (SKILL.md) |
| Evaluator ratings | TELOS context (goals, beliefs) |
| Wiki page index | Project working files (R2) |
| Cross-project queries | Wiki source content (markdown) |
Lookup Rule
- Current state → Query Postgres
- Narrative/reasoning → Read wiki or markdown files
- Active project context → Read file system
- Postgres holds pointers (file paths, wiki slugs) to resolve structured queries to narrative artifacts