Skip to content

Embeddings providers

Rust quickstart

SurrealDB supports vector embeddings for semantic search and machine learning across your data. With integrations for the main embedding providers, you can store, index and query high-dimensional vectors alongside your regular data.

use mistralai_client::v1::{client::Client, constants::EmbedModel};

static KEY = std::env::var("MISTRAL_API_KEY").unwrap();

// ...

let client = Client::new(Some(KEY.to_string()), None, None, None)?;
let input = vec!["Joram is the main character in the Darksword Trilogy.".to_string()];

let result = client.embeddings_async(MODEL, input, None).await?;
println!("{:?}", result);

Find a full example in Semantic search in Rust with SurrealDB and Mistral AI.

Was this page helpful?