ByteChef LogoByteChef
AutomationQuick Start

Build First Agent

Build and run your first AI agent in ByteChef: an OpenAI model with one tool, in a few minutes with a single API key.

In this guide you build the same workflow as the Build your first agent template: an AI Agent step with an OpenAI model and one tool, followed by a logger. The agent fetches a random quote through the tool and explains it in one sentence. The only thing to set up is an OpenAI connection.

You will learn:

  • How to add an AI Agent step and attach a model to it
  • How to create a connection for the model
  • How to give an agent a tool and tell it when to use it
  • How to try an agent in the playbook and read its tool calls

Before you start

Create a workflow

Expand your project's row on the Projects page, click + New Workflow on its Workflows tab, enter the label Build your first agent, and click Save. The editor opens with a Manual trigger in place.

Add the AI Agent

Click the + button below the trigger, search for AI Agent, select it, and choose the Chat action.

The component picker filtered to AI Agent, showing the Chat and Chat (stream) actions

The agent appears on the canvas as a box with a slot for each thing you can attach to it: Model, Memory, RAG, Guardrails and Tools. It shows an error until it has a model; Model is the only required slot.

The AI Agent box on the canvas with its Model, Memory, RAG, Guardrails and Tools slots and the error banner

Attach the model and connect OpenAI

Click the + under Model, search for OpenAI, select it, and choose OpenAI Model.

The model picker filtered to OpenAI, with the OpenAI Model element

Click the new OpenAI node to open its panel. On the Connection tab, click + next to Choose Connection.... In the Create Connection dialog, give the connection a name such as OpenAI, paste your API key into Token, and click Save. The connection is stored once and reused by every step that needs OpenAI.

The Create Connection dialog for OpenAI with the name filled in and the Token field empty

Open the Properties tab and choose a model, for example gpt-5-mini. Leave the rest at its defaults.

The OpenAI model node's Properties tab with gpt-5-mini selected

Write the prompts

Click the AI Agent node and open its Properties tab.

In Prompt, enter the message the agent gets on each run:

Fetch a random quote and explain it.

In System Prompt, enter the instructions the agent follows:

You are a friendly assistant. Always call the Get a random quote tool first. Then reply with the quote, its author, and one sentence explaining what the quote means. Do not invent quotes.

The AI Agent's Properties tab with the Prompt and System Prompt filled in

Give the agent a tool

Click the + under Tools, type HTTP in the filter, select HTTP Client, and choose its GET action.

The tool picker filtered to HTTP Client, listing its actions

Click the new tool node. On the Properties tab, set URI to:

https://dummyjson.com/quotes/random

Leave Response Format on JSON. No connection is needed: the API is public. Tool Name and Tool Description can stay empty: they default to the action's own.

On the Description tab, set Title to Get a random quote. The system prompt refers to the tool by this name.

The tool's Properties tab with the URI filled in, and the tool titled Get a random quote on the canvas

Try it in the playbook

Click the ▶ Test agent button in the agent box's header. The Agent Playbook opens with your prompt already filled in. Send it. The agent reads the prompts, decides to call the tool, receives the quote, and writes its explanation. Expand the HTTP Client: GET entry above the reply to see why the agent called the tool, what it sent, and the JSON it got back.

The Agent Playbook showing the expanded tool call and the agent's reply

Send the same message again and the agent explains a different quote. Close the playbook with the X when you are done.

Log the answer and test the workflow

Click the + button below the agent box, search for Logger, open the Helpers tab, choose the Info action, and enter this in the Text field:

${aiAgent_1}

This logs the agent's reply.

The finished workflow: the agent box with its OpenAI model and Get a random quote tool, followed by the Logger

Click Test at the top right of the editor. The execution panel opens below the canvas. Click the agent step to read its reply on the Output tab.

The execution panel after a successful test, with the agent step selected and its reply shown

What you have built

Manual Trigger → AI Agent (OpenAI model + HTTP Client tool) → Logger
  • Model: the agent's reasoning. Any of the supported providers plugs into the same slot.
  • Tools: every component action can be a tool. The agent decides when to call it and fills in its parameters. See AI Agent for tools whose parameters the model supplies at runtime.
  • Connection: created once, reused everywhere, and never part of an exported workflow.

The same workflow is available as a template. To import it instead of building it, open the Build your first agent page, click Use template, select your OpenAI connection on the model, and click Test.

Next steps

How is this guide?

Last updated on

On this page