Skip to content

Software Development at Program Tom LTD

Place for coding, programming, development and software in general.

Menu
  • Blog
  • PDF Booklets
  • Dev Utils & Content
  • Java Spring Boot Or Web Apps
  • English
    • български
    • English
    • Español
    • Português
    • हिन्दी
    • Русский
    • Deutsch
    • Français
    • Italiano
    • العربية
  • About Us
Menu
What is AI Agent

What is an AI Agent

Posted on November 6, 2025 by Toma Velev

AI Agent is not something new or revolutionally – it is LLM combined with with sub-modules that execute the recommendations of it. The MCP (Model Context Protocol) and agent-style LLM workflows (like those in LangChain, LlamaIndex, CrewAI, AutoGen, etc.) can often be reduced to a planning → execution loop powered by an LLM, with tools (including automation platforms like n8n) bridging the gap between LLM reasoning and real-world actions. 

Core Idea: LLM Agent = Planner + Executor + Tools

    A[User Goal] --> B[LLM Planner]
    B --> C{Generate Plan}
    C --> D[Call Tool]
    D --> E[Execute via n8n / API / Script]
    E --> F[Get Result]
    F --> B
    B -->|Loop| C

This is the ReAct (Reasoning + Acting) loop, foundational to most agent systems.


1. Planning Phase (LLM does this)

  • LLM receives context + goal.
  • Outputs structured reasoning or tool calls (e.g., JSON).
  • Example:json{ "action": "search_web", "input": "latest AI agent frameworks 2025" }

2. Execution Phase (Tools do this)

  • A router (agent framework) interprets the LLM’s output.
  • Calls the right tool:
    • Search API
    • Database query
    • n8n workflow (via webhook or API)
    • Python script
    • Browser automation (Puppeteer, Playwright)

3. n8n as a Tool in the Loop — n8n is perfect for converting LLM outputs into executable workflows.

User: "Find 3 top AI newsletters and email them to me."

LLM Plan:

json

[
  { "tool": "web_search", "query": "best AI newsletters 2025" },
  { "tool": "extract_emails", "input": "{{search_results}}" },
  { "tool": "send_email", "to": "me@domain.com", "content": "{{emails}}" }
]

Agent Framework (e.g., LangChain):

  • Calls web_search → returns results
  • Calls extract_emails → parses
  • Triggers n8n workflow via webhook:
    • n8n receives: { emails: […] }
    • Uses Gmail node → sends email
    • Returns: “Email sent!”

Back to LLM → summarizes final answer.


MCP (Model Context Protocol) – The Glue?

MCP (by Block / Square) is a standardized protocol for:

  • LLMs to discover tools
  • Tools to declare capabilities (like OpenAPI but for agents)
  • Secure, typed, streaming communication

Think: OpenAPI + WebSockets + Auth for AI agents. MCP in the loop:

yaml:

tool: send_email
description: Send email via Gmail
input_schema:
  to: string
  subject: string
  body: string

→ LLM sees this, calls it safely → n8n (or any MCP server) executes.


So Is It “Just” Planning + Execution + n8n?Yes — at the core, it is.But with important layers:

Layer Purpose
LLM Reasoning, planning, natural language
Agent Framework Loop control, memory, tool routing
MCP / Tool Specs Safe, discoverable tool interfaces
n8n / Zapier / Scripts Real-world execution (APIs, email, DB, etc.)

Real-World Example Stack

Frontend → [LangChain Agent] → LLM (Claude/GPT) → MCP Server → n8n Workflow → Gmail/Slack/DB
  • n8n exposes workflows as MCP tools or webhooks
  • Agent calls: POST /mcp/send_summary
  • n8n runs nodes: scrape → summarize → email
  • Returns result → agent continues

Summary: Your Intuition Is Spot-On

“Is it just planning → execution → LLM + n8n/tools?”

Yes — 100%.

  • LLM = brain (plan, decide, reflect)
  • n8n = hands (do real stuff)
  • Agent loop = nervous system (coordinate)
  • MCP = standardized muscles (tool interface)

You don’t need fancy frameworks — you can build this with:

  • OpenAI + function calling
  • n8n webhook node
  • A few lines of Python

Minimal Working Example (Python + n8n)

python

import openai, requests

def call_llm(prompt):
    response = openai.chat.completions.create(
        model="gpt-4o",
        messages=[{"role": "user", "content": prompt}],
        tools=[{
            "type": "function",
            "function": {
                "name": "trigger_n8n",
                "parameters": {"type": "object", "properties": {"task": {"type": "string"}}}
            }
        }]
    )
    return response.choices[0].message

# LLM decides to use n8n
msg = call_llm("Send me top 3 AI news via email")
if msg.tool_calls:
    args = msg.tool_calls[0].function.arguments
    requests.post("https://n8n.yourdomain.com/webhook/ai-task", json=args)

n8n receives → runs email workflow → done.

  • Jenkins SCP File Upload to Remote Server
  • Essential Programming Books – Principles & Flutter
  • Social Media Platforms 🌍
  • Strategies to prevent review regressions
  • How to set Google Map Theme in a Flutter App

Categories

  • Apps (22)
  • ChatGPT (23)
  • Choosing a Framework (38)
  • Flutter (269)
  • Graphical User Interface (14)
  • Marketing (117)
  • Software Development (286)
  • Spring (45)
  • StartUp (22)
  • Uncategorized (14)
  • Uncategorized (4)
  • Vaadin (15)

Tags

Algorithms (9) crypto (29) flutterdev (39) General (86) Java (7) QR & Bar Codes (3) Software Dev Choices (33) Spring Boot (1) standards (1) Theme (3) User Authentication & Authorization (9) User Experience (10) Utilities (19) WordPress (11)

Product categories

  • All Technologies (84)
    • Flutter Apps (24)
    • GPT (4)
    • Java (38)
    • Native Android (3)
    • PHP (9)
    • Spring (Boot) / Quarkus (35)
    • Utils (15)
    • Vaadin 24+ (27)
    • Vaadin 8 (1)
  • Apps (18)
    • Employees DB (1)
    • Notes (6)
    • Personal Budget (1)
    • Recipes Book (1)
    • Stuff Organizer (1)
    • To-Do (2)
  • PDF Books (3)
  • Source Code Generators (8)

Recent Posts

  • Jenkins SCP File Upload to Remote Server
  • Essential Programming Books – Principles & Flutter
  • Social Media Platforms 🌍
  • Strategies to prevent review regressions
  • How to set Google Map Theme in a Flutter App

Post Categories

  • Apps (22)
  • ChatGPT (23)
  • Choosing a Framework (38)
  • Flutter (269)
  • Graphical User Interface (14)
  • Marketing (117)
  • Software Development (286)
  • Spring (45)
  • StartUp (22)
  • Uncategorized (14)
  • Uncategorized (4)
  • Vaadin (15)