Repository navigation
Conversation
This was referenced Sep 21, 2026
Merged
Merged
This was referenced Sep 21, 2026
Draft
[session storage 2/2] Remove open-or-create from both stores, and close from the segment store
#1625
Draft
[qdrant options] Let a deployment tune a Qdrant collection's HNSW, optimizers and quantization
#1618
Draft
edwinyyyu
force-pushed
the
feat/vector-store-declared-routing-main
branch
from
September 21, 2026 22:44
48951bf to
c164c56
Compare
edwinyyyu
force-pushed
the
feat/vector-store-declared-routing-main
branch
from
September 25, 2026 23:10
c164c56 to
2dc8c96
Compare
edwinyyyu
force-pushed
the
feat/vector-store-declared-routing-main
branch
from
October 7, 2026 19:37
126f04f to
5745b0e
Compare
This was referenced Oct 7, 2026
edwinyyyu
force-pushed
the
feat/vector-store-declared-routing-main
branch
from
October 7, 2026 21:16
5745b0e to
8f3792c
Compare
edwinyyyu
force-pushed
the
feat/vector-store-declared-routing-main
branch
3 times, most recently
from
October 9, 2026 00:52
059b801 to
9031d25
Compare
edwinyyyu
force-pushed
the
feat/vector-store-declared-routing-main
branch
2 times, most recently
from
October 9, 2026 20:12
48cb234 to
75bacd5
Compare
edwinyyyu
force-pushed
the
feat/vector-store-declared-routing-main
branch
from
October 9, 2026 20:22
75bacd5 to
6cdbe07
Compare
This was referenced Oct 9, 2026
edwinyyyu
marked this pull request as ready for review
October 9, 2026 21:02
The event backend wrote every property of an event into its vector record and mapped the caller's whole filter onto the vector store, so a user key that a deployment never declared was both stored and filtered there: on Qdrant and Milvus as unindexed payload a filtered query scans for. The segment store already holds every property and already receives the whole filter for the context windows, so the vector side only duplicated work the segment store does anyway. The vector record now carries the keys the collection declares: EventMemory's reserved timestamp, the `_`-prefixed system properties an adapter stamps on the event, and the keys a project's `properties_schema` declares. The vector store is queried with the conjuncts of the filter that name only such fields; a conjunct is dropped whole when any field under it is undeclared, so dropping only ever widens the vector search, and the segment store narrows it back on the windows. An undeclared key never reaches the vector store, so a tenant's undeclared properties cannot shape what it stores or scans. `filter_fields` joins the filter parser: every field name a tree addresses. Rebased onto MemMachine#1631, where the vector record no longer carries the segment uuid (the segment store maps a derivative to its segment). Co-Authored-By: Claude Fable 5.1 <[email protected]> Claude-Session: https://claude.ai/code/session_01ESpWYTmCR7X3bJEpoA8SAn
edwinyyyu
force-pushed
the
feat/vector-store-declared-routing-main
branch
from
October 10, 2026 00:32
6cdbe07 to
b1c3242
Compare
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Purpose of the change
The event backend wrote every property of an event into its vector record and mapped the caller's whole filter onto the vector store, so a user key a deployment never declared was both stored and filtered there: on Qdrant and Milvus as unindexed payload a filtered query scans for. Now an undeclared key stays off the vector store, so a tenant's undeclared properties cannot shape what it stores or scans; #1670, stacked on this, removes the per-project declaration, so no tenant key reaches it at all. The segment store already holds every property and already receives the whole filter for the context windows, so the vector side only duplicated work the segment store does anyway.
The vector record now carries the keys the collection declares: EventMemory's reserved timestamp, the
_-prefixed system properties an adapter stamps on the event, and the keys a project'sproperties_schemadeclares, until #1670 removes that option (collection.config.indexed_properties_schema). The vector store is queried with the conjuncts of the filter that name only such fields; a conjunct is dropped whole when any field under it is undeclared, so dropping only ever widens the vector search, and the segment store narrows it back on the windows. An undeclared key never reaches the vector store.filter_fieldsjoins the filter parser: every field name a tree addresses. Tests: an undeclared property stays on the segment and off the record; a conjunct on an undeclared property reaches only the segment store; an undeclared property under anORleaves the vector search unfiltered;filter_fieldsnames every field under every node.This is the routing half of what was #1628 on
speedkick(its store-side half, the stores rejecting undeclared keys, is deferred to after #1627); it is re-derived onto #1736's collection shape from the same commit, where the segment store, not the vector record, maps a derivative to its segment.Part of the fix for #1781.
Stack
21 open PRs: three independent PRs, and the vector store tree of short parallel branches. Every PR in the tree has
feat/horizontal-scalingas its GitHub base, and the independent PRs havemain. The branches are in a fork, and a pull request can target only this repository's branches, so the on column gives the order the PRs build on each other. A stacked PR's diff on GitHub includes the PRs under it until they merge.Independent of the vector store tree, directly on
main:mainmainmainThe vector store tree. Each PR builds on the one in its on column; PRs on the same parent are parallel branches and do not depend on each other. #1631 is closed, superseded by #1733–#1736, which hold its changes split in four, with review changes since. #1702 and #1670 sit beneath #1627, whose code depends on them. Until the PRs under it merge, their changes show in a stacked PR's diff.
mainfeat/horizontal-scaling)feat/horizontal-scalingfeat/horizontal-scaling)feat/horizontal-scalingfeat/horizontal-scaling)feat/horizontal-scalingfeat/horizontal-scaling)feat/horizontal-scalingfeat/horizontal-scaling)feat/horizontal-scalingfeat/horizontal-scaling)feat/horizontal-scalingfeat/horizontal-scaling)feat/horizontal-scalingfeat/horizontal-scalingfeat/horizontal-scalingThis PR is its one commit,
b1c3242fe, directly onfeat/horizontal-scaling. #1670 is stacked on it.Verification
At this PR's head
b1c3242fe, on 2026-10-09, onfeat/horizontal-scalingwith #1813 merged:ruff checkandruff format --checkclean;ty checkclean as CI runs it (uv run --frozen --all-extras ty check --project packages/server);uv lock --checkclean.Before the rebase onto #1813's merge: At this PR's head
6cdbe0733, on 2026-10-09:ruff checkandruff format --checkclean;ty checkclean as CI runs it (uv run --frozen --all-extras ty check --project packages/server);uv lock --checkclean; the episodic memory and filter tests pass, 448 tests. The full suites have not run on this tree, which is new with #1670 above it; with #1670 beneath it, the server suite without integration tests last passed at9031d25f4, on 2026-10-08, 2166 tests, and the integration tests of the vector stores, the resource manager, episodic memory, and semantic storage at9031d25f4, on 2026-10-08, 689 tests, against PostgreSQL 16, Neo4j, Qdrant 1.19.1, and Milvus 2.6.24 in containers.🤖 Generated with Claude Code
https://claude.ai/code/session_01ESpWYTmCR7X3bJEpoA8SAn