Skip to content

feat(engine): adopt memory-core as the one local engine (M2-C)#217

Merged
vreshch merged 1 commit into
masterfrom
feature/m2c-memory-core-engine
Jul 6, 2026
Merged

feat(engine): adopt memory-core as the one local engine (M2-C)#217
vreshch merged 1 commit into
masterfrom
feature/m2c-memory-core-engine

Conversation

@vreshch

@vreshch vreshch commented Jul 6, 2026

Copy link
Copy Markdown
Member

What

Adopt @agentage/memory-core (^0.1.1, MIT) as the one local engine for the CLI (decision V11-C). The shipped FTS5/SQLite index engine is retired; every memory verb now runs over memory-core's git-per-vault local backend + federation router.

Why

One engine, everywhere. memory-core is the shared foundation (also under server-memory and the cloud MCP). The CLI stops carrying its own storage/index/edit code and its own config schema, and instead delegates to the published package. Net: -1120 lines, a smaller dependency surface, and byte-identical storage semantics with the rest of the product.

Config-format unification

  • vaults.json is now the memory-core object-map shape: { $schema?, version: 1, vaultsDir?, autodiscover?, autoInit?, default?, vaults: { <name>: { path?, origin?: [{ remote, interval?, ignore? }], mcp? } } }. Validation is memory-core's validateConfig (rule: an entry needs origin and/or path).
  • The CLI keeps ownership of the file lifecycle: scaffolding still injects the $schema link (https://agentage.io/schemas/vaults.schema.json), and saves stay atomic + 0600.
  • YAML acceptance dropped - one format everywhere; the standalone @agentage/server-memory reads the same file and parses only JSON.
  • couchdb vault type removed from the CLI surface (the unified schema has no per-vault type; account/sync vaults are deferred - do not invent fields memory-core does not validate).

Vault commands (unified shape)

  • vault add <name> --local [path] writes { path } (path defaults to ~/vaults/<name>); --git <remote> writes { origin: [{ remote }] }. First vault added becomes default.
  • vault remove <name> deletes the entry; if it was the default, the default is reassigned to a remaining vault (or cleared when none remain).
  • vault reindex is gone (no index to rebuild).

Engine swap

DirectClient builds memory-core local backends + createRouter from the loaded config and delegates search/read/write/edit/delete/list. MemoryClient result shapes are now memory-core's contract types at full fidelity:

  • search -> SearchResult (hits { path, title, snippet, score, updated } + nextCursor?)
  • read -> MemoryView ({ path, title, frontmatter, body, tags, updated, deleted })
  • write/edit -> WriteResult ({ path, rev, updated })
  • list -> ListResult (folder-TREE with depth/tags)
  • delete -> { path, deleted } (git rm + commit; recoverable from history)

@<vault>/<path> addressing and --vault both route through the router (--vault becomes an @-prefix). Human UX and flags are unchanged; --json prints the structured result.

Removals (retired FTS5 engine)

Deleted src/lib/{vault-index,vault-scan,vault-store,memory-edit,path-safety}.ts, src/commands/reindex.ts (+ tests), the vault reindex registration, and the node:sqlite bootstrap / --experimental-sqlite re-exec in src/cli.ts + the vitest execArgv entry. git grep needs no index.

R6 package guard

Amended minimally (sanctioned by V7/V11-C): the runtime-dep set is now @agentage/memory-core + chalk + commander + open (drops the direct yaml/zod). The forbidden-token binding is unchanged - still no daemon, no :4243, no native addons.

Verification

  • npm run verify green (type-check + e2e type-check + lint + format + 118 unit tests + build).
  • Coverage 86/83/71/88 (thresholds 65/70/70/70).
  • Offline e2e tier green (vault-offline, memory-offline, m1-requirements) driving the built binary; the 6 memory verbs pass network-blackholed against a scratch vault, git-initted in place with a commit per mutation.
  • Manual round trip through dist/cli.js in an isolated AGENTAGE_CONFIG_DIR: add -> write -> search -> read -> edit -> list -> delete, confirmed the vault folder became a git repo with write/edit/delete commits.

Do not merge until CI is green.

@github-actions

github-actions Bot commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

🎉 PR Validation ✅ PASSED

Commit: 0c35e65918646788317c0446be09fe47d6a4c9ed
Branch: feature/m2c-memory-core-engine

Checks:

  • ✅ Release guard (no version/changelog changes)
  • ✅ Dependencies installed
  • ✅ Type check passed
  • ✅ Linting passed
  • ✅ Format check passed
  • ✅ Tests + coverage passed
  • ✅ Build successful

Ready to merge!


🔗 View workflow run
⏰ Generated at: 2026-07-06T01:17:13.786Z

@vreshch vreshch marked this pull request as ready for review July 6, 2026 01:17
@vreshch vreshch merged commit 66bf9c6 into master Jul 6, 2026
2 checks passed
@vreshch vreshch deleted the feature/m2c-memory-core-engine branch July 6, 2026 01:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant