5.8 C
New York
Thursday, March 13, 2025

Asserting Public Preview of AI/BI Genie Dialog APIs


As a part of our Week of AI brokers initiative, we’re introducing new capabilities to assist enterprises construct and govern high-quality AI brokers. To that finish, we’re excited to announce the Public Preview of the Genie Dialog APIs, out there on AWS, Azure, and GCP. With this API suite, your customers can now leverage AI/BI Genie to self-serve knowledge insights utilizing pure language from any floor, together with Databricks Apps, Slack, Groups, Sharepoint, custom-built functions and extra. Moreover, the Dialog APIs allow you to embed AI/BI Genie in any AI agent, with or with out Agent Framework.

Utilizing the Genie Dialog API suite, you possibly can programmatically submit pure language prompts and obtain knowledge insights simply as you’d within the Genie consumer interface. The API is stateful, permitting Genie to retain context as you ask follow-up questions inside a dialog thread.

On this weblog, we evaluation the important thing endpoints out there within the Public Preview, discover Genie’s integration with Mosaic AI Agent Framework, and spotlight an instance of embedding Genie right into a Microsoft Groups channel.

Genie Dialog APIs in Observe

Let’s stroll by a sensible instance to know how the Genie Dialog APIs work. The very first thing to notice is that the Dialog APIs have to work together with a Genie area that has already been created. We suggest beginning with our product documentation to arrange your Genie area after which following these finest practices to configure it optimally.

Think about you’ve already created, configured, and shared a Genie area designed to reply questions on your advertising knowledge. Now, you need your advertising staff to make use of this area to ask questions and discover insights—however as a substitute of accessing it by the Genie UI, you need them to take action from inside an exterior software.

To start, suppose you need your advertising staff to ask a simple query: “Which prospects did we contact through electronic mail yesterday?”. To ask this query utilizing the Genie Dialog APIs we might want to ship a POST request to the next endpoint:

/api/2.0/genie/areas/{space_id}/start-conversation

This endpoint begins a brand new dialog thread, utilizing your query because the preliminary immediate, similar to within the Genie Area UI. Observe that the request should embody your host element, Genie Area ID, and an entry token for authentication. Yow will discover the space_id within the Genie Area URL, as proven beneath:

https://instance.databricks.com/genie/rooms/12ab345cd6789000ef6a2fb844ba2d31

The next is an instance of the proper POST request required:

POST /api/2.0/genie/areas/{space_id}/start-conversation
HOST=
Authorization:
{
    “content material”: “Which prospects did we attain out to through electronic mail yesterday?”,
}

If the assertion is submitted accurately, the API will return the created dialog and message in response to the POST request, as proven within the following instance:

{
  “conversation_id”: “6a64adad2e664ee58de08488f986af3e”,
  “dialog”: {
    “created_timestamp”: 1719769718,
    “conversation_id”: “6a64adad2e664ee58de08488f986af3e”,
    “last_updated_timestamp”: 1719769718,
    “space_id”: “3c409c00b54a44c79f79da06b82460e2”,
    “title”: “Which prospects did we attain out to through electronic mail yesterday?”,
    “user_id”: 12345
  },
   “message_id”: “e1ef34712a29169db030324fd0e1df5f”,
  “message”: {
    “attachments”: null,
    “content material”: “Which prospects did we attain out to through electronic mail yesterday?”,
    “conversation_id”: “6a64adad2e664ee58de08488f986af3e”,
    “created_timestamp”: 1719769718,
    “error”: null,
    “message_id”: “e1ef34712a29169db030324fd0e1df5f”,
    “last_updated_timestamp”: 1719769718,
    “query_result”: null,
    “space_id”: “3c409c00b54a44c79f79da06b82460e2”,
    “standing”: “IN_PROGRESS”,
    “user_id”: 12345
  }
}

Utilizing the conversation_id and message_id, now you can ballot to verify the message’s technology standing and retrieve the generated related SQL assertion and question description as follows:

GET /api/2.0/genie/areas/{space_id}/conversations/{conversation_id}/messages/{message_id}
HOST=
Authorization: Bearer

The next is an instance of the response:

{
  “attachments”: [{
    “query”: {
      “description”: “Query description in a human readable format”,
      “last_updated_timestamp”: 1719769718,
      “query”: “SELECT * FROM customers WHERE date >= CURRENT_DATE() – INTERVAL 1 DAY”,
      “title”: “Query title”,
      “statement_id”: “9d8836fc1bdb4729a27fcc07614b52c4”,
      “query_result_metadata”: {
        “row_count”: 10
      },
    }
    ‘attachment_id’: ’01efddddeb2510b6a4c125d77ce176be’
  }],
  “content material”: “Which prospects did we attain out to through electronic mail yesterday?”,
  “conversation_id”: “6a64adad2e664ee58de08488f986af3e”,
  “created_timestamp”: 1719769718,
  “error”: null,
  “message_id”: “e1ef34712a29169db030324fd0e1df5f”,
  “last_updated_timestamp”: 1719769718,
  “space_id”: “3c409c00b54a44c79f79da06b82460e2”,
  “standing”: “EXECUTING_QUERY”,
  “user_id”: 12345
}

As soon as the message standing area reveals “COMPLETED”, it means the generated SQL assertion has completed executing and question outcomes are able to be retrieved. Now you can get the response as follows:

GET /api/2.0/genie/areas/{space_id}/conversations/{conversation_id}/messages/{message_id}/attachments/{attachment_id}/query-result
HOST=
Authorization: Bearer

After all, you can too challenge follow-up prompts in your dialog threads. For instance, as an instance the advertising staff desires to ask the next query subsequent: “Which of those prospects opened and forwarded the e-mail?”

To handle this you’ll ship one other POST request with the brand new immediate to the present dialog thread as follows:

POST /api/2.0/genie/areas/{space_id}/conversations/{conversation_id}/messages
HOST=
Authorization:  
{
    “content material”: “Which of those prospects opened and forwarded the e-mail?”,
}

Do you have to wish to refresh knowledge from earlier prompts, the API additionally means that you can re-execute SQL queries that had been beforehand generated. For extra particulars on the API endpoints, please discuss with the product documentation.

Dialog APIs Finest Practices

To make sure the very best efficiency, we suggest the next API finest practices:

  • Ballot the API each 5-10 seconds till a conclusive message standing is obtained, however restrict polling to a most of 10 minutes for commonest queries
  • If no response is obtained inside 2 minutes, implement exponential backoff to enhance reliability
  • Make sure you create new dialog threads for every consumer session; reusing the identical dialog thread for a number of classes can negatively influence Genie’s accuracy.

Integrating Genie into Mosaic AI Agent Framework

The Dialog APIs additionally seamlessly combine into your Mosaic AI Agent Framework with the databricks_langchain.genie wrapper.

Let’s say my advertising managers wanted to reply questions throughout three subjects:

  • Promotion occasion engagement (structured knowledge saved in a Unity Catalog view)
  • E mail advertisements (structured knowledge saved in a Unity Catalog desk)
  • Consumer textual content critiques (unstructured PDFs saved in Unity Catalog volumes)

You may construct a multi-agent framework to reply questions on each structured and unstructured knowledge. For instance, you possibly can outline the next Langgraph agent framework:

The agent framework graph would seem like the next:

Agent Framework

Your agent framework can now direct inquiries to their related brokers. For instance, if a advertising supervisor begins by asking “Present me attendees from my occasion on Feb 1”, the GenieEvents agent shall be triggered. MLFlow traces present the framework’s steps:

MLFlow Trace UI

The agent framework additionally allows brokers to share solutions as context for one another. This permits customers to get knowledge solutions that pull from a number of sources seamlessly. For instance, the advertising supervisor could wish to drill down and ask “Which of those attendees signed up for electronic mail notifications”. The framework will use the earlier reply from GenieEvents as context for the GenieEmails agent:

Agent Framework

With this method, what you are promoting customers can now reply knowledge questions that span a number of subjects/knowledge varieties and construct on one another.

Instance: Tips on how to Combine Genie with Microsoft Groups

Throughout the Dialog API’s Non-public Preview interval, Microsoft Groups was one of the standard productiveness instruments that prospects built-in with Genie. This integration allows customers to ask questions and get insights immediately, with out leaving the Groups UI.

To do that, you’ll need to take the next steps:

  1. Create a brand new Azure Bot – together with useful resource teams and app service plans.
  2. Add the required setting variables and dependencies to your bot. 
  3. Implement the dialog logic utilizing Dialog APIs (beginning dialog, retrieving outcomes, asking follow-up questions, and so forth.).
  4. Import the Genie Azure Bot right into a Groups Channel.

For detailed examples of precisely the way to configure the Dialog APIs for Microsoft Groups please discuss with the next articles:

The instance beneath highlights a real-world software from considered one of our prospects who used the Dialog APIs through the Non-public Preview interval. Casas Bahia, a number one retailer in Brazil, serves thousands and thousands of shoppers each on-line and thru its in depth community of bodily shops. By integrating the Genie Dialog APIs, Casas Bahia empowered customers throughout the group—together with C-level executives—to work together with Genie straight inside their Microsoft Groups setting. To be taught extra about their use case, learn the Casas Bahia buyer story.

Conversion APIs

“Having Genie built-in with Groups has been an enormous step ahead for knowledge democratization. It makes knowledge insights accessible to everybody, regardless of their technical background.”

— Cezar Steinz, Information Operations Supervisor, Grupo Casas Bahia

Getting Began with Dialog APIs

With the Genie Dialog APIs now in Public Preview, you possibly can empower enterprise customers to speak to their knowledge from any floor. To get began, please discuss with the product documentation.

We’re excited to see how you’ll use the Genie Dialog APIs and encourage you to begin creating Genie areas straight away. There’s a ton of content material out there to get you going– you possibly can go to the AI/BI and Genie internet pages, try our in depth library of product demos, and remember to learn by the total AI/BI Genie documentation.

The Databricks staff is at all times seeking to enhance the AI/BI Genie expertise, and would love to listen to your suggestions!

Related Articles

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Stay Connected

0FansLike
0FollowersFollow
0SubscribersSubscribe
- Advertisement -spot_img

Latest Articles