Seed / migrate the database
real-data.ts (with the Oren-phone override).
Seed only the bot golden exemplars
bot_conversations golden rows (retires obsolete exemplar ids, then upserts the current set), it does not touch customers/orders.
Isolated testing: the mirror
Never test write-paths against prod. Useneondb_mirror: a separate Neon database (not a branch) holding a copy of live data.
1
Build/refresh the mirror
node scripts/setup-mirror.mjs (full detail in scripts/MIRROR-README.md).2
Point the review server at it
Set
DATABASE_URL / POSTGRES_URL to the mirror URL (.env.local’s DATABASE_URL_UNPOOLED with /neondb → /neondb_mirror) and npm run dev (port 3100).How the bot “improves”
The model weights never change. The only quality lever is curated golden exemplars: golden rows are always surfaced first in recall; non-golden rows surface only on a keyword/FTS match and are not quality-filtered. To improve the bot, promote a well-handled real thread to golden (mechanism: thegolden flag on bot_conversations). The documented upgrade path is semantic recall via pgvector + an embeddings model so the bot recalls by meaning, not just keywords.
Verifying changes
The project convention is the/verify-loop skill: define success criteria + rubric, run realistic + adversarial + regression scenarios under isolated conditions, score with independent judge subagents to consensus, fix the root cause, rerun until unanimous. Run write-path verification on the mirror; keep prod untouched.