← Articles Sep 12, 2026
Agentic AI Machine Learning Architecture RAG

Agentix in the Real World

AI is having a moment that just will not end. Every week it gets louder. Part of the world is folding AI into everything it does without a second thought. Another part is convinced this is the beginning of the end for humanity as we know it. And if you look closely, there's a third camp too, quietly saying AI is mostly hot air once you get past the demos. That's a real conversation, and a long one. I'm not going to have it today. I'm not going to tell you AI must be used responsibly, or that it's our greatest weapon, or recycle any of the other lines politicians reach for in their speeches. I've spent the last few months actually sitting with this stuff: building with it, breaking it, reading the parts that never make it onto a landing page. I'd rather just tell you what I found.

Vishal Aidasani

Vishal Aidasani

10 min read

Read on Medium
Quick, honest note before we start. The title here is a bit of a stretch: I haven't shipped agentic AI into a live product with real users yet. What follows is real hands-on time, not a production war story. Call this Agentix in the real world of actually learning it, not deploying it at scale. Fair enough? Let's get into it.
Agentix in the Real World

AI Didn't Start as AI

Nobody wakes up one day and builds a large language model. The real starting point is machine learning, and machine learning's history is a lot less dramatic than the headlines make it sound. Inside ML there are dozens of ways to build small, focused models: something that predicts a number, something that sorts an email into spam or not spam. Toy problems, almost. But that's exactly where the real lesson lives.

The lesson is this: not everything is if-else. The moment you train even the tiniest model, you run into bias and variance, two words that sound academic until you've watched a model fail because of them. A model with high bias is too simple. It looks at the data and shrugs, missing the pattern entirely. That's underfitting. A model with high variance goes the other way: it memorizes the training data so well that it starts treating noise as signal, and falls apart the moment it sees anything new. That's overfitting. Somewhere between the two sits the fit you actually want.

Bias, variance, and the end of if-else thinking

Take that idea, and everything that comes with it, and scale it up by an almost absurd amount. Add natural language processing so the model can work with words instead of just numbers. Add neural networks so it can learn layered, non-linear patterns instead of a straight line. Add the transformer architecture, the thing that finally let models weigh every word in a sentence against every other word at once, instead of reading one token at a time. Put all three together at scale and you get a large language model.

From machine learning to LLMs — the scaling path

I'm deliberately not going deep on what a neural network actually is, or what a transformer is doing under the hood, or how an LLM gets trained. That's a whole article on its own, and I'll write it properly another time. Today isn't about building an LLM. It's about what happens once you have one and you actually try to get it to do something. That's Agentix.

Where It Gets Interesting: Agentic AI

Agentic AI is the part that actually pulled me in. Not the "chatbot that answers questions" part, the part where a model starts behaving less like an oracle you consult and more like a coworker who can go find things out and act on them.

The first building block most people run into is RAG, retrieval-augmented generation. The name sounds heavier than the idea. An LLM only knows what it was trained on, frozen at some point in the past. RAG is how you hand it fresh, specific, private information at the moment it needs it, without retraining anything. And RAG is really two separate pipelines wearing one name.

Pipeline 1: Indexing

This one happens ahead of time, before anyone ever asks a question. You take your documents, whatever they are: PDFs, internal docs, a knowledge base, and you chunk them into smaller pieces. Each chunk gets run through an embedding model, which turns it into a vector, a long list of numbers that captures its meaning. Every one of those vectors lands in a vector store, sitting there and waiting.

RAG Indexing Pipeline — documents in, vectors stored

Pipeline 2: Retrieval

This one runs every single time someone actually asks a question. The query gets embedded the same way the documents were. That query vector gets compared against everything sitting in the vector store using similarity search, and the closest matching chunks come back. Those chunks get folded into the prompt alongside the original question, and only then does the whole thing go to the LLM, which now has real context to answer from instead of guessing.

RAG Retrieval Pipeline — query in, grounded answer out

Naive RAG, the version above, is genuinely useful and also genuinely fragile. It breaks the moment your questions get messy or your documents get dense. So the field moved fast from there. Advanced RAG adds work on both sides of the retrieval step: rewriting a sloppy query before it hits the vector store, then reranking whatever comes back so the best chunks actually rise to the top. Modular RAG stops treating the whole thing as one fixed chain and turns it into swappable parts, so you can change the retriever or the reranker without touching anything else. Corrective RAG and Self-RAG add a layer that checks its own homework: grading whether what it retrieved is actually good before letting the model answer, and going back to search again if it isn't. And at the far end sits Agentic RAG, where retrieval stops being a single step and becomes something the model plans, deciding what to look for, checking whether it found enough, and searching again until it has.

RAG evolution — from naive to agentic

None of this makes an agent "agentic" by itself, though. RAG only ever hands the model information. It doesn't let the model do anything.

An Agent Without Tools Is Just a Chatbot

Here's the part I keep coming back to: RAG is worth nothing until you arm your agent with tools, actual access to services and actions it can take. Reading is not the same as doing. An agent that can only retrieve and answer is still, underneath it all, a very well-read chatbot. The moment it can call an API, send an email, query a database, or trigger a workflow, it crosses into something else entirely.

There are two honest paths here, and which one fits you depends on how much code you want to write.

If you're not a developer, n8n is a genuinely good answer. It's a visual, node-based automation tool: drag boxes, connect them, wire an LLM node to a database node to an email node, done. There are more n8n tutorials on YouTube than anyone could watch in a lifetime. I'll admit I've never actually sat through one myself, the interface was intuitive enough that I never needed to.

If you're comfortable writing code, though, you end up somewhere else entirely, and that's where I've spent most of my time.

OpenAI's Real Genius Isn't GPT, It's the SDK

I'll say something that might sound like an odd take: OpenAI's biggest achievement isn't GPT. It's the SDK sitting around it. Specifically, the way they solved a genuinely hard problem: getting an LLM, something that fundamentally just predicts the next token, to reliably talk back in structured, parseable JSON instead of a paragraph you have to hope you can regex your way through. I've put real time into understanding this properly, and it's worth doing.

The core idea is function calling, or tool calling. You describe a function to the model as a JSON schema: its name, what it does, what arguments it takes. The model never actually runs your function. What it does is decide, based on the conversation, whether that function is relevant right now, and if it is, it returns a structured JSON object saying "call this, with these arguments." You run the real function on your end and hand the result back. The model folds that result into its final answer.

Here's roughly what that looks like using the OpenAI Agents SDK, which wraps this whole loop into something much cleaner than writing the raw JSON schema by hand:

python OpenAI Agents SDK
from agents import Agent, Runner, function_tool

@function_tool
def get_weather(city: str) -> str:
    """Fetch the current weather for a given city."""
    return f"It's 28°C and sunny in {city}."

agent = Agent(
    name="Weather Assistant",
    instructions="Help users with weather questions. Use the weather tool when you need real data.",
    tools=[get_weather],
)

result = Runner.run_sync(agent, "What's the weather in Ahmedabad right now?")
print(result.final_output)

That @function_tool decorator is doing the unglamorous, genuinely clever part. It looks at your function's type hints and docstring and generates the JSON schema for you. Strip the SDK away and this is roughly what it built behind the scenes, and what the model sends back once it decides to use it:

JSON Schema
{
  "name": "get_weather",
  "description": "Fetch the current weather for a given city.",
  "parameters": {
    "type": "object",
    "properties": { "city": { "type": "string" } },
    "required": ["city"]
  }
}
Model Tool Call Response
{
  "tool_call": "get_weather",
  "arguments": { "city": "Ahmedabad" }
}

Laid out as a sequence, the whole loop looks like this:

Tool calling sequence — the loop every agent framework is built on

Describe a tool in JSON, let the model decide, execute for real, feed the result back. That loop is the actual foundation almost every agent framework you've heard of is quietly built on. Once you see it, you can't unsee it.

What Actually Broke When I Built This

I built this exact loop by hand with raw OpenRouter requests before touching any framework. The first version only ran one round: the LLM returns a tool_call, I execute it, and then... silence. No final answer. Just a dead end.

The problem was obvious once I found it, but it took me longer than I'd like to admit: the tool result needs to go back into the conversation with role: "tool" and the tool_call_id, and then the LLM needs to be called a second time so it can fold the result into a natural language answer. Without that second call, the model never gets the chance to actually respond.

Broken vs fixed agent loop — one round vs proper feedback

That broken version is the reason I say this loop is the most important thing to understand. Frameworks hide it. The loop is still there.

When One Agent Isn't Enough

All of this works beautifully for one agent doing one job. It starts creaking the moment you're running large orchestrations: several agents, several tools, heavy usage, and no interest in hand-tracking every single call yourself. At that point you need abstraction, and abstraction means picking an orchestration pattern before you pick a framework.

Orchestration is just the question of how multiple agents, or multiple steps, actually coordinate. A handful of patterns cover almost everything you'll run into. Sequential orchestration chains agents one after another, each picking up where the last left off: simple and predictable, but rigid. Parallel orchestration fans a task out to several agents at once and combines their answers at the end: faster, but harder to reconcile when the answers disagree. Hierarchical orchestration puts a manager agent on top, delegating pieces of the work to specialist workers underneath it, which is how most serious multi-agent systems end up structured once they outgrow a handful of agents. Routing, sometimes called handoff, uses a router to send a request straight to whichever specialist actually fits it. And loop orchestration keeps an agent and an evaluator talking to each other, redoing the work until the evaluator is satisfied. Most real systems end up combining two or three of these rather than picking just one.

Five orchestration patterns — sequential, parallel, hierarchical, routing, loop

After building the manual loop by hand, I understood the concept, but I never wanted to write that boilerplate again. That's where the LangChain ecosystem comes in, and it's worth understanding as layers rather than four separate products.

LangGraph sits at the bottom. It's the graph runtime, the actual engine that lets you define agents and steps as nodes on a graph, with real state, real persistence, and the ability to pause for a human to step in mid-run. Everything else in this stack is either built on it or designed to pair with it. LangChain sits above that as the layer most people meet first: a huge library of integrations and building blocks, plus a lighter agent harness for when you want more direct control over the loop than a fully managed one gives you. Deep Agents sits alongside LangChain, a step up in abstraction. It's described, accurately, as a batteries-included harness: planning, context management, and delegation to sub-agents, all included out of the box, openly inspired by tools like Claude Code. If you just want a genuinely capable agent without hand-building the harness yourself, this is where most people should probably start. And running underneath all three is LangSmith, the observability layer: tracing every decision an agent makes, catching failures, running evals, and handling deployment once you're ready to actually ship the thing.

LangChain ecosystem — LangGraph, LangChain, Deep Agents, LangSmith

Even that stack has a learning curve, though. And the story doesn't end there.

When You Need to Trust an Agent With Real Code

Here's where it gets personal. I run an AI coding agent against a live codebase, LawPrix, a Django platform with 22 apps, real users, and a scikit-learn routing model that decides which lawyer gets which case. Not a toy. Not a demo. A real product.

The question I had to answer before doing this: where's the line between what I'd let the agent change autonomously and what always needs my approval?

I set up a two-tier authority model. Tier 1 covered changes the agent could make autonomously: fixing lint issues, obvious bugs with clear scope, formatting. Low-blast-radius stuff. Tier 2 covered anything touching auth, permissions, or data handling: the agent could flag it and propose a fix, but I had to review and approve before it landed.

The agent caught a vulnerability I'd missed and a bug in the matching engine that had been live for months. Both would have been invisible to me for longer if I hadn't let it scan the full codebase. But the honest part is this: I still don't have a clean answer for where that trust boundary should be. Anything reversible and low-risk, I'm comfortable letting run autonomously. Anything touching authentication or payment logic gets a human review no matter how confident the agent is, because a wasted hour of review is cheap and a silent permission regression in production is not.

Two-tier authority model for AI coding agents

This is the real question of agentic AI in practice. Not "can it do the thing?" but "can you trust it to do the thing without you watching?"

Just Get It Done: CrewAI

Eventually people looked at all of this: LangChain, LangGraph, Deep Agents, the whole ecosystem, and decided it was still too much ceremony for what they actually wanted, which was to describe a crew of agents, give them a job, and watch it run. That's the gap CrewAI fills.

CrewAI organizes work around two ideas. A Crew is a group of agents, each with a role, a goal, and a backstory that shapes how it behaves, working through a set of tasks under a process that's either sequential or hierarchical with a manager agent on top. A Flow sits one level up, for when you want more deterministic, explicit control over exactly what happens and in what order, and a Flow can wrap a Crew inside it for the parts that genuinely benefit from an agent's judgment.

What actually sold me, though, is the CLI. It's been pulled out into its own lightweight package now, so you can scaffold, run, test, and deploy a crew without dragging in the entire framework. You describe your agents and tasks, run one command, and get a live terminal UI showing nested progress for every agent as it works: not a wall of scrolling logs, an actual readable view of who's doing what right now. Deploying from there is another single command. For how easy it makes standing up a working orchestration, calling it legendary doesn't feel like an exaggeration.

CrewAI flow — create, define, run, deploy

Where This Leaves Me

Most agentic AI content sells you on the dream. The reality is messier. The tool-calling loop breaks. RAG retrieves garbage. The model calls the wrong tool with the wrong arguments and does it confidently. But when it works, when the pieces actually click, it does feel like something shifted. Not AGI. Not magic. Just a genuinely new kind of software that behaves less like a program and more like a coworker who sometimes needs supervision.

I'm still working through more of this. There's a lot I haven't touched yet, and I'd rather write about it honestly in pieces than pretend I've got the whole picture right now. If you've actually shipped something agentic into production, I'd genuinely like to hear how far this map holds up against reality. That's usually where it gets interesting.