Skip to main content

List Stores

The ListStores request retrieves a list of all vector stores available on the Ahnlich DB server.

  • Input: No arguments required.

  • Behavior: The server returns information about all existing stores including their names, dimensions, and indices.

  • Response: A list of StoreInfo objects containing store metadata.

Click to expand source code
import { createDbClient } from "ahnlich-client-node";
import { ListStores } from "ahnlich-client-node/grpc/db/query_pb";

async function listStores() {
const client = createDbClient("127.0.0.1:1369");

const response = await client.listStores(new ListStores());

// Get store names
console.log(response.stores.map((s) => s.name));

// Iterate over stores with full details
for (const store of response.stores) {
console.log(`Store: ${store.name}`);
console.log(` Dimension: ${store.dimension}`);
console.log(` Entries: ${store.len}`);
console.log(` Size: ${store.sizeInBytes} bytes`);
console.log(` Predicate Indices: ${store.predicateIndices}`);
console.log(` Non-Linear Indices: ${store.nonLinearIndices}`);
}
}

listStores();

StoreInfo Fields​

Each StoreInfo object contains:

FieldTypeDescription
namestringThe name of the store
dimensionnumberVector dimension for this store
lennumberNumber of entries in the store
sizeInBytesbigintTotal size of the store in bytes
predicateIndicesstring[]List of indexed predicate keys
nonLinearIndicesNonLinearAlgorithm[]List of non-linear indices (KDTree, HNSW)