In this article, you’ll create a simple web page summarization agent. This exercise is designed to familiarize you with the process of agent creation and give you the confidence to design your own custom agents in the future.

You’ll start by building the agent from scratch, defining an input where you’ll enter a web page URL, and instructing the Agent to read the content of the provided web page and generate a summary.

This hands-on activity will walk you through using the Glean Agent Visual Builder and its various components. By following these steps, you’ll learn the foundational skills needed to build more complex agents that can automate workflows and perform advanced tasks tailored to your specific needs.

Start creating your agent

There are multiple ways to create an Agent, you can choose one from a template, generate one using a prompt, or create one from scratch. To get a thorough understanding of how triggers and actions work, you should create your agent from scratch.

  1. Navigate to the Agent Library.
  2. Select the Create agent button.
  3. Select Start from scratch.

Create your agent using the Agent Builder

Once you’ve started creating your agent, you’ll be taken to the Agent Builder. Here, you’ll specify the trigger for the web page summarizer agent.

For this exercise, you’ll use the input form trigger. When run manually, this trigger will ask for an input. You’ll use this input to collect a URL from the user and store it as a field for use later in the agent.

Perform the following steps to add a trigger to your agent:

  1. Select the Input form trigger.

  2. Add a text field to the input form trigger.

  3. Name it “web page”. Optionally, you can provide a description that will display when users see this input field.

Add a Read document Action and save its output to memory

Now that you’ve started creating your agent and have collected the URL as the [[ web page ]] field, you can instruct Glean to read that web page. You will do this by adding a Read document action and passing that [[ web page ]] field value to it. When the Glean agent reads the web page’s contents found at the URL, it saves it to memory.

Perform the following steps to add the Read document action to your agent:

  1. Under Select step, choose the Read document action.
  2. For the Choose how to set the document or URLs toggle, specify manual.
  3. Under Documents and URLs, enter [[ web page ]] to retrieve the web page field you created in the step above.

Respond to the document

Once your agent has read the document and saved it to memory, you can start to interact with it. In this exercise, you’ll use the Respond action to instruct the Agent to generate a summary based on instructions that you specify.

Perform the following steps to add the Respond action to your agent:

  1. Add another step, choose the Respond action
  2. Provide the agent with summary instructions:
    Generate a summary for the webpage:  
    * Create an "Overview" heading and give a one paragraph introduction to the webpage beneath it
    * Create a "layout" heading and then summarize its layout in a bullet list
    

Save and name your agent

Now that you’ve set up your Agent’s trigger and actions, it’s a good idea to save it.

  1. In the upper left corner of your screen, select the Untitled Agent name to rename it.
  2. Select the Save button in the upper right corner to save your Agent.

Preview your agent

You can preview your agent at any time to test its functionality. Try previewing your agent now.

  1. Select the Preview button in the upper right corner of the Agent Builder.
  2. Enter the full URL of a web page you want to summarize. The Agent will generate a summary in accordance with the prompt instructions you provided in the Respond step.

    You must enter the full URL, starting with https://

Modify its functionality

Now that you’ve previewed your agent, you may wish to modify its functionality. You can improve the functionality of this agent in any number of ways:

  • Switch the Read document action input from a manual URL to an AI-generated input, allowing more flexible input options. For example, URLs passed to AI-generated inputs do not need to start with https://.
  • Modify the prompt to include more summaries
  • Add more steps or branching logic to expand what the Agent can do

Further reading

  • Visit the Actions section to see a full list of Glean Agents and what they can do.
  • View the Creating a more powerful agent article to explore a more complex use case that uses some of Glean’s more advanced Agent features.