Building an AI Agent

An AI agent is different from an automation.

Automations follow a predefined sequence that does something when a trigger is called.

An agent is capable of understanding and reasoning. It's a digital employee that can think, remember, and act.

3 Key Components of an agent

  1. Brain(LLM) - handles the reasoning, planning and language generation. For e.g Open AI, Claude
  2. Memory - gives the agent ability to remember past intereactions to make better decisions.
  3. Tools - How the agent interacts with outside world
    1. Retieve data - searching the web
    2. Taking action - sending an email, update database or create event
    3. Orchestration - call other agents, trigger a workflow or chaining actions

With agents, you have single-agent system or multi-agent system

Single agent system

The user prompts, the agent reads the prompt, then gives the solution.

Multi agent system

Multi-agent systems have more struture. You might have different agents doing different tasks. For example, you might have a sales agent, a marketing agent and a customer support agent. Then you might also have one supervising agent who handles the prompt and decides who to send the prompt to.

Setting Guardrails

Asides from using a a AI agent builder like n8n to build these automations, you need to define agent prompts.

Agent Prompt