ProtectedconstructorReturns only queries with Status === 'Approved'
ProtectedBaseAll query categories
All query field definitions
Returns true if both the base engine and server capabilities are loaded
All query parameter definitions
All query permission records
All queries in the system
All query-to-entity relationship mappings
Get the query vector service for semantic search. Initialized during Config — will be null before Config() completes.
StaticInstanceConfigures the QueryEngineServer by first ensuring QueryEngine is configured, then building the in-memory vector index from cached query embeddings.
Safe to call from multiple places concurrently — returns the same promise to all callers during loading.
OptionalforceRefresh: booleanIf true, forces a full reload even if already loaded
OptionalcontextUser: UserInfoUser context for server-side operations
Optionalprovider: IMetadataProviderOptional metadata provider override
Find a query by name, optionally scoped to a category
OptionalcategoryId: stringFind queries semantically similar to a natural language search text.
Uses the persistent in-memory vector index built from QueryEngine's cached query data. Supports an optional metadata filter callback for filtering by status, reusable flag, etc. at search time.
Natural language description of what data is needed
Function to generate embeddings (typically from AIEngine.EmbedTextLocal)
Maximum number of results to return (default: 10)
Minimum similarity score 0-1 (default: 0.3)
Optionalfilter: (metadata: QueryEmbeddingMetadata) => booleanOptional filter callback applied to metadata before similarity scoring
Array of matching queries sorted by similarity score (highest first)
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 all queries belonging to a specific category
Get all field definitions for a specific query
Get all parameter definitions for a specific query
Get all permission records for a specific query
ProtectedPackagePackages a query entity into the metadata shape stored in the vector service.
Rebuilds the in-memory vector index from QueryEngine's cached queries. This is a synchronous, in-memory-only operation — no database call.
Called automatically on Config() and whenever QueryEngine emits a DataChange$ event for the 'MJ: Queries' entity.
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
Server-side Query Engine that wraps QueryEngine and adds server-only capabilities.
Uses composition (containment) rather than inheritance to avoid duplicate data loading. Delegates all base functionality to QueryEngine.Instance while adding server-specific features like embedding-based semantic search.
Follows the same pattern as AIEngine containing AIEngineBase.
Description
ONLY USE ON SERVER-SIDE. For metadata only, use the QueryEngine class which can be used anywhere.