#AI Agents

Articles about AI Agents — exploring patterns, best practices, and real-world implementations in production systems.

311 posts tagged with ai agents. ← All posts

#A2A (14)#ADK (8)#AG-UI (6)#AI (9)#AI Agents (311)#AI Architecture (10)#AI Cost (10)#AI Cost Optimization (8)#AI Engineering (201)#AI Evaluation (8)#AI Governance (29)#AI Red Teaming (9)#AI Research (9)#AI Safety (8)#AI Security (21)#AI in Production (12)#AML (3)#API Design (10)#API Security (8)#APIs (55)#AWS (17)#Accounting (9)#Agent Skills (3)#Agentic AI (24)#Agentic Commerce (12)#Agentic RAG (8)#Agents (4)#Amazon Bedrock (8)#Analytics (3)#Architecture (36)#Audit (3)#Authentication (11)#Authorization (3)#Automation (6)#Azure (11)#Azure AI Foundry (9)#Backend Engineering (310)#Benchmarks (3)#Best Practices (3)#BigQuery (6)#Business Finance (8)#Business Strategy (55)#C (8)#CI/CD (8)#Caching (10)#Capital Markets (14)#Card Payments (12)#Cards (13)#Career (24)#Checkpointing (4)#Claude Code (8)#Cloud (5)#Cloud Architecture (3)#Cloud Native (10)#Code Review (8)#Collaboration (5)#Communication (9)#Compliance (52)#Computer Networking (9)#Computer Science (32)#Computer Vision (5)#Concurrency (37)#Consulting (3)#Containers (10)#Context Engineering (10)#Cost Optimisation (5)#Credit (14)#Credit Risk (14)#CrewAI (8)#Crypto (12)#Cryptocurrency (12)#Cryptography (8)#Custody (9)#DSPy (8)#Data (13)#Data Engineering (12)#Data Structures (9)#Databases (37)#Deployment (3)#Design Patterns (10)#DevOps (16)#DevSecOps (11)#Developer Experience (5)#Developer Tools (5)#Distributed Systems (94)#Documentation (3)#Edge AI (8)#Embeddings (15)#Emotional Intelligence (8)#Energy (8)#Engineering (11)#Engineering Culture (3)#Engineering Practices (16)#Error Handling (4)#Evaluation (53)#Event-Driven Architecture (8)#FREE-AI (8)#FX (5)#Feedback (4)#FinOps (23)#FinTech (6)#Financial AI (14)#Financial Systems (129)#Fine-Tuning (11)#Fintech (131)#Flutter (8)#Foreign Exchange (5)#Forward Deployed Engineer (8)#Forward Deployed Engineering (8)#Fraud (10)#Function Tools (5)#Functional Programming (3)#Fundraising (8)#GCP (5)#Gemma (4)#Generative AI (3)#Git (8)#Go (220)#Go-to-Market (8)#Google ADK (36)#Governance (56)#Granite (6)#GraphQL (3)#Growth (3)#Guardrails (25)#HIPAA (3)#HTTP (3)#Harness Engineering (8)#Hiring (8)#Hugging Face (8)#Human-in-the-Loop (8)#IBM watsonx (8)#Identity (11)#Integration (3)#Intellectual Property (8)#Interfaces (3)#JavaScript (8)#KYC (11)#KYC and AML (12)#Kafka (10)#Kubernetes (17)#LLM (5)#LLM Inference (8)#LLM-as-Judge (3)#LLMs (135)#LangChain (8)#LangGraph (11)#Leadership (26)#Ledger (12)#Legal (8)#Lending (14)#LlamaIndex (8)#MCP (22)#MLOps (31)#Machine Learning (32)#Marketing (16)#Markets (4)#Memory (15)#Memory Management (5)#Metrics (6)#Microservices (3)#Microsoft Agent Framework (150)#Middleware (6)#Migration (9)#Monitoring (3)#Multi-Agent (10)#Multi-Agent AI (14)#Multi-Agent Systems (73)#Multimodal (3)#Multimodal AI (8)#NIM (5)#NVIDIA (8)#OAuth (3)#OWASP (7)#Observability (44)#On-Device AI (8)#Open Source (7)#OpenTelemetry (5)#Operating Systems (8)#Operations (10)#Opinion (6)#Orchestration (10)#Organizational Design (8)#Payment Rails (16)#Payments (54)#People (8)#Performance (43)#Platform Engineering (9)#PreSales (8)#Privacy (5)#Privacy Engineering (3)#Process (4)#Product (27)#Product Management (8)#Production (8)#Programming (10)#Programming Languages (48)#Prompt Engineering (66)#Prompt Injection (6)#Protocol Buffers (3)#Protocols (9)#Providers (4)#Pydantic AI (8)#Python (142)#Quality (3)#RAG (58)#RBI (3)#REST (5)#Rails (16)#Reasoning Models (8)#Reconciliation (3)#RegTech (8)#Regulation (9)#Reliability (48)#Resilience (4)#Responsible AI (5)#Retrieval (3)#Risk (13)#Rust (32)#SRE (21)#Sales (9)#Scalability (3)#Security (81)#Security Engineering (8)#Self-Evolving Agents (16)#Sessions (3)#Settlement (9)#Soft Skills (8)#Software (3)#Software Architecture (36)#Software Engineering (144)#Spanner (4)#Startups (30)#Strands (8)#Streaming (28)#Structured Output (4)#Sustainability (8)#System Design (32)#Systems Programming (48)#Testing (49)#Tool Use (22)#Tooling (4)#Tools (3)#Trading (8)#Treasury (6)#Type System (3)#Type Systems (11)#TypeScript (8)#Vector Databases (21)#Vector Search (11)#Venture Capital (8)#Version Control (8)#Web Development (6)#Workflows (14)#gRPC (13)#smolagents (8)
Pratik Dhanave · ·5 min read

smolagents in Practice

smolagents is the right choice when you value a small library you can fully understand, the code-agent approach fits your task, and you can execute code safely. It's the wrong choice when you need a big ecosystem, can't sandbox, or your tasks are simple isolated calls. This closing post gives the honest verdict and places smolagents in the landscape.

smolagents is the right choice when you value a small library you can fully understand, the code-agent approach fits your task, and you can execute code safely — and the wrong choice when you need a big ecosystem, can't sandbox, or your tasks are simple isolated calls.

Pratik Dhanave · ·5 min read

Strands in Practice

Strands is the right framework when you want to trust a capable model to drive and get out of its way — and the wrong one when you need to guarantee a process. This closing post gives the honest verdict on when to reach for Strands, how it compares to its peers, and how the model-driven approach fits the wider agent landscape.

Strands is the right framework when you want to trust a capable model to drive and get out of its way — and the wrong one when you need to guarantee a process. The honest verdict on when to reach for Strands and how it compares.

Pratik Dhanave · ·6 min read

The Agent Loop and Multi-Agent Systems

Underneath the code-agent magic is a simple, readable loop — the kind of loop smolagents's minimalism lets you actually understand. And when one agent isn't enough, the same minimal parts compose into multi-agent systems, where a manager agent's code calls other agents as if they were tools.

Underneath the code-agent magic is a simple, readable loop that smolagents's minimalism lets you actually understand. And when one agent isn't enough, the same parts compose into multi-agent systems, where a manager agent's code calls other agents like tools.

Pratik Dhanave · ·6 min read

Observability and Production

A model-driven agent decides its own path, which means you cannot know what it did without watching — so observability isn't a nice-to-have in Strands, it's a requirement. Built on OpenTelemetry and shaped by AWS's own production use, Strands treats seeing inside the agent as first-class, because a loop you can't see is a loop you can't trust.

A model-driven agent decides its own path, so you cannot know what it did without watching — observability isn't a nice-to-have in Strands, it's a requirement. Built on OpenTelemetry and shaped by AWS's own production use.

Pratik Dhanave · ·6 min read

Pydantic AI in Production

A framework earns its place not in the demo but in production — under real traffic, real failures, and the need to observe, control cost, and evolve. Pydantic AI's typed, testable design carries into production well, and paired with observability and the model-agnosticism it's had all along, it makes agents you can actually operate. This closing post covers taking a Pydantic AI agent live.

A framework earns its place in production — under real traffic, failures, and the need to observe, control cost, and evolve. Pydantic AI's typed, testable design carries into production well, paired with observability and model-agnosticism.

Pratik Dhanave · ·5 min read

Models

A code agent is only as good as the model writing the code — and smolagents, true to its Hugging Face roots and minimalist ethos, lets you run almost any model behind it: open models from the Hub, hosted APIs, local models, anything reachable through its integrations. Model choice matters especially here, because the model's code-writing ability is the agent's ability.

A code agent is only as good as the model writing the code — and smolagents lets you run almost any model: open models from the Hub, hosted APIs, local models. Model choice matters especially here, because the model's code-writing ability is the agent's ability.

Pratik Dhanave · ·6 min read

Multi-Agent Systems

One model-driven agent handles a lot, but some problems want a team — a specialist per subtask, or a coordinator delegating to workers. Strands builds multi-agent systems from the same minimal parts, most elegantly by making an agent a tool another agent can call, so the model-driven approach scales up without new machinery.

One model-driven agent handles a lot, but some problems want a team. Strands builds multi-agent systems from the same minimal parts, most elegantly by making an agent a tool another agent can call — the model-driven approach scaling up.

Pratik Dhanave · ·6 min read

Memory and State

A chain answers one call; a conversation needs to remember. LangChain handles memory by treating conversation history as data you manage and pass in — and, for anything beyond simple chat history, hands state management to LangGraph. Knowing which is which keeps your stateful applications clean instead of tangled.

A chain answers one call; a conversation needs to remember. LangChain handles memory by treating conversation history as data you manage and pass in — and, for richer state, hands state management to LangGraph.

Pratik Dhanave · ·6 min read

Testing and Evals

Most agent code is tested by running it and eyeballing the output — because testing agents properly is genuinely hard. Pydantic AI's whole design has been quietly building toward making it easy: type safety, dependency injection, and test models combine so you can unit-test agent logic deterministically, offline, without ever calling a real LLM. This is arguably the framework's biggest practical advantage.

Most agent code is tested by running it and eyeballing the output, because testing agents properly is hard. Pydantic AI's design builds toward making it easy: type safety, dependency injection, and test models let you unit-test agent logic deterministically, offline, with no real LLM.

Pratik Dhanave · ·5 min read

CrewAI in Production

CrewAI makes it easy to build a multi-agent system and just as easy to build one that's slow, expensive, and unreliable — so production CrewAI is mostly about discipline: measure it, keep it as simple as the problem allows, and use Flows for the parts that must be dependable.

CrewAI makes it easy to build a multi-agent system and just as easy to build one that's slow, expensive, and unreliable — so production CrewAI is mostly discipline: measure it, keep it simple, and use Flows where it must be dependable.

Pratik Dhanave · ·5 min read

Limits, Risks, and Open Problems

The frontier is genuinely exciting and genuinely oversold, and telling the difference matters — so this closing post is an honest accounting of what self-evolving agents cannot yet do, what can go wrong, and what remains unsolved.

The frontier is genuinely exciting and genuinely oversold. An honest accounting of what self-evolving agents cannot yet do, what can go wrong, and what remains unsolved.

Pratik Dhanave · ·5 min read

Tools

Even an agent that thinks in code needs tools — the functions its code calls to reach beyond itself. smolagents defines them the same minimal way it does everything: a decorated Python function. The twist is that in a code agent, tools are called from within code, which is what makes composing them so natural.

Even an agent that thinks in code needs tools — the functions its code calls. smolagents defines them the same minimal way (a decorated function), and the twist is that tools are called from within code, which is what makes composing them so natural.

Pratik Dhanave · ·5 min read

Model Providers

The model drives a Strands agent, so which model you use is the single biggest determinant of how well it works — and Strands keeps that a swappable choice across providers rather than locking you to one. Model-agnosticism isn't a convenience here; in a model-driven framework it's foundational.

The model drives a Strands agent, so which model you use is the biggest determinant of how well it works — and Strands keeps that a swappable choice across providers. Model-agnosticism isn't a convenience here; it's foundational.

Pratik Dhanave · ·6 min read

Tools and Agents

Chains follow a path you define; agents decide the path themselves. LangChain gives you both the tools an agent uses and — increasingly through LangGraph — the machinery to run agent loops reliably. Understanding where LangChain's tools end and LangGraph's orchestration begins is the key to building agents that work rather than agents that wander.

Chains follow a path you define; agents decide the path themselves. LangChain gives you the tools an agent uses and — increasingly through LangGraph — the machinery to run agent loops reliably. Knowing where tools end and orchestration begins is the key.

Pratik Dhanave · ·6 min read

Messages, History, and Streaming

A single agent run answers one question; a conversation needs memory, and a good user experience needs the answer to appear as it's generated. Pydantic AI handles both through its message system — the record of what was said that you pass between runs — and streaming, which delivers typed output progressively. Together they turn one-shot agents into conversational, responsive ones.

A single run answers one question; a conversation needs memory, and good UX needs the answer to appear as it's generated. Pydantic AI handles both through its message system — the record you pass between runs — and streaming that delivers typed output progressively.

Pratik Dhanave · ·4 min read

Workflows

An agent's reasoning loop is flexible but opaque and hard to control. A workflow is the opposite: you make the orchestration explicit as steps and events, trading some autonomy for the predictability, testability, and control that complex applications need.

An agent's reasoning loop is flexible but opaque and hard to control. A workflow is the opposite: you make orchestration explicit as steps and events, trading some autonomy for the predictability, testability, and control complex applications need.

Pratik Dhanave · ·4 min read

Memory and Collaboration

A crew is only a real team if its members remember what happened and can hand work to each other — and CrewAI's memory and delegation features are what turn a set of independent agents into something that actually collaborates.

A crew is only a real team if its members remember what happened and can hand work to each other — memory and delegation are what turn a set of independent agents into something that actually collaborates.

Pratik Dhanave · ·5 min read

Evaluating Open-Ended Improvement

Every frontier method is a search, and a search is only as good as the evaluator that ranks its candidates — so at the frontier, evaluation stops being a measurement and becomes the single most dangerous component in the system.

Every frontier method is a search, and a search is only as good as the evaluator that ranks its candidates — so at the frontier, evaluation becomes the single most dangerous component in the system.

Pratik Dhanave · ·5 min read

Building an Agentic RAG System

The pieces from this series — routing, query transformation, graded retrieval, multi-hop, and evaluation — assemble into one system that reasons about retrieval as carefully as it reasons about the answer, while spending only as much as each question needs.

Routing, query transformation, graded retrieval, multi-hop, and evaluation assemble into one system that reasons about retrieval as carefully as the answer — while spending only as much as each question needs.

Pratik Dhanave · ·6 min read

Secure Code Execution

The power of code agents comes with a sharp edge: you are executing code written by an LLM, and an LLM can be wrong, or manipulated into writing something harmful. Running that code unsandboxed is one of the most dangerous things you can do in an application, so sandboxing isn't optional for code agents — it's the price of admission.

The power of code agents comes with a sharp edge: you are executing code written by an LLM, which can be wrong or manipulated. Running it unsandboxed is one of the most dangerous things you can do — so sandboxing is the price of admission.

Pratik Dhanave · ·6 min read

Tools

In a model-driven agent, tools are everything the agent can actually do — the model supplies the reasoning, the tools supply the capability. Strands makes defining them almost trivial (decorate a Python function) and plugs into MCP's large ecosystem, so equipping an agent well becomes the developer's main lever.

In a model-driven agent, tools are everything the agent can do — the model supplies the reasoning, the tools supply the capability. Strands makes defining them trivial and plugs into MCP, so equipping an agent well is the developer's main lever.

Pratik Dhanave · ·7 min read

Effort Tuning, Budgets, and the max_tokens Trap

Two more levers of control: how hard the model thinks, and how you bound what it spends. Both have measured sweet spots — and both have a trap that quietly wastes money. The sharpest is a cap that most people reach for first and that saves nothing at all: max_tokens.

Two levers of control: how hard the model thinks, and how you bound what it spends. Both have measured sweet spots — and both have a trap that quietly wastes money. The sharpest is a cap most people reach for first that saves nothing: max_tokens.

Pratik Dhanave · ·6 min read

Dependency Injection

Dependency injection is the least flashy Pydantic AI feature and quietly one of the most important — it's what lets your agents reach real databases, API clients, and user context without hard-wiring them, and it's the single biggest reason Pydantic AI agents are so testable. Borrowed straight from how good backend frameworks work, applied to agents.

Dependency injection is the least flashy Pydantic AI feature and quietly one of the most important — it lets agents reach real databases and clients without hard-wiring them, and it's the single biggest reason Pydantic AI agents are so testable.

Pratik Dhanave · ·4 min read

Agents and Tools

The moment you expose a query engine as a tool, RAG stops being a fixed pipeline and becomes a decision: the agent decides whether to retrieve, from which source, and whether one search was enough. That is agentic RAG, and it's built into LlamaIndex.

The moment you expose a query engine as a tool, RAG stops being a fixed pipeline and becomes a decision: the agent decides whether to retrieve, from which source, and whether one search was enough. That is agentic RAG.

Pratik Dhanave · ·5 min read

Flows: Event-Driven Orchestration

Crews give agents autonomy, which is powerful and unpredictable; Flows give you back deterministic control — an event-driven engine where you decide exactly what runs when, with crews slotted in only where autonomy is actually wanted.

Crews give agents autonomy, which is powerful and unpredictable; Flows give you back deterministic control — an event-driven engine where you decide exactly what runs when, with crews slotted in only where autonomy is wanted.

Pratik Dhanave · ·5 min read

MCP vs A2A: Tools vs Agents

The most common question about the two big agent protocols is which one to use — and the answer is almost always "both," because they solve different problems: MCP connects an agent to its tools, A2A connects an agent to other agents.

The most common question about the two big agent protocols is which to use — and the answer is almost always both, because MCP connects an agent to its tools and A2A connects an agent to other agents.

Pratik Dhanave · ·5 min read

Meta-Agents and Self-Reference

The deepest form of self-evolution is recursive: not an agent that improves its answers, but an agent that improves the process that improves agents — a system reaching up a level to modify itself.

The deepest form of self-evolution is recursive: not an agent that improves its answers, but an agent that improves the process that improves agents — a system reaching up a level to modify itself.

Pratik Dhanave · ·5 min read

Building RAG and Agents in DSPy

The two systems everyone builds — retrieval-augmented generation and tool-using agents — are where DSPy's declarative approach pays off most, because they are exactly the multi-step pipelines whose prompts are hardest to tune by hand.

RAG and tool-using agents are where DSPy's declarative approach pays off most — they are exactly the multi-step pipelines whose prompts are hardest to tune by hand.

Pratik Dhanave · ·5 min read

Evaluating Agentic RAG

Every agentic technique in this series adds cost and complexity, so the only way to know any of it is worth it is to measure — and RAG needs measurement on two fronts at once: did it retrieve the right things, and did it answer faithfully from them?

Every agentic technique adds cost, so the only way to know it is worth it is to measure — and RAG needs measurement on two fronts: did it retrieve the right things, and did it answer faithfully from them?

Pratik Dhanave · ·5 min read

Building a Context Pipeline

Everything in this series — the budget, the system prompt, retrieval, memory, tools, and compaction — comes together as a pipeline that assembles the right window on every single turn, deliberately rather than by accident.

The budget, system prompt, retrieval, memory, tools, and compaction come together as a pipeline that assembles the right window on every turn — deliberately rather than by accident.

Pratik Dhanave · ·5 min read

A2A and MCP Together

The two protocols people keep pitting against each other are actually two halves of the same architecture — MCP gives an agent its tools, A2A gives it collaborators, and real systems need both.

MCP gives an agent its tools, A2A gives it collaborators, and real systems need both. How the two protocols compose — tools within an agent, agents between — in one architecture.

Pratik Dhanave · ·6 min read

Why Code Actions Win

The claim that agents should write code isn't just aesthetic — Hugging Face backs it with measured results: code agents take fewer steps, make fewer LLM calls, and score better on hard benchmarks. This post examines the evidence and the mechanism, so you understand not just that code actions win but why.

The claim that agents should write code isn't just aesthetic — Hugging Face backs it with measured results: code agents take fewer steps, make fewer LLM calls, and score better on hard benchmarks. This examines the evidence and the mechanism.

Pratik Dhanave · ·6 min read

The Agent Loop

Strands's agent loop is deliberately small: a prompt goes in, the model decides, tools run if needed, results feed back, and it repeats until the model is done. What makes it distinctive isn't the loop's shape — every agent has one — but that Strands exposes it plainly and lets the model drive it, with only three ingredients you provide.

Strands's agent loop is deliberately small: a prompt goes in, the model decides, tools run if needed, results feed back, and it repeats until the model is done. Three ingredients you provide, and a loop the model drives.

Pratik Dhanave · ·6 min read

Tools and Function Calling

An agent that can only talk is a chatbot; an agent that can act needs tools. In Pydantic AI, a tool is just a typed Python function you decorate — the framework reads its type hints to tell the model how to call it, validates the model's arguments, and runs it. Function calling stops being schema-wrangling and becomes writing ordinary typed functions.

An agent that can only talk is a chatbot; one that can act needs tools. In Pydantic AI, a tool is just a typed Python function you decorate — the framework reads its type hints to tell the model how to call it, validates arguments, and runs it.

Pratik Dhanave · ·5 min read

Tools: Giving Agents Capabilities

An agent without tools can only think and write; tools are what let it act — search the web, query a database, call an API — and turning a Python function into a CrewAI tool is deliberately almost effortless.

An agent without tools can only think and write; tools are what let it act — search the web, query a database, call an API — and turning a Python function into a CrewAI tool is deliberately almost effortless.

Pratik Dhanave · ·5 min read

Reflective Optimizers: Learning in Language

What if the optimizer's update step were not a numeric gradient but a paragraph of natural-language reflection? That is the bet behind reflective optimizers — and one of them rivals reinforcement learning while using a fraction of the rollouts.

What if the optimizer's update step were not a numeric gradient but a paragraph of natural-language reflection? That is the bet behind reflective optimizers — one of which rivals RL with a fraction of the rollouts.

Pratik Dhanave · ·5 min read

Multi-Hop and Iterative Retrieval

Some questions cannot be answered by any single search because the answer is assembled from facts that must be found in sequence, each retrieval informed by the last — and that is what iterative, multi-hop retrieval provides.

Some questions cannot be answered by any single search because the answer is assembled from facts found in sequence, each retrieval informed by the last — that is iterative, multi-hop retrieval.

Pratik Dhanave · ·5 min read

Compaction, Summarization, and Long Context

When context threatens to overflow, you compress it; and when you have a huge window to spend, you still should not fill it — because a long context is not used as well as a short, focused one.

When context threatens to overflow you compress it; and when you have a huge window you still should not fill it — because a long context is not used as well as a short, focused one.

Pratik Dhanave · ·6 min read

Shipping MCP Securely to Production

An MCP server can run code and see context on the model's behalf, which makes it powerful and dangerous in equal measure — this is how to deploy one without handing attackers the keys.

An MCP server can run code and see context on the model's behalf. Authentication, prompt-injection and tool-poisoning risks, human-in-the-loop, sandboxing, and a production checklist.

Pratik Dhanave · ·6 min read

Building a Self-Evolving Agent

The pieces from this series — memory, self-refinement, a skill library, and an evaluation gate — combine into one modest architecture that actually gets better as it runs, without the hype and without the footguns.

Memory, grounded self-refinement, a verified skill library, and an evaluation gate combine into one buildable architecture that gets better as it runs — safely.

Pratik Dhanave · ·6 min read

Code Agents: Actions as Code

The single idea that defines smolagents is that an agent's action is a snippet of Python, not a JSON blob. It sounds like a minor encoding detail and turns out to change what an agent can do in a single step — because code carries logic, loops, variables, and composition that structured tool calls simply can't express.

The single idea that defines smolagents is that an agent's action is a snippet of Python, not a JSON blob. It sounds like an encoding detail and turns out to change what an agent can do in one step — because code carries logic, loops, and composition JSON can't.

Pratik Dhanave · ·6 min read

The Model-Driven Approach

The model-driven approach is not just how Strands works — it's a stance on where intelligence should live in an agent. Put it in the model's reasoning, not in developer-authored control flow. This post unpacks why that stance is increasingly the right one, and where it isn't.

The model-driven approach is a stance on where intelligence should live in an agent: in the model's reasoning, not in developer-authored control flow. This post unpacks why that stance is increasingly right, and where it isn't.

Pratik Dhanave · ·6 min read

Structured Outputs

This is the feature Pydantic AI is named for and built around: you declare a Pydantic model as your agent's output type, and you get back a validated instance of it — not a string to parse, not JSON to hope about, but a real typed object. It turns the single most brittle part of LLM applications into the most reliable.

This is the feature Pydantic AI is named for: you declare a Pydantic model as your agent's output type and get back a validated instance — not a string to parse. It turns the most brittle part of LLM applications into the most reliable.

Pratik Dhanave · ·4 min read

Crews and Process

Agents and tasks are the pieces; the crew is what assembles them into a working team, and its process — sequential or hierarchical — decides whether they run like an assembly line or a delegating manager.

The crew assembles agents and tasks into a working team, and its process — sequential or hierarchical — decides whether they run like an assembly line or a delegating manager.

Pratik Dhanave · ·5 min read

Self-Play and Co-Evolution

The technique that produced superhuman game-playing — a system improving by competing against copies of itself — has an LLM analogue: models that generate their own training signal and bootstrap their way up without new human labels.

The technique that produced superhuman game-playing has an LLM analogue: models that generate their own training signal and bootstrap up without new human labels — and the reward-source problem at its center.

Pratik Dhanave · ·5 min read

Self-Correcting Retrieval

Naive RAG trusts whatever it retrieved, which is how it produces confident answers grounded in the wrong documents; self-correcting retrieval adds the step it was missing — checking the results before using them.

Naive RAG trusts whatever it retrieved, which is how it produces confident answers grounded in the wrong documents. Self-correcting retrieval adds the missing step: check the results before using them.

Pratik Dhanave · ·5 min read

Tools and Structured Context

Tool definitions and structured data quietly consume a large share of the context budget, and how you select, describe, and format them shapes both what fits and how well the model uses it.

Tool definitions and structured data quietly consume a large share of the context budget, and how you select, describe, and format them shapes both what fits and how well the model uses it.

Pratik Dhanave · ·5 min read

Streaming and Push Notifications

Long-running agent work needs a way to report progress without the client holding its breath, and A2A offers two: stream the updates live, or register a webhook and get called back.

Long-running agent work needs a way to report progress without the client holding its breath. A2A offers two: stream the updates live over SSE, or register a webhook and get called back.

Pratik Dhanave · ·5 min read

Building an MCP Client

A server is only half the story; the client is what connects to it, discovers its capabilities, and turns a model's intent into real tool calls.

Build an MCP client that launches a server, discovers its tools, and drives them from a language model — the core of what every MCP host does internally.

Pratik Dhanave · ·5 min read

Evaluating Evolution — and Keeping It Safe

A system that changes itself can improve itself right off a cliff, so the evaluation and guardrails are not an afterthought to self-evolving agents — they are the thing that makes them safe to run at all.

A system that changes itself can improve right off a cliff. Measuring evolution honestly, reward hacking, drift and collapse, and the guardrails that keep it safe.

Pratik Dhanave · ·6 min read

What Is smolagents?

Most agent frameworks have the model call tools by emitting JSON. smolagents, Hugging Face's deliberately tiny library, makes the model write Python code instead — "agents that think in code." That one design choice, plus a ruthless commitment to minimalism, is what the whole library is about, and it turns out to matter more than it sounds.

Most agent frameworks have the model call tools by emitting JSON. smolagents, Hugging Face's deliberately tiny library, makes the model write Python code instead — 'agents that think in code.' That one choice, plus ruthless minimalism, is the whole library.

Pratik Dhanave · ·6 min read

What Is Strands Agents?

Most agent frameworks ask you to design the workflow — the steps, the branches, the orchestration. Strands Agents, AWS's open-source SDK, makes the opposite bet: give the model a goal and tools, and let it drive. That model-driven philosophy is the whole point, and understanding it is understanding why Strands feels different from everything else.

Most agent frameworks ask you to design the workflow. Strands Agents, AWS's open-source SDK, makes the opposite bet: give the model a goal and tools, and let it drive. That model-driven philosophy is the whole point.

Pratik Dhanave · ·6 min read

Agents

The Agent is where everything in Pydantic AI comes together — model, instructions, tools, typed dependencies, and typed output, bundled into one reusable, testable object you define once and run many times. Understanding the Agent as a configured, type-parameterized unit is the key that makes the rest of the framework fall into place.

The Agent is where everything in Pydantic AI comes together — model, instructions, tools, typed dependencies, and typed output, bundled into one reusable, testable object you define once and run many times.

Pratik Dhanave · ·4 min read

Tasks: Describing the Work

An agent is a capability; a task is the assignment — and the two fields that define a task, its description and its expected output, are where you turn "a smart agent" into "the specific result I need."

An agent is a capability; a task is the assignment — and the two fields that define a task, its description and its expected output, are where you turn 'a smart agent' into 'the specific result I need.'

Pratik Dhanave · ·4 min read

Choosing an Agent Framework: MAF vs LangGraph vs ADK vs CrewAI

Four popular agent frameworks, four genuinely different philosophies — and the right choice is decided less by features than by how much control you want, how your team thinks, and what you're actually building.

Four popular agent frameworks, four genuinely different philosophies — the right choice is decided less by features than by how much control you want, how your team thinks, and what you're building.

Pratik Dhanave · ·5 min read

Evolutionary and Population Search

Borrow the oldest idea in optimization — mutate a population, select the fittest, repeat — and point it at prompts and agents, and you get a search that escapes local optima a gradient never could.

Borrow the oldest idea in optimization — mutate a population, select the fittest, repeat — point it at prompts and agents, and you get a search that escapes local optima a gradient never could.

Pratik Dhanave · ·5 min read

Routing and Retrieval as a Tool

Real systems have more than one place to look, and the answer to "not everything should be retrieved from the same index — or retrieved at all" is to route queries and to treat retrieval as a tool the agent chooses to call.

Real systems have more than one place to look. The answer is to route queries to the right source — and to treat retrieval as a tool the agent chooses to call, or skips entirely.

Pratik Dhanave · ·5 min read

Memory and Conversation History

A conversation that never forgets eventually overflows, so managing what history an agent carries forward — and how it remembers across sessions — is one of the defining problems of context engineering.

A conversation that never forgets eventually overflows, so managing what history an agent carries forward — and how it remembers across sessions — is a defining problem of context engineering.

Pratik Dhanave · ·5 min read

A2A Transports and Core Methods

A2A defines what agents exchange independently of how it travels, so the same operations work over JSON-RPC, gRPC, or plain REST — and the operation set is small enough to hold in your head.

A2A defines what agents exchange independently of how it travels, so the same operations work over JSON-RPC, gRPC, or plain REST — and the operation set is small enough to hold in your head.

Pratik Dhanave · ·5 min read

Building an MCP Server from Scratch

Everything in the series so far comes together here: a small but complete Model Context Protocol server, in Python, exposing a tool, a resource, and a prompt, runnable and testable in minutes.

Build a complete MCP server in Python with the official SDK — a notes service with a tool, a resource, and a prompt — and test it end to end with the MCP Inspector.

Pratik Dhanave · ·5 min read

What Is Pydantic AI?

Most agent frameworks treat the LLM's output as text you hope to parse. Pydantic AI treats it as typed, validated data — bringing the discipline that made Pydantic the backbone of Python data validation to the messy world of LLM agents. If you've ever wished your agent's output was a real typed object instead of a string you cross your fingers over, this framework was built for you.

Most agent frameworks treat the LLM's output as text you hope to parse. Pydantic AI treats it as typed, validated data — bringing the discipline that made Pydantic the backbone of Python data validation to the messy world of LLM agents.

Pratik Dhanave · ·5 min read

Agents: Role, Goal, and Backstory

A CrewAI agent is defined less by code than by three sentences — its role, goal, and backstory — and getting those right is the highest-leverage thing you do, because they are the prompt that shapes everything the agent does.

A CrewAI agent is defined less by code than by three sentences — its role, goal, and backstory — and getting those right is the highest-leverage thing you do, because they are the prompt that shapes everything the agent does.

Pratik Dhanave · ·5 min read

Automated Design of Agentic Systems

The most striking frontier result is a meta-agent that writes agents — defining them as code, testing them, archiving the good ones, and inventing architectures that outperform the best humans hand-built.

The most striking frontier result is a meta-agent that writes agents — defining them as code, testing them, archiving the good ones, and inventing architectures that outperform the best humans hand-built.

Pratik Dhanave · ·5 min read

Modules: Strategies for Calling a Model

If a signature says what a step does, a module says how to get the model to do it — and because modules are parameterized, swapping one for another changes the reasoning strategy without touching your intent.

If a signature says what a step does, a module says how to get the model to do it — Predict, ChainOfThought, ReAct — and because modules are parameterized, swapping one changes the strategy without touching your intent.

Pratik Dhanave · ·5 min read

Query Transformation

The user's question is written to be asked, not to be searched, so the first thing an agentic RAG system should do is turn that question into queries that actually retrieve well.

The user's question is written to be asked, not searched, so the first thing an agentic RAG system should do is turn that question into queries that actually retrieve well.

Pratik Dhanave · ·4 min read

Messages, Parts, and Artifacts

Agents need to exchange more than plain strings — instructions, files, images, structured data, and finished deliverables — and A2A's content model handles all of it with three composable objects.

Agents exchange more than plain strings — instructions, files, images, structured data, and finished deliverables. A2A's content model handles all of it with three composable objects.

Pratik Dhanave · ·5 min read

Self-Critique and Its Limits

Asking a model to check its own work sounds like free improvement, but whether it actually helps depends entirely on where the feedback comes from — and getting this wrong is the most common way self-evolving agents fool themselves.

Self-critique is tempting but dangerous: without a real external signal, models often fail to self-correct and can get worse. Where self-critique works and where it drifts.

Pratik Dhanave · ·5 min read

What Is CrewAI?

CrewAI takes the most intuitive metaphor for multi-agent AI — a team of specialists with roles collaborating on a job — and makes it the programming model, which is both its great strength and the thing to be disciplined about.

CrewAI takes the most intuitive metaphor for multi-agent AI — a team of specialists with roles collaborating on a job — and makes it the programming model, which is both its strength and the thing to be disciplined about.

Pratik Dhanave · ·5 min read

Beyond Reflection: The Design Axis

The first wave of self-evolving agents tuned one agent's memory and prompts; the frontier stops tuning a fixed agent and starts searching the space of agent designs itself.

The first wave of self-evolving agents tuned one agent's memory and prompts; the frontier stops tuning a fixed agent and starts searching the space of agent designs itself.

Pratik Dhanave · ·5 min read

What Is Agentic RAG?

Agentic RAG is what you get when retrieval stops being a fixed pipeline step and becomes a set of decisions an agent reasons through — whether to retrieve, what to search for, from where, how many times, and whether to trust the result.

Agentic RAG is what you get when retrieval stops being a fixed pipeline step and becomes a set of decisions an agent reasons through — whether, what, from where, how many times, and whether to trust results.

Pratik Dhanave · ·5 min read

Model Selection and Routing

The single biggest cost lever in most AI systems is not clever prompting — it is not using an expensive model for work a cheap one would do just as well.

The single biggest cost lever in most AI systems is not clever prompting — it is not using an expensive model for work a cheap one would do just as well. Right-sizing and routing models to tasks.

Pratik Dhanave · ·5 min read

Tasks and the Task Lifecycle

Delegating real work between agents is rarely a quick round trip, so A2A makes the task a first-class object with an explicit lifecycle that survives long-running, interruptible, asynchronous collaboration.

Delegated work is rarely a quick round trip, so A2A makes the task a first-class object with an explicit lifecycle that survives long-running, interruptible, asynchronous collaboration.

Pratik Dhanave · ·6 min read

MCP Tools: Giving Agents the Power to Act

Tools are the part of the Model Context Protocol that lets a model do things instead of just talk about them, and their design is what separates an agent that helps from one that flails.

Tools are the MCP primitive that lets a model act. How to define them, the tools/list and tools/call methods, results versus errors, and designing tools a model can actually use.

Pratik Dhanave · ·6 min read

Claude Code in Production Workflows

Beyond the interactive terminal, Claude Code can run headless in scripts and CI — which unlocks automation, and raises the stakes on permissions, review, and trust.

The capstone: running Claude Code headless in scripts and CI (PR review, batch ops, scheduled jobs) — and the guardrails it demands: least privilege, sandboxing, gating the produced artifact with human review, and the series' layered recap.

Pratik Dhanave · ·5 min read

Building the System: Compose Before You Train

Modern production AI is rarely "a model" — it is a foundation model wrapped in retrieval, context engineering, tools, and guardrails — and the biggest architectural mistake is reaching for fine-tuning before exhausting the cheaper, more reversible options.

Production AI is rarely a model — it's a composed system, and the biggest mistake is fine-tuning before exhausting cheaper, reversible options. Phase 3: compose before you train.

Pratik Dhanave · ·5 min read

Why Naive RAG Falls Short

The retrieve-then-generate pipeline that launched a thousand demos hits a wall on real questions, and understanding exactly where it breaks is the case for making retrieval agentic.

The retrieve-then-generate pipeline that launched a thousand demos hits a wall on real questions. Understanding exactly where naive RAG breaks is the case for making retrieval agentic.

Pratik Dhanave · ·5 min read

Agent Cards and Discovery

Before one agent can delegate to another it has to find it and understand what it can do, and in A2A that self-description is a single structured document called the Agent Card.

Before one agent can delegate to another it must find it and understand it. In A2A that self-description is a single structured document — the Agent Card.

Pratik Dhanave · ·6 min read

Skills and Slash Commands

Slash commands and skills turn a workflow you keep re-explaining into something you invoke by name — packaging repeatable expertise so you (and your team) don't prompt it from scratch every time.

Packaging repeatable workflows: custom slash commands for frequent explicit tasks, and skills — self-contained procedures the agent loads when relevant — turning tribal knowledge into invokable, versioned team assets. Matching the mechanism to frequency.

Pratik Dhanave · ·5 min read

What Is the Agent2Agent Protocol?

Tools are one half of an agent's world and other agents are the other half, and A2A is the open standard that lets agents built by different teams, in different frameworks, discover and delegate to each other as peers.

A2A is the open standard that lets agents built by different teams, in different frameworks, discover and delegate to each other as peers — the agent-to-agent complement to MCP's agent-to-tools.

Pratik Dhanave · ·6 min read

Hooks and Automation

Hooks turn "please always run the formatter" from a hope into a guarantee — deterministic shell commands that fire on Claude Code's lifecycle events, no matter what the model decides.

Hooks are shell commands that fire deterministically on lifecycle events — auto-format on edit, block edits to protected paths, run checks, notify. When to use a hook (guarantee) vs CLAUDE.md (influence) vs permissions (gate), and keeping them safe.

Pratik Dhanave · ·6 min read

What Is the Model Context Protocol?

A model is only as useful as the context and tools it can reach, and MCP is the open standard that lets any AI app plug into any tool through one interface instead of a hundred bespoke integrations.

MCP turns the M×N mess of wiring every AI app to every tool into M+N: wrap each system as a server once, make each app a client once, and any app can use any system.

Pratik Dhanave · ·6 min read

What Are Self-Evolving Agents?

Most agents are frozen the moment they ship, repeating the same mistakes forever, and self-evolving agents are the attempt to break that ceiling by letting the system improve itself as it runs.

Most agents are frozen at deployment and repeat their mistakes forever. Self-evolving agents route their own experience back into their own behavior — here are the axes of change and the loop underneath them.

Pratik Dhanave · ·5 min read

Subagents and Parallel Work

Subagents let Claude Code delegate a focused task to a separate agent with its own context — keeping the main conversation clean and letting independent work run in parallel.

Subagents delegate a focused task to a separate agent with its own context — for context isolation and parallelism. When to delegate (independent, context-heavy, specialized), defined agent types, and keeping the main session as accountable orchestrator.

Pratik Dhanave · ·13 min read

Red-Teaming Agents and RAG Systems

Why agents and retrieval turn a prompt injection into real-world action, how to red-team the highest-risk AI surface with benign canaries, and the least-privilege controls that shrink an attacker's blast radius.

The highest-risk modern surface: indirect injection via RAG/tools, tool abuse and excessive-agency exploitation, memory poisoning, multi-step attacks, and data-exfiltration channels — with a canary methodology and least privilege as the primary control.

Pratik Dhanave · ·6 min read

MCP: Connecting Claude Code to Your Tools

The Model Context Protocol lets Claude Code reach beyond your codebase — into your databases, issue trackers, docs, and services — through a standard, pluggable interface.

The Model Context Protocol lets Claude Code reach beyond the codebase into databases, trackers, docs, and services through a standard interface — what MCP is, how to connect servers, and treating each server as a least-privilege trust decision.

Pratik Dhanave · ·12 min read

Insecure Output Handling and Excessive Agency

Two tightly-linked OWASP LLM risks that turn a clever prompt injection into real-world damage — and the Python patterns that shrink the blast radius: treat model output as untrusted input, and give agents the least agency they can get away with.

Two OWASP risks that turn an injection into damage: insecure output handling (model output is untrusted input — never eval/shell/SQL it unescaped) and excessive agency (least-privilege tools, allow-lists, human approval for irreversible actions, audit logs).

Pratik Dhanave · ·13 min read

Bedrock Agents

How to invoke a managed Agent for Amazon Bedrock from Go — where the server owns the reason-act loop, and your job is to call InvokeAgent, range the event stream, accumulate the answer chunks, and read the trace for observability.

Agents for Amazon Bedrock from Go: the managed reason-act loop that runs server-side (vs the DIY Converse loop), invoking an agent alias with InvokeAgent, streaming the response and trace events, and keeping multi-turn state with a SessionId.

Pratik Dhanave · ·11 min read

Evaluating Multi-Turn and Multi-Agent Systems

The capstone of the Evaluating Agents in Go series: how to score a conversation instead of a single reply, how to attribute errors across a coordinator and its sub-agents, and how to build rubric, safety, and hallucination judges in Go when the framework hands you no eval package.

The capstone of the Evaluating Agents in Go series: how to score a conversation instead of a single reply, how to attribute errors across a coordinator and its sub-agents, and how to build rubric, safety,...

Pratik Dhanave · ·6 min read

CLAUDE.md and Project Configuration

The single highest-leverage setup step for Claude Code is a good CLAUDE.md — the file where you write down, once, the context and conventions you'd otherwise repeat every session.

The highest-leverage setup step: a good CLAUDE.md that gives durable project context (build/test commands, conventions, gotchas, what not to do), how it layers, and the settings/permissions that tune autonomy safely and shareably.

Pratik Dhanave · ·13 min read

Agent Evaluation in CI: Regression Gating

How to wire agent evaluations into continuous integration in Go — running a slow, model-calling eval harness under `go test`, setting per-metric thresholds that fail the build on a regression, and living honestly with the fact that these gates are softer than unit tests.

How to wire agent evaluations into continuous integration in Go — running a slow, model-calling eval harness under `go test`, setting per-metric thresholds that fail the build on a regression, and living...

Pratik Dhanave · ·6 min read

The Core Workflow

Getting great results from Claude Code is less about clever prompts and more about a disciplined loop: give context, specify clearly, let it work, review, and steer.

The disciplined loop that gets great results: explore → plan → execute → review, specifying like you'd brief a colleague, steering actively, managing context, and right-sizing delegation to the checks (tests) the agent can loop against.

Pratik Dhanave · ·15 min read

Agent Memory and Planning

Give the hand-rolled Go agent from post 11 a memory it can carry between turns and a plan it can follow across many steps — a compacting conversation buffer, retrieval over the post-8 vector store, and a plan-then-execute-then-reflect loop, all built from scratch.

Give the agent memory and planning in Go: a compacting short-term conversation buffer, long-term memory as timestamped embeddings in the vector store, and planning — plan-then-execute, reflection and re-planning when observations contradict the plan, and task decomposition.

Pratik Dhanave · ·11 min read

Building Eval Datasets from Real Traces

Where good eval cases actually come from — seeding by hand, harvesting from production telemetry, and curating a golden dataset in Go that doesn't rot the moment your prompt changes.

Where good eval cases actually come from — seeding by hand, harvesting from production telemetry, and curating a golden dataset in Go that doesn't rot the moment your prompt changes.

Pratik Dhanave · ·6 min read

What Claude Code Is

An agentic coding tool that lives in your terminal, reads and edits your real codebase, runs commands, and works through multi-step tasks — not an autocomplete, but a collaborator you delegate to.

The opener to a Claude Code series: what an agentic, terminal-native coding tool actually is — it takes a goal and executes multi-step work on your real codebase, with permissions keeping you in control — and the mental model that makes it click.

Pratik Dhanave · ·14 min read

Agents from Scratch

Building a real agent loop in Go by hand — an LLM in a loop that picks tools, runs them, reads the results, and repeats until the task is done — so you can see there is no magic behind LangGraph, MAF, or ADK.

Build a minimal but real agent loop in Go by hand: an Agent with a tool registry and a reason-act Run loop, an iteration budget, validation against hallucinated tools, feeding tool errors back as observations, and parallel tool calls — the loop frameworks formalize, demystified.

Pratik Dhanave · ·13 min read

Response Evaluation: Match, ROUGE, and LLM-as-Judge

How to score an agent's final answer against a reference — from exact string match, through ROUGE-1 unigram overlap, to an LLM judge — with original Go you can drop into a test suite. Part 5 of Evaluating Agents in Go.

How to score an agent's final answer against a reference — from exact string match, through ROUGE-1 unigram overlap, to an LLM judge — with original Go you can drop into a test suite. Part 5 of Evaluating...

Pratik Dhanave · ·10 min read

Getting Started with Microsoft Agent Framework (Python)

From the smallest possible agent to a browsable service — the core loop, the four ways to run it, how memory and tools attach, and two ways to put a server in front of it.

From the smallest possible agent to a browsable service — the core loop, the four ways to run it, how memory and tools attach, and two ways to put a server in front of it.

Pratik Dhanave · ·11 min read

Memory, Context & Session State in Microsoft Agent Framework (Python)

A complete guide to what an agent remembers — from a single conversation held in a session, to durable facts injected on every run, to the per-request values that reach a tool without ever touching the model's schema.

A complete guide to what an agent remembers — from a single conversation held in a session, to durable facts injected on every run, to the per-request values that reach a tool without ever...

Pratik Dhanave · ·13 min read

Building Workflows in Microsoft Agent Framework (Python): The Core Model

From a single decorated async function to an explicit graph of executors and agent nodes — the core workflow model in Microsoft Agent Framework, and the two APIs that express it.

From a single decorated async function to an explicit graph of executors and agent nodes — the core workflow model in Microsoft Agent Framework, and the two APIs that express it.

Pratik Dhanave · ·14 min read

Advanced Workflows in Microsoft Agent Framework (Python)

Once you can wire a chain of executors, the graph earns its keep: concurrency, durable state, composition, and control — the patterns that turn a toy pipeline into a system that survives a crash.

Once you can wire a chain of executors, the graph earns its keep: concurrency, durable state, composition, and control — the patterns that turn a toy pipeline into a system that survives a crash.

Pratik Dhanave · ·8 min read

Human-in-the-Loop & Workflow Observability in Microsoft Agent Framework (Python)

How to pause a workflow for a human decision, package a whole workflow as an agent, and see exactly what a run did — through OpenTelemetry spans and a rendered graph — in Microsoft Agent Framework.

How to pause a workflow for a human decision, package a whole workflow as an agent, and see exactly what a run did — through OpenTelemetry spans and a rendered graph — in Microsoft Agent Framework.

Pratik Dhanave · ·11 min read

Multi-Agent Orchestration in Microsoft Agent Framework (Python)

A complete guide to coordinating many agents — from a fixed pipeline, to parallel fan-out, to a self-routing mesh, to a planner that decides who acts next, to publishing an agent as a network service other agents can call.

A complete guide to coordinating many agents — from a fixed pipeline, to parallel fan-out, to a self-routing mesh, to a planner that decides who acts next, to publishing an agent as a network...

Pratik Dhanave · ·9 min read

Models, Providers & Endpoints in Microsoft Agent Framework (Python)

A complete guide to where a Microsoft Agent Framework agent gets its model — from direct Foundry inference to OpenAI-compatible endpoints, service-managed agents, hand-rolled providers, and container hosting.

A complete guide to where a Microsoft Agent Framework agent gets its model — from direct Foundry inference to OpenAI-compatible endpoints, service-managed agents, hand-rolled providers, and...

Pratik Dhanave · ·10 min read

Advanced I/O, RAG & Evaluation in Microsoft Agent Framework (Python)

Once an agent can call tools, the next questions are what it can read, what it returns, how long it can run, where its facts come from, how it's defined, and whether it actually works — this guide answers all seven.

Once an agent can call tools, the next questions are what it can read, what it returns, how long it can run, where its facts come from, how it's defined, and whether it actually works — this guide...

Pratik Dhanave · ·8 min read

DevUI & Durable Agents in Microsoft Agent Framework (Python)

A guide to the two hosting concerns every agent eventually hits — seeing it run in a local chat window with a live call inspector, and keeping its state alive across crashes on Durable Task infrastructure.

A guide to the two hosting concerns every agent eventually hits — seeing it run in a local chat window with a live call inspector, and keeping its state alive across crashes on Durable Task...

Pratik Dhanave · ·13 min read

Trajectory Evaluation in Go

How to score what an agent did, not just what it said — building trajectory metrics in Go from an exact-match baseline up to arg-aware, order-tolerant scoring, with a readable diff of expected vs. actual.

How to score what an agent *did*, not just what it *said* — building trajectory metrics in Go from an exact-match baseline up to arg-aware, order-tolerant scoring, with a human-readable diff of expected vs....

Pratik Dhanave · ·13 min read

Building an Evaluation Harness in Go

The core of the series: a minimal, original evaluation harness in Go. Run an agent under test through adk-go's runner, capture the tool-call trajectory and the final response behind an adapter you own, and score them with `go test`.

The core of the series: a minimal, original evaluation harness in Go. Run an agent under test through adk-go's runner, capture the tool-call trajectory and the final response behind an adapter you own, and...

Pratik Dhanave · ·11 min read

The ADK Evaluation Model

Before you can evaluate an agent in Go, you need a mental model of what "evaluating an agent" even means. This post unpacks the conceptual core of Google's Agent Development Kit eval framework — cases, trajectories, metrics, thresholds — the parts that are language-agnostic, so the rest of this series can implement them as plain Go types and functions.

Before you can evaluate an agent in Go, you need a mental model of what "evaluating an agent" even means. This post unpacks the conceptual core of Google's Agent Development Kit eval framework — cases,...

Pratik Dhanave · ·10 min read

Tools in Microsoft Agent Framework (Python): Functions, Hosted Tools, MCP, Skills & CodeAct

A complete guide to giving a Microsoft Agent Framework agent the ability to act — from a plain Python function the model can call, to provider-hosted sandboxes, remote MCP servers, and higher-level packaging patterns like Skills and CodeAct.

A complete guide to giving a Microsoft Agent Framework agent the ability to act: function tools, provider-hosted tools (code interpreter, file search, web search), local and hosted MCP, plus Skills and CodeAct — with the code and gotchas for each.

Pratik Dhanave · ·10 min read

Why Evaluating AI Agents Is Hard

The opener to a series on evaluating agents in Go: why an agent isn't a function you can unit-test, why "it worked in the demo" doesn't survive contact with production, and the two things actually worth measuring — the steps it took and the answer it gave.

The opener to a series on evaluating agents in Go: why an agent isn't a function you can unit-test, why "it worked in the demo" doesn't survive contact with production, and the two things actually worth...

Pratik Dhanave · ·6 min read

Churn Prediction and Autonomous Retention Agents

Predicting who will leave is the easy half. The hard half is acting on it: treating the persuadable, respecting a budget, and proving the intervention actually kept anyone.

Predicting attrition and acting on it: churn features and labels, uplift vs propensity (treat the persuadable), and an agentic retention workflow that recommends and executes interventions with guardrails and holdout mea…

Pratik Dhanave · ·6 min read

Mandates and Verifiable Credentials: Proving an Agent Was Authorized

When an AI agent spends your money, "the user said so" is not evidence. A signed mandate chain is.

A deep dive on the mandate chain as evidence: verifiable credentials (VCs), signing, the non-repudiable Intent→Cart→Payment chain, revocation and expiry, and why this replaces 'trust me, the user said so' with cryptograp…

Pratik Dhanave · ·6 min read

LLM-Guided Portfolio Allocation

A hybrid allocator where a quantitative core owns the money, a language model only whispers tilts, and hard constraints plus a human bound everything before a single order goes out.

A hybrid allocator: quantitative signals set the baseline (mean-variance / risk parity) while an LLM proposes tilts from qualitative context, constrained by risk limits and human review.

Pratik Dhanave · ·7 min read

Human-in-the-Loop: An Approval Gate on Durable State

Lesson 7 of Harness Engineering in Go — a sensitive action pauses for a human decision, and the whole suspension is nothing more than a Lesson 2 checkpoint marked awaiting_approval.

Series finale, Lesson 7: a sensitive action pauses for human approval, where suspension is just a Lesson 2 checkpoint marked awaiting_approval, the deadline is checked first so a late yes is void, and the action must be idempotent.

Pratik Dhanave · ·7 min read

Hierarchical Supervision: Bounded Fan-Out, Ordered Fan-In, Fault Isolation

Lesson 6 of Harness Engineering in Go — a supervisor splits a task, fans out to concurrent workers behind a semaphore, and fans the results back in decomposition order, with each worker's failure (or panic) isolated to one result.

Lesson 6: bounded fan-out behind a semaphore, ordered fan-in via a pre-sized results slice, and per-worker fault isolation so one sub-agent panicking becomes one failed result instead of crashing the whole run.

Pratik Dhanave · ·7 min read

Generative AI and LLMs in Finance: Patterns and Guardrails

Large language models earn their place in regulated finance as fast, well-supervised assistants — not as autonomous agents with a hand on the money.

Where LLMs fit in regulated finance: document analysis/extraction, retrieval-grounded Q&A, and agentic decision support — plus the guardrails (grounding, human-in-the-loop, output validation, audit trails) that keep them…

Pratik Dhanave · ·7 min read

Orchestration and Handoff: Routing Intent to a Specialist

Lesson 5 of Harness Engineering in Go — a triage step that first-matches a keyword and hands the request to a specialist, and the exact place a substring table stops being able to think.

Lesson 5: a triage router first-matches a keyword to hand intent to a specialist, and the exact point a substring table stops being able to think.

Pratik Dhanave · ·6 min read

Advanced Memory: Threads, Keyword Retrieval, and Lossy Summarization

Lesson 4 of Harness Engineering in Go — three collaborating stores (a thread, a knowledge index, and a summarizer) behind interfaces, and an honest accounting of where each local stand-in leaks.

Lesson 4: memory is three stores, not one — an append-only thread, a keyword knowledge index, and a lossy first-and-last summarizer — and an honest account of where each local stand-in leaks against Azure.

Pratik Dhanave · ·10 min read

Google ADK Glossary: Every Core Concept in One Place

The reference capstone for the 26-part series — every canonical ADK term, defined concisely.

The capstone of the series: every core ADK concept defined in one place — agents and orchestration, tools, sessions/state/memory, context and callbacks, runtime and streaming, models, grounding, evaluation, protocols, and deployment.

Pratik Dhanave · ·7 min read

Secure Sandboxing: Running Agent-Written Code Behind a Timeout

Lesson 3 of Harness Engineering in Go — how a context deadline and `exec.CommandContext` reap a runaway snippet, why the two-shaped `Result` distinguishes a timeout from a failure, and the leak that makes a local subprocess a teaching tool, not a security boundary.

Lesson 3: run agent-written code behind a hard timeout with exec.CommandContext, distinguish OK from TimedOut, and face the leak — a subprocess is not a security boundary.

Pratik Dhanave · ·5 min read

Agent Config: Defining an ADK Agent in YAML, No Code Required

How ADK's config loader turns a declarative YAML file into a fully-built agent — and why treating an agent as data changes who gets to edit it.

Defining an agent declaratively in YAML and loading it via from_config — the loader reads, resolves, and validates the config into a built agent, so config-as-data works without writing code.

Pratik Dhanave · ·9 min read

Durable Execution: Checkpoint Every Step, Resume After a Crash

Lesson 2 of Harness Engineering in Go — a workflow that saves its progress after each step and picks up exactly where it died, proven by a test that kills a real subprocess mid-run.

Lesson 2: a workflow that checkpoints after every step and resumes from the last one after a crash, why at-least-once execution forces idempotent steps, and the atomic-rename store that survives a killed process.

Pratik Dhanave · ·5 min read

Context Caching in ADK: Stop Paying for the Same Tokens Every Turn

How caching a large, stable prompt prefix cuts latency and cost — and the ADK config that decides when it pays off.

Context caching cuts latency and cost by caching large, stable context — system prompt, reference docs, tool definitions — so repeated calls don't re-send and re-process the same tokens.

Pratik Dhanave · ·7 min read

The Agent Harness: guardrails as middleware around the model

Lesson 1 of Harness Engineering in Go — why the input guardrail is a hard block, not a warning, and how a plain `net/http` handler wraps the model call so it tests without a running server.

Lesson 1: why the input guardrail is a hard block rather than flag-and-pass, why it counts runes instead of bytes, and how a plain net/http handler wraps the (stubbed) model call so it tests with httptest.

Pratik Dhanave · ·5 min read

Planners & Thinking: Making an ADK Agent Reason Before It Acts

Post 23 of 26 in "Google ADK, Concept by Concept" — how a planner turns one-shot answers into inspectable plan-then-act reasoning.

Structuring an agent's reasoning: planners that make the model plan-then-act (ReAct-style), the built-in thinking feature, and how a planner improves multi-step tool use over naive prompting.

Pratik Dhanave · ·6 min read

Human-in-the-Loop, Tools, and the Send API

The higher-level building blocks LangGraph stacks on top of the graph engine — pausing for a human, running an agent loop, calling tools, and fanning out dynamically.

The building blocks on top of the core graph: interrupt() to pause for human input, create_react_agent and ToolNode for tool-using agents, and the Send API for dynamic parallel fan-out with a reducer fan-in.

Pratik Dhanave · ·6 min read

Harness Engineering in Go: build the harness, then let Azure supply it

Seven patterns that turn a bare model call into production agent infrastructure — each written first as offline Go behind an interface, so the leap to Azure is a swap, not a rewrite.

Seven patterns that turn a bare model call into production agent infrastructure, each written first as offline Go behind an interface (the seam) so the leap to Azure is a swap, not a rewrite.

Pratik Dhanave · ·6 min read

Command: Update State and Pick the Next Node in One Return

How a single `Command` object folds a state update and a routing decision together — and the tiny lowering that makes `goto` just another guarded edge.

Command lets a node return a state update and a goto in one object, moving the routing decision inside the node. It is the cleanest way to express supervisor handoffs and dynamic control flow.

Pratik Dhanave · ·3 min read

Advanced Workflows — Microsoft Agent Framework in Go

Durable workflows in Go: checkpoint and rehydrate, pause on a RequestPort for a human, nest sub-workflows, and coordinate through scoped shared state.

Durable Microsoft Agent Framework workflows in Go: checkpoint and rehydrate a fresh graph, pause on a RequestPort for a human, nest sub-workflows, and coordinate via scoped shared state.

Pratik Dhanave · ·6 min read

Cycles and the Agent Loop: Branch, Act, Loop Back

The single most important pattern in LangGraph — a branch plus a back-edge, and the `recursion_limit` that keeps it from running forever.

Branching plus a back-edge is a cycle, and that cycle IS the agent loop: model proposes tool calls, tools run, control returns to the model, repeat until done. Plus recursion_limit, the guardrail that stops a runaway loop.

Pratik Dhanave · ·3 min read

Orchestration Patterns — Microsoft Agent Framework in Go

The prebuilt orchestration builders in agent-framework-go — Sequential, Concurrent, Group Chat — plus wrapping a whole workflow as one agent.

The Sequential, Concurrent, and Group Chat orchestration builders in agent-framework-go, plus wrapping a whole workflow as one nestable agent.

Pratik Dhanave · ·6 min read

Grounding & RAG in ADK: Answers Anchored in Real Data

Post 18 of 26 in "Google ADK, Concept by Concept" — retrieval tools, grounding metadata, rendering citations, and the retrieve→augment→generate loop.

Grounding answers in real data: retrieval tools, grounding metadata returned with responses, rendering citations from that metadata, and the retrieve-augment-generate RAG pattern in ADK.

Pratik Dhanave · ·2 min read

Capstone · DocQA — answer questions about your own documents

The final lesson ties the whole Go tutorial into one small product: an assistant that answers questions about your docs — grounded, cited, and refusing to guess.

The capstone: a grounded DocQA agent that answers only from embedded docs via a search_docs tool, cites sources, and refuses to guess — with an optional reviewer.

Pratik Dhanave · ·3 min read

Workflow Mechanics — Microsoft Agent Framework in Go

The graph model underneath every multi-agent app: executors as nodes, edges as data flow, and typed events streaming out of `WatchStream` as it runs.

The Microsoft Agent Framework workflow model in Go: executors bound to IDs, AddEdge wiring, WithOutputFrom, and typed WatchStream events - plus an upstream route-builder fix.

Pratik Dhanave · ·3 min read

Observability, Safety, and Providers — Microsoft Agent Framework in Go

Wrap every run in an OpenTelemetry span, gate risky tool actions behind a permission handler, and swap model providers behind one agent.Agent.

Wrap every Microsoft Agent Framework run in an OpenTelemetry span, gate risky tool actions behind a permission handler, and swap Anthropic, OpenAI, Gemini, Copilot, and Azure behind one agent.

Pratik Dhanave · ·5 min read

Observability in ADK: Seeing Inside a Running Agent

How OpenTelemetry traces, structured logs, and token metrics turn an agent's event stream into something you can debug in production.

Seeing inside a running agent: OpenTelemetry tracing with spans for agent, model, and tool steps, structured logging, and exporting traces to debug latency and tool-call trajectories.

Pratik Dhanave · ·5 min read

State, Channels, and Reducers: How LangGraph Merges Updates

The one idea that makes everything else in LangGraph click: nodes don't pass messages, they update a shared state — and reducers decide how.

State is a typed dict of channels; each channel has an optional reducer. No reducer overwrites; a reducer (like add_messages or operator.add) combines. This is the single idea the rest of LangGraph is built on.

Pratik Dhanave · ·6 min read

Deploying an ADK Agent: One Command to Cloud Run and Agent Engine

How `adk deploy` builds, pushes, and ships an agent in a single step — and the ack-after-invocation rule that keeps event-driven agents reliable.

Deploying an agent: adk deploy with its cloud_run and agent_engine subcommands, containerizing the app, and reliability rules like ack-after-invocation so failures are redelivered, not dropped.

Pratik Dhanave · ·6 min read

LangGraph Is a Pregel Program: Shared State vs Message Passing

The foundational mental model — why "the graph" is a Pregel program, and how shared state differs from message passing.

LangGraph is shared-state, not message-passing, and both models descend from Google's Pregel/BSP: work advances in supersteps that end at a synchronization barrier. Get this mental model first and the whole API stops being magic.

Pratik Dhanave · ·3 min read

Conversation and Memory — Microsoft Agent Framework in Go

A Session threads history into each run; a ContextProvider carries memory across sessions — and because a Session is JSON, both survive a process restart.

A Session threads history into each run and a ContextProvider carries memory across sessions. Because a Session is JSON, both survive a process restart.

Pratik Dhanave · ·5 min read

Runtime & Events in ADK: The Runner, the Invocation, and the Event Stream

How an agent actually runs — a Runner drives an invocation and hands you back a stream of events, not a single answer.

How ADK runs an agent: the Runner drives an invocation that yields a stream of Event objects — content, tool calls, state deltas, control signals. The event loop explains streaming, callbacks, and state.

Pratik Dhanave · ·5 min read

Context in ADK: The Objects Passed Into Your Tools and Callbacks

ReadonlyContext, CallbackContext, ToolContext, InvocationContext — and why the read-only vs mutable distinction is a feature, not a limitation.

The context objects ADK passes into tools and callbacks — InvocationContext, ToolContext, CallbackContext, ReadonlyContext — what each exposes and why the read-only vs mutable split matters.

Pratik Dhanave · ·3 min read

Hosting and the Capstone App — Microsoft Agent Framework in Python

Turning agents into a service you can run and expose, then a full DocQA app that ties the whole series together.

Host Microsoft Agent Framework agents with DevUI, A2A, MCP, and AG-UI, then build DocQA — a grounded, cited multi-agent app that ties the whole Python series together.

Pratik Dhanave · ·5 min read

Artifacts: Where ADK Agents Put Their Files

Session state is for small text and JSON. When your agent produces a PNG, a PDF, or a WAV, it belongs in the artifact store — binary-native, versioned, and out of the session record.

Artifacts are binary/file data agents produce or consume: ArtifactService saves and versions named artifacts, loaded and saved via context, keeping large blobs out of session state.

Pratik Dhanave · ·3 min read

Orchestration Patterns — Microsoft Agent Framework in Python

Five prebuilt multi-agent shapes — Sequential, Concurrent, Group Chat, Handoff, Magentic — and when each beats hand-wiring a graph.

Sequential, Concurrent, Group Chat, Handoff, Magentic — the five prebuilt Microsoft Agent Framework orchestrations in Python and when each beats hand-wiring a graph.

Pratik Dhanave · ·7 min read

AP2 vs ACP vs x402 vs Network Tokens: How the Approaches Compare

A clear-eyed look at trust models, who signs what, rails, credential handling, and settlement — and why these four overlap more than they compete.

A clear-eyed comparison across trust model, who signs what, payment rails supported, credential handling, settlement, and best-fit use cases.

Pratik Dhanave · ·5 min read

Sessions & State in ADK: The Memory Inside a Conversation

A `Session` is the conversation; `state` is the key-value bag agents and tools read and write — and the prefix on a key decides how long it lives.

A Session holds a conversation; state is a scoped key-value store (session/user/app/temp) read and written by tools, injected into instructions via {state} templating, and persisted by SessionService.

Pratik Dhanave · ·5 min read

Tools in ADK: Turning Functions into Agent Capabilities

How a plain function becomes a callable tool, how ToolContext reaches session state, and how long-running tools pause a run for a human.

Tools give agents capabilities: a plain function becomes a tool with its signature as the schema, plus ToolContext, built-in tools, and long-running/human-in-the-loop tools across Python and Go.

Pratik Dhanave · ·3 min read

Workflow Mechanics — Microsoft Agent Framework in Python

The graph model underneath every multi-agent app: executors as nodes, edges as data flow, and typed events streaming out as it runs.

The Microsoft Agent Framework workflow model in Python: executors as nodes, edges as data flow, switch-case routing, and typed streaming events - learned model-free.

Pratik Dhanave · ·8 min read

Building an Agent-Ready Merchant

The surface a store must expose when the buyer is an AI agent, not a browser — and why it is the fintech reliability playbook wearing a new hat.

What a store must expose to sell to agents: a machine-readable product feed/catalog, agentic checkout endpoints, acceptance of delegated payment tokens, idempotency keys for retried agent calls, webhooks for async status…

Pratik Dhanave · ·5 min read

Multi-Agent Systems in ADK: Coordinators, sub_agents, and LLM-Driven Delegation

How one agent routes work to specialists — and why the description field is the most important string you write.

Agent hierarchies and LLM-driven delegation: sub_agents, how the description field drives auto-transfer, and coordinator/dispatcher patterns — contrasted with deterministic workflow agents.

Pratik Dhanave · ·3 min read

Observability, Safety, and Providers — Microsoft Agent Framework in Python

Turn agent runs into OpenTelemetry spans, block prompt injection with information-flow control, and swap model providers behind one Agent API.

Turn Microsoft Agent Framework agent runs into OpenTelemetry spans, block prompt injection with information-flow control, and swap model providers behind one Agent API.

Pratik Dhanave · ·7 min read

"My Agent Did It": Fraud, Disputes, and Liability in Agentic Commerce

When software holds the card and clicks "buy," the old questions — was this the cardholder, did they mean to, who pays if not — all get harder to answer.

The new fraud surface: prompt injection turning a shopping agent into an attacker's buyer, hijacked delegated credentials (Visa saw ~450% more dark-web 'AI Agent' chatter in H1 2026), and disputes when an agent acted on…

Pratik Dhanave · ·7 min read

The Agentic Checkout Flow, End to End

How an AI agent turns a shopper's intent into a settled purchase, and where ACP and AP2 plug into the same eight-stage skeleton.

A complete walkthrough: product discovery via an AI surface → cart assembly → user approval/mandate → delegated payment token → merchant checkout → authorization → fulfillment → receipts/webhooks.

Pratik Dhanave · ·7 min read

Card Networks Enter Agentic Commerce: Visa Intelligent Commerce and Mastercard Agent Pay

How Visa and Mastercard are reshaping tokenization so an AI agent can pay on your behalf — with scoped credentials, agent-aware identity, and the network doing what it has always done: authenticate, authorize, tokenize.

How the card networks are adapting tokenization for agents.

Pratik Dhanave · ·2 min read

06 · Mixed Workflow — Agents *and* Executors in One Graph

This lesson teaches how deterministic function executors and agent-backed executors compose in one graph with the same `AddEdge` wiring.

One workflow that mixes deterministic executors with two Foundry agent nodes for jailbreak detection and response, joined by the same AddEdge wiring and TurnToken triggering.

Pratik Dhanave · ·2 min read

04 · Multi-Model Service (a sequential agent workflow)

This lesson teaches how to chain three role-specialised agents — researcher → fact_checker → reporter — into one sequential workflow and stream each stage.

A sequential workflow of three role-specialised Foundry agents — researcher, fact_checker, reporter — built with NewSequentialWorkflowBuilder and streamed stage by stage.

Pratik Dhanave · ·2 min read

03 · Agent Workflow Patterns (sequential · concurrent · group chat)

This lesson teaches that orchestration is a property of the workflow, not the agents — the same three agents drop into three different built-in graph shapes.

The same three agents dropped into three built-in agentworkflow builders — sequential, concurrent, and round-robin group chat — showing orchestration is a property of the graph, not the agents.

Pratik Dhanave · ·9 min read

Building Reliable Agents

The demo is easy; the production agent is hard. An agent that works impressively in a demo can fail unpredictably in the real world — looping, hallucinating, taking wrong actions, or racking up huge costs — because the same flexibility that makes agents powerful makes them unreliable. Building agents that actually work in production is a discipline of managing that unreliability: adding guardrails, evaluating rigorously, and, most importantly, knowing when not to use an agent at all. This closing post is about that discipline.

The demo is easy; the production agent is hard. The same flexibility that makes agents powerful makes them unreliable — looping, hallucinating, taking wrong actions, racking up costs. Building agents that actually work is a discipline of managing that unreliability, and knowing when NOT to use an agent at all.

Pratik Dhanave · ·8 min read

Multi-Agent Patterns

The instinct, once single agents work, is to build teams of them — a researcher agent, a writer agent, a critic agent, all collaborating like a little organization. It's an appealing vision, and sometimes exactly right. But multi-agent systems are also where a lot of complexity and cost hides, and the honest guidance is more restrained than the hype: use multiple agents when the problem genuinely calls for it, and prefer a single well-designed agent when it doesn't. Understanding the multi-agent patterns — and their real tradeoffs — is what lets you make that call well.

The instinct, once single agents work, is to build teams of them — a researcher, a writer, a critic, collaborating like an organization. Sometimes that's right. But multi-agent systems are also where a lot of complexity and cost hides, and the honest guidance is restrained: use multiple agents when the problem genuinely calls for it, and prefer a single well-designed agent when it doesn't.

Pratik Dhanave · ·8 min read

Reflection and Self-Correction

The first output is rarely the best output — a truth as old as writing, and one that applies to agents too. An agent that acts once and moves on repeats its mistakes; an agent that looks back at what it did, judges whether it worked, and tries again can dramatically improve. Reflection — the agent evaluating and correcting its own work — is what turns a one-shot attempt into an iterative process that gets better, and it's one of the most powerful patterns for making agents reliable on hard tasks.

The first output is rarely the best output. An agent that acts once and moves on repeats its mistakes; an agent that looks back at what it did, judges whether it worked, and tries again can dramatically improve. Reflection turns a one-shot attempt into an iterative process that gets better.

Pratik Dhanave · ·8 min read

Agent Memory

An LLM is, fundamentally, stateless — it remembers nothing between calls except what you put in its context window. For an agent that takes many steps or works across many sessions, that's a serious problem: without memory, every step starts from scratch, and nothing is ever learned. Memory is how agents overcome statelessness — holding the context of the current task, and carrying knowledge across tasks and time. Understanding the kinds of agent memory, and their limits, is essential to building agents that can handle real, extended work.

An LLM is fundamentally stateless — it remembers nothing between calls except what you put in its context. For an agent that takes many steps or works across sessions, that's a serious problem. Memory is how agents overcome statelessness — holding the current task's context, and carrying knowledge across tasks and time.

Pratik Dhanave · ·8 min read

Planning and Decomposition

Ask an agent to "research this market and write a report" and it faces the same problem a person would: the task is too big to do in one leap. The answer, for agents as for people, is to break it down — decompose the goal into steps, and work through them. Planning is how agents handle complexity that the basic reason-act loop alone would fumble, and the patterns for doing it — from planning upfront to decomposing on the fly — are among the most important in agent design.

Ask an agent to 'research this market and write a report' and it faces the same problem a person would: the task is too big to do in one leap. The answer, for agents as for people, is to break it down. Planning is how agents handle complexity that the basic reason-act loop alone would fumble.

Pratik Dhanave · ·9 min read

Tool Use

An LLM on its own can only do one thing: generate text. It can't search the web, run code, query a database, check the current time, or send a message — it can only produce words. Tools are what break that confinement, turning a model that can only talk into an agent that can act. Tool use is arguably the single most important capability that makes agents possible, and understanding how it works — and how to design tools well — is central to building effective agents.

An LLM on its own can only do one thing: generate text. Tools are what break that confinement, turning a model that can only talk into an agent that can act. Tool use is arguably the single most important capability that makes agents possible.

Pratik Dhanave · ·8 min read

The Core Agent Loop

Strip away the frameworks, the tooling, and the jargon, and every LLM agent reduces to one simple loop: think about what to do, do it, look at what happened, repeat. This reason-act-observe cycle — crystallized by the ReAct pattern — is the beating heart of every agent, and understanding it deeply is understanding agents themselves. Once you see the loop clearly, agent frameworks stop being mysterious: they're all just implementations of this same fundamental cycle.

Strip away the frameworks and every LLM agent reduces to one simple loop: think about what to do, do it, look at what happened, repeat. This reason-act-observe cycle — crystallized by the ReAct pattern — is the beating heart of every agent, and understanding it deeply is understanding agents themselves.

Pratik Dhanave · ·9 min read

What an AI Agent Is

"Agent" has become one of the most overused and least precise words in AI — applied to everything from a chatbot with a system prompt to a fully autonomous system that writes and ships code. Cutting through the hype requires a clear definition: an agent is a system where an LLM decides its own actions in a loop, using tools, until a goal is met. That one distinction — the model choosing what to do next, rather than following a fixed script — is what separates a genuine agent from a workflow, and it's where both the power and the difficulty come from.

'Agent' has become one of the most overused words in AI. Cutting through the hype requires a clear definition: an agent is a system where an LLM decides its own actions in a loop, using tools, until a goal is met. That one distinction — the model choosing what to do next, rather than following a fixed script — is where both the power and the difficulty come from.

All posts on this site are written by Pratik Dhanave, an Agentic AI Architect with 7+ years building production distributed systems, multi-agent AI platforms, and cloud-native infrastructure. About the author → Each article includes working code, architecture diagrams, and references to the specific frameworks and standards discussed. Browse all posts or explore related topics using the tag cloud above.