Skip to content

v1.43.2

Choose a tag to compare

@moekatib moekatib released this 04 May 02:11
· 49 commits to main since this release

Folds the standalone @withone/mem package into the One CLI as a pluggable memory subsystem, makes it the primary target for sync, and introduces a real-Postgres-by-default story for new users.

Default backend: embedded-postgres

New installs get a real local Postgres process via pgserve (Postgres 18, cluster bootstrapped at ~/.one/pg/cluster/). PGlite repeatedly corrupted during real syncs against ~250M of Gmail data, so it's been retired from the product surface — unregistered from the plugin registry, removed from mem init, mem config, and the help/doctor diagnostics. The plugin source remains in tree as a dev-only unit-test fixture; not bundled, not selectable.

  • First boot downloads ~52MB of Postgres binaries; later boots are ~2s.
  • The daemon survives across CLI invocations via a .pgserve.json PID/port file. Multiple One CLI processes share one cluster.
  • pgserve auto-provisions databases on first connect.
  • Long-term convergence: same cluster will host one-run's tables once it adopts pgserve too.

Runtime pgvector detection

The plugin probes CREATE EXTENSION IF NOT EXISTS vector once at first connect. Available → vectorSearch: true, schema applies the vector block (extension, embedding columns, HNSW index, hybrid_search function), and the vector-aware mem_upsert_by_keys overrides the no-vector variant. Not available → vectorSearch: false, FTS-only, with a structured _upgrade hint on mem doctor, mem search, and mem status pointing at brew install pgvector. Reversible — install pgvector later and the next ensureSchema picks it up via IF NOT EXISTS ALTERs.

What's new in the unification

  • Zero-config memory — auto-initializes the configured backend on first call. No mem init prerequisite.
  • Top-level OpenAI key — stored as config.openaiApiKey, same precedence chain as ONE_SECRET.
  • Upgrade hintsmem status / mem search / mem doctor carry a structured _upgrade block when semantic search is available but off. Three variants: no OpenAI key, key but provider=none, and now: backend without pgvector.
  • Agent-declared memory.searchable — profiles carry dot-paths that drive embedded + FTS text. Supports numeric indexes and [] wildcards.
  • Memory-primary sync — every sync run writes into mem_records. SQLite dual-write retained only for enrich profiles.
  • one mem sync alias — full alias of one sync, single command tree.
  • Sync state moves to mem_sync_state table — legacy .one/sync/state/*.json auto-migrated on first access.
  • sync query --where supports dotted paths (values.job_title[0].value like %Engineering%).
  • Replace-semantics upsert — synced rows replace data, tags, searchable_text, content_hash wholesale so fields removed upstream actually disappear from memory.
  • Deterministic mergeORDER BY r.updated_at DESC NULLS LAST, r.id ASC LIMIT 1 so multi-row key overlap doesn't pick a random winner.
  • Schema race fixensureSchema runs inside client.transaction(...) with a pg_advisory_xact_lock, pinned to a single connection so concurrent CLI processes can't race on CREATE EXTENSION / CREATE OR REPLACE FUNCTION.

Migration

one mem migrate reads legacy .one/sync/data/*.db files into the unified store. Self-heals stale installed-profile idField against the in-tree built-in (with --no-heal opt-out and full transparency in agent JSON: originalIdField, healedTo, builtinNewerThanInstalled, plus a tailored note). Read-only on the user's SQLite — no journal_mode rewrite, no -wal/-shm siblings, no destructive corruption-recovery rename. --cleanup --dry-run previews the file list before touching anything.

Verified end-to-end against 14,543 rows of real production data

Total Inserted MergedByIdentity Skipped
14,543 24 3,474 0

Idempotency: re-running migrate produces 0 new inserts; all updates. Concurrency: 3 parallel mem doctor runs all green. mem migrate dry-run does not create -wal/-shm siblings.

Deprecations (non-breaking)

  • --to-memory flag on sync run — silent no-op (memory always written). Use --no-memory to opt out.
  • sync sql — errors with a pointer to mem search / mem list.
  • PGlite — retired from the product surface.

Schema version 2.1.0.