Skip to main content

Get Store

Retrieves detailed information about a specific AI store by name, including the configured models and optional underlying DB store information.

Source Code Example​

Click to expand
use ahnlich_client_rs::ai::AiClient;

#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
let ai_client = AiClient::new("127.0.0.1:1370".to_string()).await?;

let tracing_id: Option<String> = None;

let store_info = ai_client
.get_store("ai_store".to_string(), tracing_id)
.await?;

println!("Store name: {}", store_info.name);
println!("Query model: {:?}", store_info.query_model);
println!("Index model: {:?}", store_info.index_model);
println!("Embedding size: {}", store_info.embedding_size);
println!("Dimension: {}", store_info.dimension);
println!("Predicate indices: {:?}", store_info.predicate_indices);

if let Some(db_info) = &store_info.db_info {
println!("DB store size: {} bytes", db_info.size_in_bytes);
}

Ok(())
}

Parameters​

  • store: String β€” The name of the AI store to retrieve.

  • tracing_id: Option<String> β€” Optional trace context for observability.

Returns​

  • AiStoreInfo β€” Detailed information about the AI store.

  • AhnlichError β€” If the store does not exist or the request fails.

AiStoreInfo Fields​

FieldTypeDescription
nameStringStore name
query_modelAiModelAI model used for query embeddings
index_modelAiModelAI model used for index embeddings
embedding_sizeu64Number of stored embeddings
dimensionu32Vector dimension (determined by model)
predicate_indicesVec<String>List of indexed predicate keys
db_infoOption<StoreInfo>Underlying DB store info (when connected)

Behavior​

  • Sends a request to retrieve AI store metadata by name.

  • Returns an error if the store does not exist.

  • The db_info field is present when the AI proxy is connected to a DB instance.

Notes​

  • Use list_stores to get information about all AI stores
  • The model fields indicate which embedding models are used for indexing and querying