ProtectedconstructorStaticInstanceApplies one EntityRecordDocument's current state to the loaded indexes: an upsert when it carries a usable vector, a removal when it doesn't. Safe to call for indexes that are not loaded (no-op) or still loading (the change is replayed onto the load's result).
Removes an EntityRecordDocument from every loaded (or loading) index.
The Global Object Store is a place to store global objects that need to be shared across the application. Depending on the execution environment, this could be the window object in a browser, or the global object in a node environment, or something else in other contexts. The key here is that in some cases static variables are not truly shared because it is possible that a given class might have copies of its code in multiple paths in a deployed application. This approach ensures that no matter how many code copies might exist, there is only one instance of the object in question by using the Global Object Store.
Get the cached index, or load it. Concurrent callers asking for the same EntityDocumentID before a load completes share one Promise — only one DB read and vector-pool build happens. An index past its TTL (or marked stale) is returned immediately while a background reload replaces it.
Routes one BaseEntity event. Public so hosts that relay events by other means (and tests) can feed them in directly.
Drop a cached index so the next query reloads it before answering. A load already in flight is superseded: it still answers the callers waiting on it, but its result is not cached and the next query starts a fresh load.
Keep serving every cached index, but reload each in the background on its next query. A load already in flight may have read too early, so its result arrives stale too.
Protected StaticgetReturns the singleton instance of the class. If the instance does not exist, it is created and stored in the Global Object Store. If className is provided it will be used as part of the key in the Global Object Store, otherwise the actual class name will be used. NOTE: the class name used by default is the lowest level of the object hierarchy, so if you have a class that extends another class, the lowest level class name will be used.
OptionalclassName: string
BaseSingleton-backed cache for
SimpleVectorServiceProvider. Holds the per-EntityDocument index pool plus the in-flight Promise map used to dedupe loads, and subscribes once to BaseEntity events so loaded indexes track EntityRecordDocument changes row by row.The provider class itself (
SimpleVectorServiceProvider) remains a non-singleton — callers cannewone freely and they all delegate to this shared cache. That separation matches the existing VectorDBBase contract while giving us process-wide cache coherence.