Repository navigation
v0.16.0
The big memory update.
- BREAKING: async writes for shared memory
- npx @plur-ai/migrate adds awaits
- Postgres option: scale out
- scope allow-list, BM25 in SQL
- cross-process write safety
- unified recall surface — same engine local and server-side
One engine, two deployments: the same memory engine now spans a laptop YAML
file and a shared Postgres server. That is why the write path went async —
memory that several agents and processes share safely cannot pretend it is a
synchronous local file. Postgres is an option for stores that outgrow local
files, not a new requirement: YAML stays the default and the source of truth
everywhere else.
BREAKING — the write path is asynchronous
Plur's store interface and 23 public methods now return promises (#728):
compact, episodeToEngram, getById, ingest, inject, installPack,
learn, list, listPinned, listStores, outboxCount, purgeTensions,
recall, receipt, recordTensions, reindex, rerankerEvalStatus,
resolveTension, saveMetaEngrams, setPinned, status, sync,
updateEngram.
learnRouted, learnBatch, recallHybrid, injectHybrid, feedback,
forget and flushOutbox were ALREADY async before 0.16 and are unchanged
here — an earlier draft of this section listed them as newly promise-returning,
which would have sent you auditing call sites that never moved.
npx @plur-ai/migrate still reports un-awaited calls to learnRouted,
learnBatch, feedback, forget and flushOutbox, because such a call was a
bug before this release too. It does NOT report recallHybrid or
injectHybrid — those are embedding-backed retrieval that callers have always
awaited, so they are out of the tool's scope.
Every out-of-tree consumer must add await. The failure mode is quiet: a
call whose result is used without awaiting yields a Promise, and most
assertions and property reads on a Promise succeed rather than throw, so code
appears to work while operating on nothing. {...plur.status()} becomes {}.
for (const e of plur.recall(q)) throws, but plur.recall(q).length is simply
undefined. TypeScript catches all of it; JavaScript consumers will not.
capture() and timeline() stay synchronous — they are backed by
episodes.yaml, not the engram primary store. So do suggestScope,
dismissScope, reofferScopes, CapabilityCanary.warnings and
listImportSources: an automated pass made them async during the flip even
though they do no async work, and they were reverted rather than shipped as
breaking changes that bought nothing.
Why: a network-backed store cannot satisfy a synchronous contract (there is no
synchronous Postgres client for Node, and manufacturing one trades a documented
limitation for an undocumented hazard). The sync interface was a hard ceiling on
running core anywhere except one local process. See ADR-0003 and ADR-0004.
PrimaryStore and AsyncPrimaryStore have collapsed into one interface;
AsyncPrimaryStore remains as a deprecated alias so existing imports resolve.
StorageAdapter — a public export — gains two required members (role,
vectorIndex) and demotes syncFromYaml() / reindex() to optional. An
out-of-tree implementation of that interface will not compile until updated;
DERIVED_INDEX_DEFAULTS is exported to make that a two-line change for an
adapter that has the historical behaviour (a derived index over YAML, answering
searchVector exactly). Adapters that are approximate should declare that
rather than take the default — a wrong vectorIndex is worse than none,
because it is a claim a caller may act on.
Added
-
MCP Toplist rank badge (#748) in the README.
-
Packs install from a URL (#746):
plur packs install <url>and
plur packs preview <url>fetch a pack over HTTP instead of requiring a local
directory, so a pack can be shared by link. Preview still runs the security
scan before anything is written, and the same scan gates install. -
The engram schema tolerates an unknown
commitmentvalue (#744): parsing
passes through values it does not recognise rather than rejecting the engram,
so a store written by a newer or differently-configured deployment stays
readable instead of failing the whole load. -
@plur-ai/mcpexposes a side-effect-free./toolssubpath (#714, #717):
import { getToolDefinitions } from '@plur-ai/mcp/tools'yields the tool
definitions without starting a server or touching stdio, so another server can
host PLUR's tools inside its own process. -
npx @plur-ai/migrate— finds the un-awaited calls this release creates, and fixes the unambiguous ones. Reports by default;--writeapplies. It refuses to rewrite the three cases where insertingawaitchanges program meaning rather than just adding a wait (inside aPromisecombinator array, a concise arrow body, a result consumed across lines) and lists them for a human instead. Exit code 2 when anything needs attention, so it composes in CI. Every hazard it guards is one the codemods that migrated PLUR itself actually hit. -
Postgres as a primary store (ADR-0005) (#720).
new Plur({ store: new PostgresAdapter({ connectionString }) })runs the engine directly against server Postgres — the same engine, a different deployment.pgvectorfor vectors, exact or HNSW with the recall target declared rather than implied.Vectors on this tier are not populated by the engine.
upsertEmbedding
andsearchVectorare implemented and work, but core's only caller of
upsertEmbeddingruns for the PGLite derived index, never for a primary
store — soengram_embeddingsstays empty unless your deployment writes to
it, and semantic recall falls back to loading engrams and scoring in memory.
ConfiguringvectorIndex: 'hnsw'now logs a warning saying so rather than
quietly indexing an empty table. Wiring the engine to fill it is follow-up
work: the existing auto-embed pass loads the whole corpus and probes each id
on every write, which at the 50,000-engram threshold that selects this tier
would cost more than the gap it closes. -
Cross-process write safety (ADR-0004) (#719).
PrimaryStore.withExclusiveAccess?()— the store decides how it is serialized, because the store is what knows what it shares.PostgresAdaptertakes a session-scoped advisory lock; a local-file store keeps its file lock. Without this, two processes over one database silently overwrote each other, and a read-onlyrecall()on one could delete an engram another had just committed (recallupdates activation, so it is a whole-corpus write). -
Permitted-scope allow-list pushed into the query (#715, #739, #743) —
scopesonRecallOptionsand nowInjectOptions. An AUTHORIZATION filter, distinct from thescopevisibility filter: absent = unrestricted,[]= matches nothing, non-empty = exact membership with no hierarchy expansion and no personal-family pass-through.inject()had no authorization filter at all before this, which for a multi-tenant caller meant every principal's personal engrams reached every other principal's context. -
BM25 narrowing pushed into Postgres (#711, #732, #743) via
pg_trgm, with corpus-wide statistics (CorpusStats:N, per-termdf,avgDocLength) supplied by the store so narrowing cannot change the ranking. Tokens are computed in TypeScript at write time by the sameftsTokenizethe scorer uses, so there is no second tokenizer free to drift.
Fixed
- Pre-release audit fixes (#747): concurrent Postgres schema init, the migrate
tool's combinator/paren/template/optional-chaining scanning,setPinned's
fabricated remote return, the release smoke's authorization checks and its CI
wiring, plus lean-tool/storage/ADR documentation drift. - Independent pre-release audit fixes (#752, #755): the migrate tool's ASI
hazard (a line-leading(await ...)after an unterminated statement parses
as a call on the previous expression — it now refuses), bracket-indexed
receivers it silently missed, and a combinator false positive from comment
text; recall's multi-store union is now scored with exact union corpus
statistics instead of primary-only ones (a term absent from the primary
corpus priced as maximally rare and buried the best match); vacuous fallback
paths in the migrate method-list guard now hard-fail in CI;Plur's
constructor warns when a supplied store implements exactly one of
loadByIds/updateMany(safe via the call-site fallback, but almost
certainly an implementation mistake); the
PostgresAdapter.close()construction-race leak is actually documented
(#751); release.sh gained a working-tree preflight and canary-publish
recovery guidance; README states the Postgres-tier embeddings caveat. - A
recall()could delete the corpus on a partially-targeted store (#749).
loadByIdsandupdateManyare independently optional onPrimaryStore;
with the targeted read present and the targeted write absent, reactivation's
whole-file fallback replaced the corpus with the current result page —
measured: 12 engrams in,recall(limit 3), 3 left. Both paths are now gated
behind one capability check (the pair, or neither), andupdateEngram's
remote-store error path no longer takes down the MCP server. recall()returned the wrong rows on a pushdown store (#750). Two bugs:
secondary-store and pack engrams were appended AFTER primary results, so a
team engram that was the single best match never appeared once the primary
store hadlimithits — they are now ranked together; and the fixed 3x
over-fetch starved recall when residual filters (expiry,min_strength)
rejected more than two thirds of a page — the fetch now widens and re-queries,
bounded at three rounds (recoverable rejection ceiling 26/27 ≈ 96.3%).
Fixed
- BM25 reverse-substring matches (#721, #724):
qt.includes(t)let any document token that was a non-prefix substring of the query score a hit —deployingmatched an engram about yin,postgresmatched one about res. Nowqt.startsWith(t), which keeps morphological prefixes (deploy→deploying) and drops the junk. Measured on a 3,930-engram store: no query loses results, and the reverse-substring matches it removes were never meaningful. pgis externalized from the bundle — it is anoptionalDependency, so it was being inlined intodistand the publishedPostgresAdapterwould have thrown on first use.plur learn's 5s remote-write timeout was dead code (anawaitinsidePromise.raceresolved the call before the timer was armed).init-remotesilently ignored--quietand printed prose under--json.- MCP tool schemas silently dropped array items (#705): a union item schema was
emitted without a usableitemsdefinition, so a client sending a well-formed
array had elements discarded on the way in. Union item schemas are now coerced,
and a partial drop is surfaced rather than passed through as a shorter array. truncatedwas reported wrong whenbudget.max_resultscapped a recall
(#725, #726): the flag was computed before the budget cap applied, so a
truncated result set claimed to be complete and callers had no signal to page.server.jsonversion drift (#699): the MCP Registry manifest carried its
version in two places and only one was bumped, so the published listing could
disagree with the package.release.shnow writes both.
Changed
plur_recallis now the unified recall tool (#693, #702): gains amodeparameter —'hybrid'(default, BM25 + local embeddings via RRF) or'keyword'(BM25-only). Existing callers that pass nomodeget a quality upgrade without any API change. Breaking for the lean/cursor profile:plur_recall_hybridis no longer a top-level lean tool —plur_recalltakes its slot. Agents configured against the lean profile that callplur_recall_hybridby name will still get results (the tool remains accessible viaplur_admindispatch), but should migrate toplur_recall.plur_recall_hybridis a deprecated alias (#693): it invokes the canonicalplur_recallhandler with{mode:'hybrid'}and prepends a one-linedeprecatednotice — a real forwarder, so budget capping, episode expansion, the degraded-embeddings warning and reranker surfacing cannot drift between the two before the alias is removed. Removal target: 0.18. Accessible in both full and lean profiles (viaplur_admin) to avoid breaking existing CLAUDE.md files and agent templates in the wild.
Added
plur initnow prompts for anonymous usage statistics opt-in (#701). On interactive installs a single yes/no prompt asks "Enable anonymous usage statistics? (helps us improve PLUR — no code, no keys) [y/N]" and persists the answer to~/.plur/telemetry.json. Non-interactive installs (CI, piped stdin,--no-prompt) writeenabled:falsesilently — they are never opted in without explicit consent. Already-configured installs skip the prompt entirely, as do installs with an explicitPLUR_TELEMETRYenv var — env wins at runtime, so no contradictory config file is written. To enable after the fact:PLUR_TELEMETRY=onenv var or edit~/.plur/telemetry.json. Seedocs/telemetry-design.mdfor what is collected (learn/recall counters only — no code, no keys, no content).