Orkes logo image
Product
Platform
Orkes Platform thumbnail
Orkes Platform
Orkes Agentic Workflows
Orkes Conductor Vs Conductor OSS thumbnail
Orkes vs. Conductor OSS
Orkes Cloud
How Orkes Powers Boat Thumbnail
How Orkes Powers BOAT
Try enterprise Orkes Cloud for free
Enjoy a free 14-day trial with all enterprise features
Start for free
Capabilities
Microservices Workflow Orchestration icon
Microservices Workflow Orchestration
Enable faster development cycles, easier maintenance, and improved user experiences.
Realtime API Orchestration icon
Realtime API Orchestration
Enable faster development cycles, easier maintenance, and improved user experiences.
Event Driven Architecture icon
Event Driven Architecture
Create durable workflows that promote modularity, flexibility, and responsiveness.
Human Workflow Orchestration icon
Human Workflow Orchestration
Seamlessly insert humans in the loop of complex workflows.
Process orchestration icon
Process Orchestration
Visualize end-to-end business processes, connect people, processes and systems, and monitor performance to resolve issues in real-time
Use Cases
By Industry
Financial Services icon
Financial Services
Secure and comprehensive workflow orchestration for financial services
Media and Entertainment icon
Media and Entertainment
Enterprise grade workflow orchestration for your media pipelines
Telecommunications icon
Telecommunications
Future proof your workflow management with workflow orchestration
Healthcare icon
Healthcare
Revolutionize and expedite patient care with workflow orchestration for healthcare
Shipping and logistics icon
Shipping and Logistics
Reinforce your inventory management with durable execution and long running workflows
Software icon
Software
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aenean leo mauris, laoreet interdum sodales a, mollis nec enim.
Docs
Developers
Learn
Blog
Explore our blog for insights into the latest trends in workflow orchestration, real-world use cases, and updates on how our solutions are transforming industries.
Read blogs
Check out our latest blog:
Conductor CLI Guide: Register, Run, Retry, and Recover Durable Workflows Without Leaving Your Terminal đź’»
Customers
Discover how leading companies are using Orkes to accelerate development, streamline operations, and achieve remarkable results.
Read case studies
Our latest case study:
Twilio Case Study Thumbnail
Orkes Academy New!
Master workflow orchestration with hands-on labs, structured learning paths, and certification. Build production-ready workflows from fundamentals to Agentic AI.
Explore courses
Featured course:
Orkes Academy Thumbnail
Events icon
Events
Videos icons
Videos
In the news icon
In the News
Whitepapers icon
Whitepapers
About us icon
About Us
Pricing
Get a demo
Signup
Slack FaviconDiscourse Logo icon
Get a demo
Signup
Slack FaviconDiscourse Logo icon
Orkes logo image

Company

Platform
Careers
HIRING!
Partners
About Us
Legal Hub
Security

Product

Cloud
Platform
Support

Community

Docs
Blogs
Events

Use Cases

Microservices Workflow Orchestration
Realtime API Orchestration
Event Driven Architecture
Agentic Workflows
Human Workflow Orchestration
Process Orchestration

Compare

Orkes vs Camunda
Orkes vs BPMN
Orkes vs LangChain
Orkes vs Temporal
Twitter or X Socials linkLinkedIn Socials linkYouTube Socials linkSlack Socials linkGithub Socials linkFacebook iconInstagram iconTik Tok icon
© 2026 Orkes. All Rights Reserved.
Back to Blogs

Table of Contents

Share on:Share on LinkedInShare on FacebookShare on Twitter
Worker Code Illustration

Get Started for Free with Dev Edition

Signup
Back to Blogs
PRODUCT ENGINEERING

Discover how easy it is to build your own personalized AI agent! This hands-on guide walks you through the basics; then shows you how to create a fun, tool-using ghost chatbot to make it your own.

Maria Shimkovska
Maria Shimkovska
Content Engineer
Last updated: October 31, 2025
October 31, 2025
4 min read

Related Blogs

How to Connect Supabase to Orkes Conductor | Build the Integration Yourself

Nov 6, 2025

How to Connect Supabase to Orkes Conductor | Build the Integration Yourself

Connect Supabase and Orkes Conductor in a Couple of Minutes | No Code Needed

Nov 5, 2025

Connect Supabase and Orkes Conductor in a Couple of Minutes | No Code Needed

RBAC: Protect Your Workflows from Unauthorized Access and Terrors

Oct 7, 2025

RBAC: Protect Your Workflows from Unauthorized Access and Terrors

Ready to Build Something Amazing?

Join thousands of developers building the future with Orkes.

Start for free

cover illustration of the article The absolute basics of AI agents + demo on how to build your very first one

I’ll try to keep this as concise as I can, but we’re going to cover two powerful ideas:

  1. What an AI agent actually is, in simple terms.
  2. How you can build your own.

And since it’s Halloween, we’ll make it a spooky one, a ghost chatbot that can use a single tool.

Currently, the most built AI agent demos are chatbots. They are easy to put together, illustrate th concept relatively well, and my personal guess is that most people are familiar with that particular use because of ChatGPT.

If you are reading this after the our agent building webinar, welcome! Hope it was informative.

Ok, so what is an AI agent

There seems to be a lot of discussion online about the exact definition of an AI agent. There are some that I agree with, and there is certain verbiage I don't personally like. You may encounter people describing AI agents as "software entities that can perceive their environment and reason about it". To me these words lead to AI agents feeling more like humans, and therefore unnecessarily more complex, than they are.

I would say Ai agents (as we understand them today) are pieces of software that utilize three core elements: memory, a language model (large or small), and access to tools -- all wrapped in some form of a loop. They have a goal and the user is more hands off than in more traditional non-agentic software programs.

Why should I build an AI agent?

Because it helps you think differently about how software can behave. Traditional programs are more structured. They take an input, run fixed logic, and return an output. Agents, on the other hand, are goal-driven. You tell them what you want, and they figure out how to get there, using looping, reasoning, and sometimes calling external tools to help them out.

So instead of coding every possible rule, you give the agent a general objective and the tools to pursue it. It’s a small but powerful mental shift that makes automation and reasoning tasks much more flexible.

Also, honestly, it’s fun. Especially when your agent is a spooky little ghost.

Plus, building one can help you understand how AI agents work. And everyone should understand how they work, even if they don't like AI or don't want to work on building it.

So how do I go about building an AI agent then?

The AI agent in this example is super simple. The point is to show the anatomy of an agent: memory, language model, tools, and loop.

A screenshot of the workflow for the simple AI agent

Let’s break down the workflow above.

Step 1: Initialize the Agent’s Memory

Before anything else, the agent needs somewhere to store its short-term memory. So what it last did, what tool it used, and what it found out.

In this example, the memory is handled by the initialize_agent_memory task.

Step 2: Enter the Loop

The real action happens inside the do_while loop.

This is the thinking and acting phase of the agent.

Each iteration goes something like this:

  1. Think: The agent_brain uses an LLM (in this case, chatgpt-4o-latest) to decide what to do next based on the question and the memory so far.
  2. Decide: It outputs JSON indicating whether it knows the answer or if it needs to use a tool.
  3. Act:
    • If it needs a tool, it runs one (here, a simple HTTP call to find your location)
    • If not, it ends the loop and gives you the final answer.

This pattern of think, decide, act, remember, and repeat is at the heart of most AI agents at the moment.


How does the agent know it's done?

That’s one of the trickier (and more interesting) parts of agent design.

An agent doesn’t truly “know” it’s done; it makes a decision based on what it currently understands from the loop.

At the end of each iteration, the agent evaluates its own output and context. It asks itself something like: “Do I have enough information to answer the user’s question confidently, or do I need to do more?”

If the language model’s reasoning step determines it has reached a complete or confident answer, it sets a flag (for example, "has_answer": true) in its JSON output.

The workflow then exits the loop and returns the final message. This approach isn’t perfect (sometimes agents stop too early or too late), but it mirrors how we humans solve problems. We stop when things feel complete based on the context we’ve gathered.

That’s why designing a clear loop condition and giving the model good instructions about when to stop is so important.


Step 3: Tools

The tools you give an agent define what it can actually do beyond reasoning with text from the LLM model you plug in.

In this Halloween demo, our ghost only has one tool: it can fetch your location. That might seem small, but it's enough to demonstrate how agents mix reasoning with real-world data.

If you ask something like "Do people in my city celebrate Halloween?", the agent will realize it needs to know where you are before answering. And then call the location tool.

Step 4: Wrap It All Together

Once the loop condition is not longer met (in our case, after three iterations or when an answer is found), the agent ends with a final response. The response is a friendly message from our Halloween Ghost Chat.

Here is what might happen if you run it:

text
đź‘» Boo! In Amsterdam, people do celebrate Halloween - mostly with costume parties and pub crawls. Wear something that glows in the dark!

Final Thoughts

This is a tiny agent and intentionally so. But you can see how the pieces fit together: memory, tools, loop, and reasoning.

From here, you can expand it in any direction:

  • Add more tools (weather API, image search, calendar lookups)
  • Replace the model with something lightweight or specialized
  • Connect the outputs to a UI or chat interface

Once you get the pattern down, you can make agents that fetch data, take actions, or even coordinate with other agents.