Optional
options: { Optional
index?: IndexConfigPrivate
Optional
_indexPrivate
cosinePrivate
dataPrivate
doesPrivate
extractPrivate
filterPrivate
getPrivate
getPrivate
insertPrivate
listPrivate
paginatePrivate
putPrivate
scorePrivate
vectorsExecute multiple operations in a single batch. This is more efficient than executing operations individually.
Array of operations to execute
Promise resolving to results matching the operations
List and filter namespaces in the store. Used to explore data organization and navigate the namespace hierarchy.
Optional
options: { Options for listing namespaces
Optional
limit?: numberOptional
maxOptional
offset?: numberOptional
prefix?: string[]Optional
suffix?: string[]Promise resolving to list of namespace paths
// List all namespaces under "documents"
await store.listNamespaces({
prefix: ["documents"],
maxDepth: 2
});
// List namespaces ending with "v1"
await store.listNamespaces({
suffix: ["v1"],
limit: 50
});
Store or update an item.
Hierarchical path for the item
Unique identifier within the namespace
Object containing the item's data
Optional
index: false | string[]Optional indexing configuration
// Simple storage
await store.put(["docs"], "report", { title: "Annual Report" });
// With specific field indexing
await store.put(
["docs"],
"report",
{
title: "Q4 Report",
chapters: [{ content: "..." }, { content: "..." }]
},
["title", "chapters[*].content"]
);
Search for items within a namespace prefix. Supports both metadata filtering and vector similarity search.
Hierarchical path prefix to search within
Optional
options: { Search options for filtering and pagination
Optional
filter?: Record<string, any>Optional
limit?: numberOptional
offset?: numberOptional
query?: stringPromise resolving to list of matching items with relevance scores
// Search with filters
await store.search(["documents"], {
filter: { type: "report", status: "active" },
limit: 5,
offset: 10
});
// Vector similarity search
await store.search(["users", "content"], {
query: "technical documentation about APIs",
limit: 20
});
In-memory key-value store with optional vector search.
A lightweight store implementation using JavaScript Maps. Supports basic key-value operations and vector search when configured with embeddings.
Example
Warning
This store keeps all data in memory. Data is lost when the process exits. For persistence, use a database-backed store.