Your lakehouse.
Now speaking C#.
The open-source .NET client for Databricks Genie.
Ask from C#, inspect returned SQL, and automate reports with Question Packs.
What is the total revenue by region?
The answer
FROM GENIEGermany generated the highest revenue among the listed regions.
| region | total_revenue_eur |
|---|---|
| Germany | 4500000.00 |
| France | 3350000.50 |
| Spain | 1780000.25 |
Generated SQL
SELECT `region`, SUM(`revenue_eur`) AS total_revenue_eur
FROM `sales`.`public`.`regional_revenue`
WHERE `region` IS NOT NULL
AND `revenue_eur` IS NOT NULL
GROUP BY `region`Check the query before using the answer.
Inspect the original terminal output
Genie is analyzing your question… Waiting for a SQL warehouse… Preparing answer… The total revenue by region is as follows: - **Germany:** €4,500,000.00 - **France:** €3,350,000.50 - **Spain:** €1,780,000.25 Germany generated the highest revenue among the listed regions. ╭────────────────────────┬─────────────────────────────────────────────────────╮ │ region │ total_revenue_eur │ ├────────────────────────┼─────────────────────────────────────────────────────┤ │ Germany │ 4500000.00 │ │ France │ 3350000.50 │ │ Spain │ 1780000.25 │ ╰────────────────────────┴─────────────────────────────────────────────────────╯ ╭─Generated SQL─────────────────────────────────────────────╮ │ SELECT `region`, SUM(`revenue_eur`) AS total_revenue_eur │ │ FROM `sales`.`public`.`regional_revenue` │ │ WHERE `region` IS NOT NULL AND `revenue_eur` IS NOT NULL │ │ GROUP BY `region` │ ╰───────────────────────────────────────────────────────────╯
Use Genie beyond
the chat window.
Calling Genie means managing conversations, polling, and result formats. LakeSpeak handles that in a typed .NET client, with a CLI for running questions and reports.
A typed .NET client
Dependency injection, async calls, cancellation, and typed failures.
Returned SQL and rows
Read the SQL and rows Genie returns, with decimal values preserved as strings.
Versioned Question Packs
Store recurring questions in YAML and generate Markdown reports from each run.
Ask Genie
from C#.
Register LakeSpeak and resolve IGenieClient. The client starts the conversation, waits for Genie, and returns a typed response.
- Keep follow-up questions in the same conversation.
- Read the SQL, rows, and message identifiers.
- Cancel work with a standard
CancellationToken.
Sign in to the company profile below, then pass your Agent ID as the first application argument.
using LakeSpeak.Genie;
using Microsoft.Extensions.DependencyInjection;
var services = new ServiceCollection();
services.AddLakeSpeak(
options => options.Profile = "company");
using var provider = services.BuildServiceProvider();
var genie = provider.GetRequiredService<IGenieClient>();
var response = await genie.AskAsync(
agentId: args[0],
question: "Which regions grew fastest?",
cancellationToken: CancellationToken.None);
Console.WriteLine(response.Text);
Console.WriteLine(response.Query?.Sql);questions:
- id: expensive-queries
title: Most expensive queries
ask: Which queries consumed the most compute yesterday?
output:
format: markdown
path: reports/daily-platform-brief.mdreports/daily-platform-brief.mdMarkdown outputVersion questions.
Rerun reports.
Put recurring questions in a YAML Question Pack. Validate it, run each question against Genie, and write a Markdown report your team can read.
Review changes to the questions in Git, then rerun the pack as your data changes.
Install LakeSpeak.
Connect to Genie.
Bring a Databricks workspace and an existing Genie Agent shared with you. LakeSpeak uses your identity; it doesn’t create Agents or expand your permissions.
Sign in to your workspace
Use the Databricks CLI for a browser-based login.
databricks auth login --profile companyFind your Genie Agent
List the Agents your identity can access. Copy an ID.
lakespeak agents list --profile companyAsk a question with SQL output
Replace
<agent-id>with the ID from your list.lakespeak ask --profile company --agent "<agent-id>" --show-sql "What is the total revenue by region?"
For scheduled jobs, configure OAuth M2M authentication
Documentation
Getting started
From an existing Genie Agent to your first answer.
Authentication
CLI profiles, tokens, and OAuth M2M for unattended jobs.
Command reference
Commands, output formats, and exit codes.
Compatibility & limits
Cloud verification, supported features, and known limits.
Before you rely on an answer
LakeSpeak is pre-1.0; the Genie Conversation API is generally available. Generated answers can be wrong: read the SQL before acting on a number.
Read the limitationsAzure & AWS: live verification recorded.
GCP: not yet tested.
Contribute to
LakeSpeak.NET.
Report a reproducible bug, improve an example, or contribute a fix.
Start with the contribution guide.