Discuss your project

Guide

An AI agent framework gives you the loop, not the context

A framework gives your agent the loop. The context layer, what it may read, how fresh the data is, is the real project. A technical view.

By · Updated · 5 min read

A framework does one thing well: it gives your agent the loop. Goal in, tool calls out, result checked, next step chosen. LangChain, CrewAI, and AutoGen all ship this in an afternoon, and the demo works because the demo has no context to get wrong.

Then you point the same agent at your systems and it falls over, not because the loop is broken, but because the agent does not know your invoices, your customers, or which of two systems holds the truth. The framework is free. The context is the project. That sentence is the whole argument of this page.

The loop and the layer
  1. Goal
  2. Tool calls
  3. Check the result
  4. Choose the next step
  5. Context layer, built by you
  • 43%

    of legal research answers hallucinated by a general model with no record to cite

    Stanford RegLab, 2024

  • 80%

    of AI tools will include context engineering by 2028

    Gartner, quoted by Atlan, 2025

What a framework actually gives you

A framework gives you the control loop. It wires the model to tools, defines the stop condition, and usually gives you a way to structure memory across steps. Anthropic's working definition is close to the same thing: an LLM autonomously using tools in a loop.

That loop is valuable, and it is also now a commodity. The scaffolding a framework provides is genuinely one command away. The layer it leaves you to build by hand is not. If your agent only needs to answer from its own weights, a framework plus an API key is enough. The moment it needs to answer from your data, the framework stops being the interesting part of the project.

The memory primitives a framework offers, a scratchpad, a task list, a set of rules, are useful, but they are generic. They do not carry your business's rules for what a correct answer is, and they do not know which of your systems is authoritative for a given fact.

What the framework leaves out

The framework does not give you context. It does not know what the agent is allowed to read, how fresh that data is, or what a correct answer must be checked against. Context engineering, as Anthropic puts it, is the work of curating the right tokens for the model at inference time, and an agent running in a loop produces more data than fits its context window on every turn. The context has to be curated each turn, not written once.

The Stanford RegLab study is the concrete version of this risk: a general model answering legal research questions from its own weights hallucinated on 43% of queries, while tools that pointed back to a specific record did far better. The framework cannot close that gap. Only the context layer can.

Gartner, quoted by Atlan, expects context engineering to appear in 80% of AI tools by 2028, which is the industry admitting, in its own language, that the hard part moved from the prompt to the context. A framework will happily run an agent that reads stale data and answers confidently. It will not notice.

Discuss your project

Freshness and disagreement between systems

The context layer is where the real failure modes sit. The first is freshness: is the invoice total the agent just quoted from last month or from the open order. The second is disagreement: your CRM says a customer is active and your billing system says the account is past due. Which is true depends on your definitions, and an agent that silently picks one is the failure mode, not a missing feature.

None of this is a framework concern. It is a source-of-truth concern. Someone has to decide, for each fact, which system wins, and the agent has to know that decision instead of improvising it. This is the problem the model context protocol page and the MCP server for business page cover: how you connect systems so the agent reads the right record, and how you make every answer trace back to a source you can open.

The permission boundary sits outside the framework

Whatever framework you choose, the permission boundary belongs outside it. The agent reads by default and needs a named permission to write. A framework will call any tool you give it with whatever permission that tool carries, so the read-only default has to be enforced at the tool and system level, not assumed by the framework.

This is the same principle I build into every agent, and the full method is on the agent development page. The framework is where the loop runs. The permission boundary is what keeps a wrong answer from becoming a wrong action.

How to choose a framework

You choose a framework by the problem, not by a ranking. If your team will own Python and the wiring, an open-source framework such as LangChain or CrewAI fits. If you want a visual canvas and a single reversible workflow, a no-code tool such as n8n is closer, and the platform page walks through the three categories. AutoGen suits multi-agent setups where one agent hands work to another. None of these is best. Each is the right answer to a different constraint.

An open-source framework also carries a maintenance load: dependencies, upgrades, and the testing you own yourself. That is a real cost, and it is why the framework decision should follow the context decision, not lead it.

The selection criterion that matters more than the framework is what happens after the loop returns: can the answer be checked against a source, and is the write permission bounded. If the framework makes that hard, the framework is wrong for you, no matter how clean the loop.

When a framework stops being enough

A framework alone is enough for a prototype. It is not enough for a workflow where an error has a cost. The line is crossed when 2 systems have to agree, or when the output ships to a customer, or when nobody has time to read every run. Past that line, the framework is a small part of the project and the context layer is the rest.

The framework gives you the loop. The sources it reads, the check it runs and the owner who answers for it sit outside the framework.

Questions owners ask

For a single prompt with a tool call, no. For an agent that chooses steps and checks its own result, a framework saves you writing the loop yourself. It is a starting point, not the product.

The one that matches who will own the code and what your systems look like. An open-source framework for a Python team, a visual builder for a single reversible workflow, a multi-agent framework for handoffs. Test the context and permission story, not the demo.

No. The hard part is the context: what the agent may read, how fresh the data is, and how every answer is checked against a source.

Enforce read-only by default, connect the source systems, and require every answer to cite the record it came from. That is the context layer, and it lives outside the framework.

A framework gives you the loop and leaves the wiring to you. A platform hosts the agent and often the tools. The line is blurry in practice, and the platform page compares the categories directly.

Start with the process that costs you the most time

Tell me which process you want to improve. A name, an email, and a short description of the process are enough to start a useful conversation.

Discuss your project