From the course: Learning Glean AI: From Data Insights to AI Agents
Create an agent from scratch - Glean Tutorial
From the course: Learning Glean AI: From Data Insights to AI Agents
Create an agent from scratch
- [Instructor] Now we have come to this exciting lesson about how to create agents from scratch. So I'm back in the same window, app.gleancom, I clicked on Agents, and I came to this screen where it says Create agent. Yes, of course I'm ready to create an agent, and I'm going to start from scratch. Next, I'm going to add a step, which is an action. Remember the trigger wakes up the agent, and then a step, a step is where the action of the agent is. And I'm going to call this agent a Glean Agent. And I'm going to go back to the step. So what is possible for actions that the agent can do? These are all recommended actions. So it can do a company search. Remember we did a company search in a previous example when we looked at competitive analysis, and it also did web search in that same example. And we can make it read a document. That's what we're going to do here. But I also want you to understand the other options. Think is kind of a hidden step. So you want the agent to do some things, but you don't want it to be a response that it is giving. So it could be an intermediate step. And then response is how it's going to give a response back to you. And the other thing is it can take some action and it can follow specific guidelines and execute specific steps. And then all actions can be those available from Glean, such as, you know, searching a company, searching for a code base or you know, looking at emails, all kinds of different search essentially. Or it can be by different data source. So we saw in our previous examples that it was doing a search on the public internet, on Brave, it looked at Salesforce as the database in the sales example. It could be looking at something else, it could be looking at Jira tickets. So these are all different data sources that it can access. So I am going to say, read a document, and I'm going to say this document is about Glean agents. So the instructions we have given is what documents to read. In this case we just have one document. In fact, you can set the document or the URL, and I'm making it manual. It can be the specify the document, and in this case I'm giving the name of the document or I can give a URL where it can go pick the document. And the other thing is, it is going to use a large language model. Remember an agent AI is going to automate by the reasoning power of a large language model. So I'm going to show you the default is GPT-4.1 in this case. We had seen a different GPT model that was used in one of our previous examples. So you click down and it shows GPT models. So you can say, okay, what are other models that's available from OpenAI? And you can pick what is a reasoning model like o3, or you can pick a general purpose model. Or I can say I want Vertex AI. And you can pick say a Maverick, Llama for Maverick. Or I can go back and say, you know what? I want to use a Vertex AI, but I want to use something that's very fast, and you can get Gemini 2.5. Or you can get a reasoning model also from Vertex. So these are all your different options. I'm just going to go back to what it was using before. And it's also giving me some tips, and it is saying you can actually have the agent select documents, or you can combine this instead of just reading the document and giving a response, you can make it do some deeper analysis. That is where you would add the think action that we saw earlier. So the next step I'm going to add is a respond. And this is what we've been seeing in all our examples. That's the output we got. Do we want it factual? I want it to be balanced. And I think we are done. We are ready. So what I'm going to do is I'm going to preview this, and it says there's a error in step one, and it needed a document name. I'm going to say Glean agent. This is a nice way to debug. See? That is gone. So now I say two and it says, tell the AI what to generate and how to structure the response. And I cannot do enhance because I have to say what it should look like. I'm just going to say give me a summary. That's it. So now that error is gone, and the preview shows that I'm ready to run the agent. The agent is called Glean Agent. It is going to search for a document, or you can upload a file. So if the document resides inside your company, you can do @ mention and then call the document. We could have given the URL of a document also when we created the agent. In this case, I'm going to click and upload the document. So here I'm picking the document. So now it's uploaded the document, I'm just going to say run the agent. And essentially what I did here is I made them read a document and give me a summary of the document. It provides a step by step guide to creating a Glean agent. And I can continue the chat. Explain what is a Glean agent. Rephrase. And it's thinking, that's the internal action item what it does, it's saying I'm looking into Glean's enterprise search feature. And it's actually looking at more documents, not just the one document that I give. And it is finding 14 documents, and then it's 16 sources. And it says how to build them, how to use them. Lot of different examples. We've already learned all these examples. You are ready to go build Glean agents. So you get the idea. So that is what you do to create an agent from scratch. And once you have it, you can publish it. That's the easiest step. And then you'll have it in your repository. You can share it with your colleagues and you just can run it. I'm excited to see what agent you're going to create. And if you want to learn the foundation of agent AI, designing agentic AI, and reasoning models, different kind of reasoning models, the inner workings of it, you can actually go here, How agents work. I showed you in one of the earlier lessons. For Glean, you can see the steps of it, but you want to get a foundational knowledge, you can learn from my designing agent AI course right here on LinkedIn. Good luck. I'm excited to see what agents you build.
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.