Chat with LLMs and prototype AI apps using AI Playground

Warning

Building agents in AI Playground is a legacy approach. To build and test agents, use the Agent Bricks CLI (Beta) and run your agent locally with agentbricks dev. To query models from code, see Query foundation and embedding models.

AI Playground is a chat environment for large language models (LLMs). You can interactively test and prompt LLMs and compare responses from multiple model endpoints side by side. Prototyping tool-calling agents and question-answering bots in AI Playground is a legacy workflow.

Requirements

  • Unity Catalog, to add Unity Catalog functions as tools, such as the built-in system.ai.python_exec function.

Note

If Playground is not available in your workspace, reach out to your Databricks account team for more information.

Use AI Playground

To use the AI Playground:

  1. Select Playground from the left navigation pane under AI/ML.
  2. Select the model you want to interact with using the dropdown list on top.
  3. You can do either of the following:
    1. Type in your question or prompt.
    2. Select a sample AI instruction from those listed in the window.
  4. You can select the + to add an endpoint. Doing so allows you to compare multiple model responses side-by-side.

AI playground

To query Unity Gateway model services in the playground and see how gateway features apply to your requests, see Query model services in AI Playground.

You can also test Unity Gateway Model Context Protocol (MCP) services in AI Playground. See Test a tool.

Test tools and prototype agents in AI Playground

The Tools menu lets you test Unity Gateway MCP services and tool-enabled models in AI Playground. Building and exporting agents from AI Playground are legacy workflows. To build and test new agents, use the Agent Bricks CLI (Beta).

Prototype a tool-calling agent

Tools allow LLMs to do more than generate language. Tools can query external data, run code, and take other actions. Use the following steps to test tools, including Unity Gateway MCP services, with a tool-enabled model. Using these steps to prototype a tool-calling agent is a legacy workflow. To build new agents, use the Agent Bricks CLI (Beta).

  1. In the Playground, choose a model labeled Tools enabled.

    Select a tool-calling LLM

  2. Select Tools > + Add tool and select the built-in Unity Catalog function, system.ai.python_exec.

    This function lets the model run arbitrary Python code.

    Select a hosted function tool

    Other tool options include:

    • UC Function: Select a Unity Catalog function for the model to use.
    • Function definition: Define a custom function for the model to call.
    • AI Search: Specify an AI Search index. If the model uses an AI Search index, its response cites the sources used.
    • MCP: Specify Model Context Protocol (MCP) servers to use managed Databricks MCP servers or external MCP servers.
  3. Ask a question that involves generating or running Python code. You can try different variations on your prompt phrasing. If you add multiple tools, the LLM selects the appropriate tool to generate a response.

    Prototype the LLM with hosted function tool

Prototype a RAG question-answering bot

In the legacy AI Playground workflow, you can use an AI Search index in your workspace to prototype a retrieval-augmented generation (RAG) question-answering bot. This type of agent uses documents in an AI Search index to answer questions based on those documents.

  1. Click Tools > + Add tool. Then, select your AI Search index.

    Select an AI Search tool

  2. Ask a question related to your documents. The agent can use the index to look up relevant information and cites any documents used in its answer.

    Prototype the LLM with AI Search tool

To set up an AI Search index, see Create an AI Search index.

Export your agent (legacy)

Both AI Playground agent export paths are legacy.

For existing agents prototyped in AI Playground, the following export options let you deploy, evaluate, and iterate outside the Playground:

  • Export to Databricks Apps: Installs a deployable agent app from the agent-openai-agents-sdk template, including a built-in chat UI, MCP tool wiring, and authentication.
  • Create agent notebook: Generates a Python notebook that defines the agent and deploys it to a Model Serving endpoint.

Export to Apps (legacy)

The Export to Databricks Apps option generates a deployed agent app that's ready to chat with. The app uses the same model, system prompt, and tools (including MCP servers and AI Search indexes) that you configured in the Playground.

Before you export, make sure your workspace meets the following requirements:

To export the agent:

  1. In the Playground, click Get code > Export to Databricks Apps.

  2. In the Export to Databricks Apps dialog, set the following:

    • App Name: A unique name that starts with agent- and contains only lowercase letters, numbers, and hyphens (for example, agent-research-assistant).
    • App Description: A short description of what the agent does.
    • MLflow Experiment: Select an existing MLflow experiment to use for tracing and evaluation, or create a new one.
  3. Click Export. Azure Databricks does the following:

    1. Validates that the app name is available.
    2. Installs the agent-openai-agents-sdk template into your workspace and grants the app permissions for the resources it needs. These resources include the MLflow experiment, serving endpoint, and any MCP servers, Unity Catalog functions, Genie Agents, or AI Search indexes that you added as tools.
    3. Generates agent_server/agent.py from your Playground configuration so the deployed agent matches what you tested.
  4. When the success dialog appears, click View Agent to open the deployed app and chat with it using the built-in UI.

To customize the agent code, configure authentication, add evaluation, or redeploy with Declarative Automation Bundles (DABs), see Run agents on Databricks Apps using the legacy agent server.

Create agent notebook (legacy)

After testing your agent in AI Playground, click Get code > Create agent notebook to export your agent to a Python notebook.

After you export the agent code, Azure Databricks saves a folder with a driver notebook to your workspace. This driver defines a tool-calling ResponsesAgent, tests the agent locally, uses code-based logging, registers, and deploys the agent using Custom Agents.

Note

The exported notebook uses a legacy agent authoring workflow that deploys the agent to Model Serving.