Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
b86ad28
docs: unified memory plan (fold mem + sync into one CLI subsystem)
moekatib Apr 21, 2026
4494081
feat(mem): scaffold unified memory subsystem
moekatib Apr 21, 2026
3f62d99
feat(mem): shared postgres-core + wire up PGlite/Postgres plugins
moekatib Apr 22, 2026
61c0fbd
feat(mem): wire all `one mem` commands end-to-end (records, search, g…
moekatib Apr 22, 2026
b738f78
feat(sync): --to-memory dual-write into the unified memory store
moekatib Apr 22, 2026
25f9e32
feat(mem): zero-config memory + agent-declared searchable text
moekatib Apr 22, 2026
4ce94f9
feat(mem): surface the semantic-search upgrade path on every output
moekatib Apr 22, 2026
704e47f
feat(mem): replace-semantics upsert + fix stale Attio built-in profiles
moekatib Apr 22, 2026
4755256
refactor(mem): move src/lib/sync → src/lib/memory/sync
moekatib Apr 22, 2026
01296a0
feat(mem): memory is the primary sync target + `one mem sync` alias
moekatib Apr 22, 2026
7b564f2
fix(mem): auto-enable embeddings when an OpenAI key is set after init
moekatib Apr 22, 2026
dc908e2
feat(mem): sync state moves from .one/sync/sync_state.json to mem_syn…
moekatib Apr 22, 2026
ffa0a49
feat(mem): `sync query` + `sync search` read from mem_records
moekatib Apr 22, 2026
1c2fa9d
chore(mem): extend MemWriteReport with sourceKeysSeen + per-action ar…
moekatib Apr 22, 2026
6292ca1
fix(mem): three regressions found by the Gmail sub-agent verification
moekatib Apr 22, 2026
326e4ef
docs: update SKILL / guide / README / --help for unified memory + sync
moekatib Apr 23, 2026
a275c71
feat(mem): drop SQLite writes for non-enrich sync profiles
moekatib Apr 23, 2026
f0438b1
chore: bump to v1.42.0 for unified memory release
moekatib Apr 23, 2026
a03e910
fix(mem): idField accepts dot-paths; hard-reject nested objects (sile…
moekatib Apr 24, 2026
a82a179
fix(mem): honest total counts across mem list / sync query / sync sea…
moekatib Apr 24, 2026
e77e4e5
feat(mem): bring back SQL as `mem sql` / `sync sql` (read-only guard)
moekatib Apr 24, 2026
37a01a1
feat(mem): auto-migrate legacy .one/sync/data/<plat>.db on first sync…
moekatib Apr 24, 2026
ceb8047
fix(mem): unblock embedding backfill + reconcile — four post-test fixes
moekatib Apr 24, 2026
5936581
fix(mem): reindex filters unembedded rows + fetch timeout + orphan re…
moekatib Apr 24, 2026
1c8afd7
feat(mem): sync suggest-searchable + multi-record --show-searchable h…
moekatib Apr 24, 2026
cc3a2c2
fix(mem): --full-refresh reconcile gate + upsert self-heal
moekatib Apr 24, 2026
de8a302
fix(mem): migrate dry-run verb + graceful close on SIGTERM (#126, #127)
moekatib Apr 24, 2026
4a32b6e
fix(mem): migrate silently dropped Attio companies (nested idField)
moekatib Apr 24, 2026
e94f5ea
fix(mem): migrate identity-merge + doubling detection
moekatib Apr 24, 2026
4178d21
fix(mem): five typecheck regressions on the unified-memory branch
moekatib May 3, 2026
eb89dd2
feat(mem): embedded-postgres default backend (pgserve + runtime pgvec…
moekatib May 3, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
69 changes: 52 additions & 17 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -303,24 +303,56 @@ Default TTL is 1 hour. Configure via `ONE_CACHE_TTL` environment variable or `ca

Note: `actions execute` is never cached — it always hits the API fresh.

### `one sync`
### `one mem` — unified memory store

Sync platform data into local SQLite for instant queries, full-text search, scheduled refresh, and change-driven automation. The sync engine (`better-sqlite3`) is an optional dependency — install it once per machine:
One ships a local memory store (pglite default, Postgres pluggable) that backs both user-authored notes and synced platform data. **Zero-config** — the first `one mem` call on a fresh machine auto-initializes. No separate install step.

```bash
one sync install && one sync doctor
# User memories — works immediately on a new install
one mem add note '{"content":"Design review is Thursday"}' --tags work --weight 7
one mem search "design review" # hybrid FTS + semantic (if key set)
one mem list note --limit 20

# Enable semantic search (optional)
one init # re-run — prompts for OpenAI key
# OR
one mem config set embedding.apiKey sk-... # writes top-level openaiApiKey
# OR
export OPENAI_API_KEY=sk-... # no persistence

# Status + diagnostics
one mem status # backend, provider, _upgrade hint
one mem doctor # 7-check health report
```

Key surfaces: `add`, `get`, `update`, `archive`, `list`, `search` (`--deep` forces semantic), `context`, `link`/`linked`/`unlink`, `sources`, `find-by-source`, `export`, `import`, `migrate`, `vacuum`, `reindex`. Run `one guide memory` for the full reference.

### `one sync` (and `one mem sync` alias)

Sync platform data into the unified memory store for instant queries, hybrid FTS + semantic search, scheduled refresh, and change-driven automation. Memory is always written; pass `--no-memory` to skip (rare).

```bash
# Discover → init (one command: infer + late-bound connection + auto-test) → run
# Discover → init (seeds from built-in, auto-tests) → declare searchable → preview → run
one sync models stripe
one sync init stripe balanceTransactions # connection: { platform } baked in, test auto-run
one sync init stripe balanceTransactions

# Optional: declare clean fields for embedding, then preview
one sync init stripe balanceTransactions --config '{
"memory": {
"embed": true,
"searchable": ["description","type","amount","currency"]
}
}'
one sync test stripe/balanceTransactions --show-searchable

# Run — every row lands in memory (SQLite also written for enrich-phase compat)
one sync run stripe --since 90d
one mem sync run stripe # identical (alias)

# Query, search, SQL
# Query + search (reads from memory)
one sync query stripe/balanceTransactions --where "status=available" --limit 20
one sync search "refund"
one sync sql stripe "SELECT count(*) FROM balanceTransactions"
one sync query stripe/customers --where 'address.city=SF' # dotted paths supported
one sync search "refund" # hybrid, per-type

# Schedule unattended syncs + change hooks
one sync schedule add stripe --every 1h
Expand All @@ -334,20 +366,23 @@ one sync run stripe --full-refresh

> **Connections are late-bound.** Profiles use `"connection": { "platform": "<name>", "tag"?: "..." }` instead of literal `connectionKey` strings. The key is resolved at sync time, so `one add <platform>` (re-auth) doesn't break the profile. `tag` only needed for multi-account platforms (e.g. two Gmail accounts).

> **`memory.searchable` paths.** Drives what gets embedded + FTS-indexed. Supports numeric indexes (`values.name[0].full_name`) and `[]` wildcards (`messages[].snippet`, `messages[].payload.parts[].body.data`). Without declared paths the default walker concatenates every string — correct but noisy for hierarchical APIs. Always declare when `embed: true`.

| Subcommand | What it does |
|------------|-------------|
| `install` / `doctor` | Install + verify the SQLite engine |
| `profiles [platform]` | List built-in pre-validated profiles |
| `doctor` | Verify sync engine health |
| `models <platform>` | Discover available data models |
| `init <platform> <model>` | Create profile (auto-infers all fields, auto-resolves key, auto-runs test) |
| `test <platform>/<model>` | Validate + auto-fix profile from real API response (also runs inside init) |
| `run <platform>` | Sync data (`--full-refresh`, `--since`, `--dry-run`) |
| `query <platform>/<model>` | Query with `--where`, `--after/before`, `--refresh` |
| `search <query>` | FTS5 across all synced data |
| `sql <platform> <sql>` | Raw SELECT queries |
| `init <platform> <model>` | Create/patch profile (seeds from built-in, auto-tests) |
| `test <platform>/<model>` | Validate profile. `--show-searchable` previews embedded text |
| `run <platform>` | Sync data (`--full-refresh`, `--since`, `--dry-run`, `--no-memory`) |
| `query <platform>/<model>` | Query memory with `--where` (dotted paths), `--after/before` |
| `search <query>` | Hybrid FTS + semantic across all synced data |
| `list [platform]` | Show profiles, record counts, freshness |
| `schedule add/list/status/remove/repair` | Cron-backed scheduled syncs with drift detection |
| `remove <platform>` | Delete local data (`--dry-run` to preview) |
| `remove <platform>` | Delete synced data (`--dry-run` to preview) |

Change hooks (`onInsert`, `onUpdate`, `onChange`) fire per-page during sync — pipe to a shell command, a flow, or an event log. Root-array responses (e.g. Hacker News `/v0/topstories.json` → `[9129911, 9129199, ...]`) are supported by setting `resultsPath` to `""`, `"$"`, or `"."`; primitive elements are auto-wrapped as `{ [idField]: value }`. Run `one guide sync` for the full reference.
Change hooks (`onInsert`, `onUpdate`, `onChange`) fire per-page during sync — pipe to a shell command, a flow, or an event log. Root-array responses (e.g. Hacker News `/v0/topstories.json` → `[9129911, 9129199, ...]`) are supported by setting `resultsPath` to `""`, `"$"`, or `"."`; primitive elements are auto-wrapped as `{ [idField]: value }`. Run `one guide sync` or `one guide memory` for the full reference.

### `one guide [topic]`

Expand Down
Loading