Skip to main content

Create an agent from scratch with Agent Builder

Agent Builder lets you build an agent one step at a time. You add a trigger that collects input, add steps that act on that input, test the agent in Preview, and save it so others can use it. This guide walks through that workflow from scratch.

Every agent you build this way uses the same building blocks:

Building blockWhat it doesIn this guide's example
TriggerStarts the agent and collects inputAn Input form collects a web page URL
StepsGather content or take actionA Read document step reads the page and stores it in memory
ResponseReturns the result to the userA Respond step writes a summary

The example is a web page summarizer, chosen because it needs only one trigger and two steps. Swap in your own trigger, tools, and instructions as you go. When you finish, the example agent returns output like this:

Overview
This page explains how to request time off, who approves requests, and how
long approval usually takes.

Layout
- A short introduction to the time-off policy
- A step-by-step request procedure
- A table of leave types and accrual rates
- An FAQ section
Start from a template instead

Want a working agent right away? Open one of the agent templates, run it, and customize it from there.

Before you begin​

  • Glean Agents are enabled for your organization.
  • You have permission to create agents.
  • You can access the Agent Library from the left navigation in Glean.

Build the agent​

Complete these steps in order. You run the agent for the first time in step 3, before the workflow is finished.

1

Create a new agent

  1. In Glean, open Agents from the left navigation.
  2. Select Create agent.
  3. In the creation modal, choose one of two options:
    • Build with Natural Language: describe your agent in plain language and let Glean generate steps automatically.
    • Start from Scratch: configure each step yourself using the visual builder.

Select Start from scratch so you can see how triggers and tools connect.

tip

Use Build with Natural Language when you want Glean to draft the workflow for you. You can refine the workflow later.

After you choose Start from scratch, Agent Builder opens. You use these areas to configure your agent:

  • Canvas for the trigger and steps flow
  • Step configuration panel on the right for inputs and instructions
  • Agent settings (gear icon) for name, description, goal, and default models
  • Open Panel for natural‑language edits and step changes
  • Preview to test your draft without publishing
2

Add a trigger to collect input

The trigger decides how the agent starts and what information it receives up front. An Input form trigger shows users a form to fill in before the agent runs. For other options, see Types of agent triggers.

In this example, the form collects the URL of the page to summarize:

  1. In the trigger area, choose Input form as the trigger type.
  2. Add a text field to the form.
  3. Set Field name to something descriptive, such as web page (this becomes the field [[ web page ]]).
  4. (Optional) Add a description like “Enter the full URL of the web page you want to summarize.” This description appears when users run the agent.

When users run the agent, they see this input form first. Later steps reference the value they enter as [[ web page ]].

3

Add a step and run it

Steps do the agent's work, such as searching, reading documents, or taking actions in other apps. Each step can store its results in memory for later steps to use. Preview needs at least one step, so add one now and run it before you build the rest of the workflow.

In this example, a Read document step reads the page at the URL the user entered:

  1. Add a new step after the trigger.
  2. For Select step, choose the Read document tool.
  3. In the Choose how to set the document or URLs setting, select Manual for this example.
  4. In Documents and URLs, enter [[ web page ]] so the tool uses the URL the user provides.

When the agent runs, it reads the web page at [[ web page ]] and stores the content in memory, where later steps (such as the response step) can use it.

Run the agent now to see this step work:

  1. In the top right of Agent Builder, select Preview.
  2. In the preview panel, turn on Debug mode.
  3. Fill in the input form and run the agent. For this example, enter a real web page URL that starts with https://.
  4. In the debug panel, select the Read document step to see its input (the URL you entered) and its output (the page content it read).

The agent doesn't respond to the user yet. Next, you add a step that turns this content into a response.

4

Add a step to respond

A Respond step uses the content in memory to write the agent's answer. Your instructions control what the response contains and how it's formatted.

In this example, the response is a summary of the page:

  1. Add another step after Read document and choose the Respond tool.

  2. In the Instructions field, enter summary guidance, for example:

    Generate a summary for the webpage:

    - Create an "Overview" heading and provide a one-paragraph introduction.
    - Create a "Layout" heading and summarize the page layout in a short bullet list.
  3. Click Enhance prompt in the instructions field to have Glean improve the wording using best‑practice prompting patterns. The enhanced version appears in place and usually tightens structure and clarifies expectations, so the model follows your instructions more consistently. To keep your original text, use Undo.

The example workflow now asks for a web page URL, reads and stores the page content, and responds with a structured summary.

5

Preview and troubleshoot

Before sharing your agent, use Preview again to confirm that the full workflow returns the response you expect.

  1. In the top right of Agent Builder, select Preview.
  2. In the preview panel, fill in the input form and run the agent.

If something doesn't look right:

  • Use Reset Preview to start over with new input.
  • Use Try Again to re‑run the last input and compare different model outputs.

For deeper troubleshooting, turn on debug mode. It shows which steps ran, along with the inputs and outputs of each step. Use debug mode when:

  • A step fails or produces unexpected output.
  • You need to see the raw responses from tools (for example, from a Read document step).
  • You're tuning instructions and want to inspect how changes affect intermediate data.
6

Name and save the agent

When the agent behaves the way you want:

  1. In the upper left, select the default name, for example, Untitled Agent, and rename it to something descriptive. For this example, use Web Page Summarizer.
  2. Select Save in the upper right to make your current draft the live version.

Agent Builder keeps all changes as a draft until you save. Each save creates a new version you can restore later.

Refine the workflow​

As you iterate on your agent, you can adjust its structure and instructions.

Reorder and restructure steps​

Agent Builder lets you reorder steps using drag and drop directly in the flow, including moving steps between branches where applicable.

Use this to:

  • Insert new steps between existing ones
  • Move steps earlier or later in the flow
  • Simplify complex branches by reorganizing them visually

Edit using the natural language panel​

Instead of changing every configuration field manually, you can:

  1. Click Open Panel in the upper left of Agent Builder.
  2. In the natural language panel, describe the change you want. For example:
    • Ask Glean to add steps (“After reading the document, add a Think step that identifies the three main themes.”).
    • Request edits (“Shorten the response and focus only on the key sections for a busy reader.”).
    • Rearrange or delete steps conversationally.

You can switch between conversational edits and manual configuration without leaving Agent Builder.

(Optional) Choose a model​

The agent uses a default model, so you can skip this until you want to tune quality, speed, or cost. Glean's Model Hub lets you choose from multiple LLMs and set them per agent or per step.

  1. Open Agent settings (gear icon in the top right).
  2. Under Agent models, choose a default model that balances quality and speed for your agent's task.
  3. If needed, open each step and use the model selector in the step configuration to override the default for that step. For example, choose a more capable model for the Respond step if you need richer formatting or more nuanced summaries.
tip

Start with a single default model. As you gain confidence, tune models per step to balance quality and cost.

Feature recap​

You used these Agent Builder capabilities:

  • Visual canvas to build a step‑by‑step workflow
  • Input form and Read document to collect and store content
  • Respond and Enhance prompt to shape output
  • Preview and Debug to test safely
  • Drafts and version history to save and iterate with confidence

Next steps​

After you build your agent:

  • Explore Create an agent using natural language to see how to start directly from plain‑language instructions and refine the generated steps.
  • Try Create a more powerful agent for a more complex, multi‑step workflow that combines additional tools and branching logic.

See also​