Execute multiple operations in a single batch.
Delete an item by namespace and key.
Get an item by namespace and key.
Get statistics about the store.
ProtectedhybridPerforms hybrid search combining vector similarity and text search.
The namespace prefix to search within
The text query to search for
Search options including filter, vector weight, and similarity threshold
Promise resolving to an array of search results with combined similarity scores
List namespaces with optional filtering.
Put an item with optional indexing configuration and TTL.
Optionalindex: false | string[]Optionaloptions: { ttl?: number }Search for items in the store with support for text search, vector search, and filtering.
The namespace prefix to search within
Search options including search mode, filters, query text, and pagination
OptionaldistanceMetric?: "cosine" | "l2" | "inner_product"Distance metric for vector search.
Optionalfilter?: Record<string, null | string | number | boolean | FilterOperators>Filter conditions with support for advanced operators.
Optionallimit?: numberMaximum number of results to return.
Optionalmode?: "text" | "vector" | "hybrid" | "auto"Search mode.
Optionaloffset?: numberNumber of results to skip for pagination.
Optionalquery?: stringNatural language search query.
OptionalrefreshTtl?: booleanWhether to refresh TTL for returned items.
OptionalsimilarityThreshold?: numberSimilarity threshold for vector search.
OptionalvectorWeight?: numberWeight for vector search in hybrid mode.
Promise resolving to an array of search results with optional similarity scores
// Basic text search
const results = await store.search(["documents"], {
query: "machine learning",
mode: "text"
});
// Vector search
const results = await store.search(["documents"], {
query: "machine learning",
mode: "vector",
similarityThreshold: 0.7
});
// Hybrid search (combining vector and text)
const results = await store.search(["documents"], {
query: "machine learning",
mode: "hybrid",
vectorWeight: 0.7
});
// Filtered search
const results = await store.search(["products"], {
filter: { category: "electronics", price: { $lt: 100 } }
});
Initialize the store by running migrations to create necessary tables and indexes.
Start the store. Calls setup() if ensureTables is true.
Stop the store and close all database connections.
Manually sweep expired items from the store.
ProtectedvectorPerforms vector similarity search using embeddings.
The namespace prefix to search within
The text query to embed and search for similar items
Search options including filter, similarity threshold, and distance metric
Promise resolving to an array of search results with similarity scores
StaticfromCreates a PostgresStore instance from a connection string.
Optionaloptions: Omit<PostgresStoreConfig, "connectionOptions">
PostgreSQL implementation of the BaseStore interface. This is now a lightweight orchestrator that delegates to specialized modules.