From API call to agents in production
Calling an LLM API is the easy 10%. The real engineering is the system around it — tools, guardrails, retries and human-in-the-loop. Notes from wiring agents into real products.
A single API call gets you a chatbot. A product that acts on the user's behalf needs an agent — and an agent is mostly the engineering that surrounds the model, not the model itself.
Give the model real tools
Function calling turns a language model into something that can do work: query a database, create a record, send a message. Define narrow, well-typed tools and let the model choose — but validate every call before it runs.
Design for failure
Models are non-deterministic, so build like it. Add retries with backoff, validate outputs against a schema, and fall back gracefully when a tool errors. An agent that fails loudly and safely beats one that fails silently.
Keep a human in the loop
For anything irreversible — payments, deletions, outbound messages — put a confirmation step in front of the action. The model proposes; the human (or a strict rule) approves.
The interesting work isn't the prompt. It's the guardrails, the observability and the workflow design that make an autonomous system trustworthy enough to put in front of users.
More writing
iAspirants — the best UPSC AI preparation platform
A complete tour of iAspirants, an AI-powered UPSC preparation platform that brings the best UPSC current affairs, daily Prelims MCQ practice, PYQs, AI Mains answer evaluation, smart notes, mind maps and performance analytics together in one place.
Architecting RAG that actually ships
Retrieval-augmented generation is easy to demo and hard to ship. Here's the pipeline I reach for — chunking, embeddings, reranking and citations — and the failure modes to design around.
Next.js on the edge: streaming, RSC and speed
React Server Components and the edge runtime change how you build for speed. A practical look at streaming, where to render, and keeping Core Web Vitals green.