List Stores
Returns the list of vector stores registered in the connected Ahnlich DB service. This request is typically used to discover available stores before performing store-scoped operations such as creating, dropping, or inserting vectors.
Source Code Exampleβ
Click to expand
use ahnlich_client_rs::db::DbClient;
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
// Connect to your running ahnlich-db instance
let db_client = DbClient::new("127.0.0.1:1369".to_string()).await?;
let tracing_id: Option<String> = None;
// Call list_stores and print the result
let stores = db_client.list_stores(tracing_id).await?;
println!("Stores: {:?}", stores);
Ok(())
}
Parametersβ
tracing_id: Option<String>β Optional tracing context propagated with the request.
Returnsβ
-
Ok(StoreList)β Contains metadata for each store available on the server. EachStoreInfoincludes:nameβ The store identifier.lenβ Number of entries in the store.size_in_bytesβ Total memory footprint of the store.non_linear_indicesβ List of non-linear index configurations (HNSW with full config parameters, or k-d tree) active on the store. Empty if no non-linear indices are configured.
-
Err(AhnlichError)β Returned when the request cannot be completed (e.g., transport or server error).
Behaviorβ
-
Executes a read-only RPC with no side effects.
-
Responses are deterministic: the server returns all currently known stores.
-
If no stores exist, the response will contain an empty list.
-
For stores with HNSW indices, the returned configuration includes: distance metric, ef_construction, maximum_connections, maximum_connections_zero, extend_candidates, and keep_pruned_connections.