Skip to main content

Get Store

Schema

This request accepts an optional schema field. When it is omitted, the server uses the public schema. Set schema to target a store in another schema.

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
Rust
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_with_schema(
"ai_store".to_string(),
Some("analytics".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.

  • schema: Option<String> — Schema containing the AI store. Omit it to use public.

  • 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 AI stores in a schema
  • The model fields indicate which embedding models are used for indexing and querying