30 Days of AIDay 22 of 30 · Week 4: Enterprise Workflows
Course outline▾

Week 4 · Enterprise Workflows

  1. Day 22Autonomous Agents — From Passive LLMs to Goal-Driven Execution
  2. Day 23Tool Use & Function Calling: Connecting LLMs to APIs, Databases, and ShellsComing soon · 2026-10-23 · 7 PM IST
  3. Day 24Multi-Agent Orchestration: Supervisor, Worker, and Evaluator PatternsComing soon · 2026-10-24 · 7 PM IST
  4. Day 25Automated CI/CD: Automating the Software Lifecycle for AI ModelsComing soon · 2026-10-25 · 7 PM IST
  5. Day 26Zero-Trust Security for AI: Sandboxing Ephemeral Execution & Model EgressComing soon · 2026-10-26 · 7 PM IST
  6. Day 27Observability & Tracing for Agentic Systems (Telemetry, Logs, and Metrics)Coming soon · 2026-10-27 · 7 PM IST
  7. Day 28Human-in-the-Loop Architecture: Machine Second, Human First in PracticeComing soon · 2026-10-28 · 7 PM IST
  8. Day 29Managing Technical Debt, Drift, and Model Governance in Enterprise ITComing soon · 2026-10-29 · 7 PM IST
  9. Day 30The 10-Year Horizon: Architecting IT Strategy for the AI-Native EnterpriseComing soon · 2026-10-30 · 7 PM IST
Open the course page →

Day 22: Autonomous Agents — From Passive LLMs to Goal-Driven Execution

2026-10-22 · 8 min read

Early generative AI was passive: you send a prompt, the model returns text, and a human decides what to do next. That is useful for drafting, but it cannot run a business workflow on its own. The next step is the autonomous agent: a system that can plan, check its own progress and carry out a multi-step goal with little human intervention.

In plain terms: A chatbot is a colleague who answers your question and then waits. An agent is a colleague you give a task to, who comes back when it is done, or when they are stuck.

From answering to doing Passive LLMAutonomous agentPrompt Text answer. Done.Goal Plan, act, check, repeatA human does the next stepThe system does the stepsAgents turn a model from an assistant into an executor.Useful for workflows. Also riskier, so guardrails matter.
A passive LLM returns one text answer and a human decides the next step. An autonomous agent takes a goal and plans, acts, checks the result and repeats with little human intervention. That makes it useful for workflows and also riskier, so guardrails matter.

1. The core agentic loop

An agent runs a repeating cycle, borrowed from classic control systems.

  • Perceive: take in the goal, the current state and any context.
  • Plan: break an abstract goal, such as "audit this quarter's server error logs and flag failing optics", into an ordered list of concrete tasks.
  • Act: pick a capability and use it: call an API, run a database query, read a file.
  • Reflect: compare the result with the goal. If something went wrong, adjust and try again.
The agentic loop 1. Perceivegoal and context2. Planbreak into tasks3. Actcall a tool4. Reflectcheck the resultGoal: "audit server error logs and flag failing optics"Loop until the goal is met or a limit is reached.
An agent loops through four stages: perceive the goal and context, plan the tasks, act by calling a tool, and reflect on the result. It repeats until the goal is met or a limit such as a step budget is reached.

Reflection is what makes an agent more than a script. If a query returns no rows, the agent can notice why, correct its approach and run it again. In practice you always cap the number of steps and the cost, because an agent that keeps retrying can loop forever.

Reflection: fix and retry ActSELECT * FROM optics WHERE stat='bad'Observe0 rows returnedReflectColumn is named status, not statAct againSELECT * FROM optics WHERE status='failing'Observe14 rows: goal on trackExample is illustrative. A step limit stops endless retries.
After an action the agent observes the result. When a query returns no rows it reflects, notices the wrong column name, corrects the query and tries again. The example is illustrative, and a step limit prevents endless retries.

2. Memory: short-term and long-term

  • Working memory is the context window: the current plan, intermediate values and recent tool outputs. It is fast but limited, and it disappears when the run ends.
  • Episodic memory is a record of past runs kept in a vector database. When the agent meets a similar problem, it can retrieve how it solved a related one before.
Two kinds of agent memory Working memoryThe context windowCurrent plan and stateRecent tool outputsFast, but limited and temporaryEpisodic memoryA vector databasePast runs and fixesRecalled by similarityPersistent and searchable"I solved a similar config error before."Memory lets agents improve across tasks, not only within one.
Working memory is the context window holding the current plan, state and recent tool outputs. Episodic memory stores past runs in a vector database so an agent can recall how it fixed a similar problem before.

Here is the loop in a few lines of Python. The llm and tools pieces are placeholders for your model call and your real functions, so treat this as the shape of an agent, not a finished one.

MAX_STEPS = 8                      # a hard stop so the loop cannot run forever

def run_agent(goal: str) -> str:
    history = [f"Goal: {goal}"]
    for step in range(MAX_STEPS):
        # Plan + act: the model chooses the next tool call, or says it is done
        decision = llm("\n".join(history))          # e.g. {"tool": "run_sql", "args": {...}} or {"done": "..."}
        if "done" in decision:
            return decision["done"]

        result = tools[decision["tool"]](**decision["args"])      # act

        # Observe + reflect: put the result back so the model can adjust
        history.append(f"Called {decision['tool']} -> {result}")
    return "Stopped: step limit reached. A human should review."

Turning a language model into an agent shifts AI from an assistant into something that executes. That power is why the next lessons are about tools, teams of agents, testing and safety.

Coming Up Next

Day 23: Tool use and function calling: connecting LLMs to APIs, databases and shells.

#AIAgents #AutonomousAI #EnterpriseAutomation #AgenticWorkflows #SoftwareEngineering