Skip to content
Open source / v0.3.2

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.

Apache 2.0 Library: .NET 8 + 10 CLI: .NET 10

What is the total revenue by region?

The answer

FROM GENIE

Germany generated the highest revenue among the listed regions.

Revenue by region from the sanitized live transcript
regiontotal_revenue_eur
Germany4500000.00
France3350000.50
Spain1780000.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.

Adapted from a real CLI run with synthetic data.
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`                                         │
╰───────────────────────────────────────────────────────────╯
View the capture source

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.
Explore the runnable .NET example

Sign in to the company profile below, then pass your Agent ID as the first application argument.

Program.cs
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);
LakeSpeak.GenieScroll code →.NET 8 / 10
daily-platform-brief.yamlExcerpt from the repository example
questions:
  - id: expensive-queries
    title: Most expensive queries
    ask: Which queries consumed the most compute yesterday?

output:
  format: markdown
  path: reports/daily-platform-brief.md
Read the complete Question Pack
reports/daily-platform-brief.mdMarkdown output

Version 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.

01 Validate02 Run03 Report
See the scheduled GitHub Actions example

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.

Add the .NET library

Add the typed client to your .NET 8 or 10 project.

NuGet / library
dotnet add package LakeSpeak.Genie
Configure the .NET client

Install the CLI

Install the CLI with .NET 10, then connect below.

NuGet / global tool
dotnet tool install --global LakeSpeak.Cli
Or download a self-contained binary
  1. Sign in to your workspace

    Use the Databricks CLI for a browser-based login.

    Authenticate
    databricks auth login --profile company
  2. Find your Genie Agent

    List the Agents your identity can access. Copy an ID.

    Discover
    lakespeak agents list --profile company
  3. Ask a question with SQL output

    Replace <agent-id> with the ID from your list.

    First question
    lakespeak ask --profile company --agent "<agent-id>" --show-sql "What is the total revenue by region?"

For scheduled jobs, configure OAuth M2M authentication

Documentation

All examples

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 limitations
REPOSITORY EVIDENCE

Azure & AWS: live verification recorded.
GCP: not yet tested.

Inspect the dated test record

Contribute to
LakeSpeak.NET.

Report a reproducible bug, improve an example, or contribute a fix.
Start with the contribution guide.