Agentic AI and How It Works

VenkatVenkat
3 min read

What is an AI Agent?

  • A Large Language Model (LLM) is powerful at understanding and generating natural language.

  • But it is:

    • Trained on past data.

    • Trained on large public data.

    • Stateless and isolated — it cannot access real-time or private data, connect to external systems, update databases, or call APIs on its own.

  • Think of an LLM as a brain without a body — it can think, reason, and plan, but it can’t act.

So we create Agents:

An AI agent is a software system that uses artificial intelligence to autonomously perform tasks and achieve goals, often without direct human intervention.

  • The agent uses the LLM to plan or interpret, and external tools to take action (e.g., calling APIs, querying databases, interacting with users).

  • This makes the system capable of doing real-world tasks like:

    • Getting the weather

    • Searching the web

    • Sending an email

    • Writing to a database

Example: Why LLM Alone Isn’t Enough

  • If you ask an LLM:
    "What's the weather in Bangalore right now?"
    It will fail to answer accurately because it was trained on past data.

  • But if you:

    1. Fetch the live weather using a function, and

    2. Insert it into the system prompt, like:

      "User asked for weather in Bangalore. The current weather is 28°C, cloudy."

Then the LLM can respond intelligently, e.g.,

"It’s currently 28°C and cloudy in Bangalore. Do you want to pack an umbrella?"

But what are Tools ?

  • A tool is a function or API the agent can use to complete a specific task.

  • You can build tools for:

    • Weather API calls

    • Database reads/writes

    • File uploads

    • Google Search

    • Email sending

    • Code execution

How It Works:

  1. You define a function in your codebase (e.g., getWeather(city)).

  2. You describe this function to the LLM using a prompt or function schema (like in OpenAI’s function calling).

  3. The agent decides when to use that tool based on the user query.

LLM + Tools = Agent

ComponentRole
LLMThinks, plans, interprets queries
ToolExecutes specific real-world actions
AgentCoordinates both to solve tasks end-to-end

Real-Life Agent Frameworks

Some libraries and frameworks help you build agents easily:

  • LangChain – Lets you define tools, memory, agent behaviors

  • OpenAI Function Calling / Assistants API

  • Auto-GPT / BabyAGI – Autonomous agents that loop until a goal is met

  • Semantic Kernel – Microsoft’s framework for agents

Note: This article is my understanding from the GenAI cohort from chaicode website. #chaicode #chaiaurcode

0
Subscribe to my newsletter

Read articles from Venkat directly inside your inbox. Subscribe to the newsletter, and don't miss out.

Written by

Venkat
Venkat