This time we’re going bigger than ever. Fabric, Power BI, SQL, AI and more. We're covering it all. You won't want to miss it.
Learn moreDid you hear? There's a new SQL AI Developer certification (DP-800). Start preparing now and be one of the first to get certified. Register now
What if generating embeddings in Eventhouse didn’t require an external endpoint, callout policies, throttling management, or per‑request costs?
That’s exactly what slm_embeddings_fl() delivers: a new user-defined function (UDF) that generates text embeddings using local Small Language Models (SLMs) from within the Kusto Python sandbox, returning vectors that you can immediately use for semantic search, similarity analysis, and broader NLP workflows across Fabric Eventhouse and Azure Data Explorer. This function currently supports jina-v2-small and e5-small-v2 models.
And the timing couldn’t be better. Vector similarity search in Eventhouse has been getting rapid adoption, making “Eventhouse as a vector store” a genuinely practical architecture for RAG, semantic exploration, and agent memory patterns.
Until now, generating embedding vectors in KQL query typically meant calling an external (Azure OpenAI) endpoint by the ai_embeddings() plugin. That’s powerful, but it introduces operational overhead and cost:
slm_embeddings_fl() flips that script. The model runs locally using (Eventhouse python() plugin), so embedding becomes a natural part of your KQL transformation pipeline, particularly appealing for privacy-sensitive workflows, rapid prototyping, and high-volume embedding generation.
slm_embeddings_fl() is a tabular UDF you invoke on any table-like expression. You tell it which column contains text, which column should receive the embedding vectors, and (optionally) batch/model configuration:
T | invoke slm_embeddings_fl(text_col, embeddings_col [, batch_size ] [, model_name ] [, prefix ])
The python() plugin must be enabled on the Eventhouse; the UDF uses inline Python executed per node, so it scales naturally with your cluster for larger embedding jobs.
E5 was trained with a simple but important convention: for retrieval-style tasks, prefix inputs with “query:” for the search term and “passage:” for the text corpus (otherwise quality can degrade). This is why slm_embeddings_fl() exposes a prefix parameter.
Jina supports long inputs (up to 8192 tokens), making it very compelling for long documents where chunking overhead is painful.
Prerequisite: install slm_embeddings_fl() UDF in your KQL database as explained in its doc.
Embed your documents:
.set stored_query_result slm_e5_test_tbl <|
datatable(text:string) [
"Machine learning models can process natural language efficiently.",
"Python is a versatile programming language for data science.",
"Azure Data Explorer provides fast analytics on large datasets.",
"Embeddings convert text into numerical vector representations.",
"Neural networks learn patterns from training data."
]
| extend text_embeddings=dynamic(null)
| invoke slm_embeddings_fl('text', 'text_embeddings', model_name='e5-small-v2', prefix='passage:') // prefix is optional, default is 'query:'
Embed a query, compute cosine similarity using KQL native series_cosine_similarity() function and retrieve the top matches:
let item = "Embeddings vectors are used for semantic search.";
let embedding = toscalar(print query=item | extend embedding=dynamic(null)
| invoke slm_embeddings_fl(text_col='query', embeddings_col='embedding', model_name='e5-small-v2', prefix='query:')
| project embedding);
stored_query_result('slm_e5_test_tbl')
| extend item, embedding
| extend similarity=series_cosine_similarity(embedding, text_embeddings, 1.0, 1.0)
| project item, text, similarity
| top 2 by similarity
| item | Text | similarity |
| Embeddings vectors are used for semantic search. | Embeddings convert text into numerical vector representations. | 0.85286472533815 |
| Embeddings vectors are used for semantic search. | Machine learning models can process natural language efficiently. | 0.768244175222851 |
Choose ai_embeddings plugin when you want:
But expect:
Choose slm_embeddings_fl() when you want:
The two options are complementary tools that let you choose the best operational and quality point per your scenario.
The addition of slm_embeddings_fl() makes semantic intelligence in Fabric Eventhouse dramatically simpler and more scalable. Whether you're building RAG pipelines, powering semantic search, or enriching operational data with vector intelligence, local SLM‑based embeddings let you move faster with fewer dependencies and lower cost. Combined with native vector search and Eventhouse’s ingestion pipeline, this marks a significant step toward making AI‑powered analytics first‑class in the Eventhouse ecosystem.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.