A custom agent framework is a serious organizational commitment, not just a coding choice. It means your team owns the loop that turns a language model into an agent: calling the model, running tools, keeping state, recovering from failure, and recording what happened. Adopting an existing open-source library hands most of that loop to someone else’s code, in exchange for living with their design decisions. This guide helps an organization decide which trade is worth making, and when to change its mind.
Anthropic describes agents as systems where large language models dynamically direct their own processes and tool usage, while workflows orchestrate language models and tools through predefined code paths. Either way, somebody owns the loop: your team, or the maintainers of a library you adopt.
What counts as a custom agent framework — and what counts as adopting a library
Fix the terms first. At one end sits the raw loop: your code calls a model, runs any requested tool, feeds the result back, and repeats until a stopping condition fires. The run repeats until a final answer or a stopping condition such as a maximum number of turns, as Anthropic describes for maintaining control. At the other end sits an internal platform: shared infrastructure used by several teams, with its own conventions and support rota.
Between those ends sit the options most teams choose. A single-purpose library does one job inside a loop you own. An agent software development kit may provide ready-made parts and a managed loop, but which components a particular SDK owns varies, so check its documentation; LangChain’s create_agent, for example, runs the core loop on the LangGraph runtime. A full framework adds opinionated structure: orchestration, state, memory, and observability wired together by convention. LangChain’s 1.0 release illustrates the ladder: LangChain is the high-level way to build an agent, with a standard tool-calling architecture and middleware for customization, while LangGraph is the lower-level runtime for highly custom, long-running agents. Because LangChain agents are built on LangGraph, a team can start high-level and drop down to the runtime when it needs more control.
OpenAI reduces an agent to three components: the model, the tools, and the instructions and guardrails that define how it behaves. A framework adds the machinery around them: the loop, state and persistence, recovery, human checkpoints, and tracing. Building custom means maintaining that machinery. Adopting means accepting the maintainer’s machinery and working around it. Most real choices are hybrid, which is why the later sections matter.
When a custom agent framework earns its keep

A custom agent framework earns its keep when the need is durable, shared, and genuinely different from what a library assumes. Durable means the system will still be running and evolving in a year or two, not a single prototype. Shared means more than one team will build on it, so the cost is spread and consistent conventions compound. Different means the library’s assumptions actively get in the way, rather than merely being unfamiliar.
Three conditions point that way: unusual control flow, such as long-running processes that pause for days awaiting approval or must survive a restart mid-conversation; deep integration with internal systems, where every agent needs the same governed access patterns; and compliance and auditability, where you must show step by step what the agent saw, decided, and did. Check first whether a library already covers the case — LangGraph’s durable state and human-in-the-loop support exist for exactly this kind of work.
Anthropic’s guidance gives the threshold test: find the simplest solution possible, only increase complexity when needed, and add complexity only when it demonstrably improves outcomes. A custom framework is a large increase in complexity, justified when you can point to a concrete requirement — a control-flow shape, a governance rule, a shared platform need — that a library cannot meet without so much customization that you are effectively maintaining a fork.
When an open-source library is the right call
Adopting a library is the right call when the use case is standard, the team is small, and speed to a working, evaluated system matters more than control over every detail. OpenAI recommends maximizing a single agent’s capabilities first, because more agents — and by extension more machinery — introduce complexity and overhead, and often a single agent with tools is sufficient. Start with the smallest machinery that does the job, and grow it only when the job outgrows it.
Adoption buys a tested loop, documentation your team can read instead of writing, and stability: LangChain’s 1.0 release commits to no breaking changes until version 2.0, a promise a small team cannot easily make about its own framework. Sometimes even a library is more than needed. Anthropic notes that optimizing single language-model calls with retrieval and in-context examples is usually enough, and suggests starting by using language-model APIs directly, since many patterns can be implemented in a few lines of code. The fragment below shows the shape of that loop — a fragment to make the structure visible, not a runnable program.
# Fragment — the loop shape, not a runnable program.
while not done:
reply = model(conversation, tools)
if reply is a tool request:
conversation.append(run_tool(reply))
else:
done = TrueThe true cost of each path
Cost comparisons usually fail because they count only the first build. The honest comparison counts total ownership over time. No verified dollar, percentage, or hours figure for either path was found in the vendor documentation consulted for this article, and none is asserted here. What can be compared is where the cost falls.
Building custom costs initial effort plus ongoing ownership: upgrades when providers change interfaces, fixes when the loop misbehaves, debugging when an agent loops or picks the wrong tool, and evaluation to know whether changes helped. Anthropic warns that agents bring higher costs and the potential for compounding errors, and recommends extensive testing in sandboxed environments with appropriate guardrails. For a custom framework, that testing is the framework’s job — including the people cost, as the engineers who understand it become a scarce resource every new team needs.
Adopting costs learning, upgrade churn, and workarounds. Your team must learn the library’s mental model and relearn it when a major version changes it. When the abstraction fights your use case, the workaround can cost more than the feature it replaces: Anthropic warns that framework abstractions can obscure the underlying prompts and responses, making debugging harder, and can tempt teams to add complexity when a simpler setup would suffice. Weigh both lists against your own situation: how many teams, how long-lived, how unusual, and how much evaluation capacity you actually have.
Ownership, governance and risk
On the adopt side, ask about the library’s health: is it actively maintained, who maintains it, and what happens if maintenance slows? The AutoGen story is the cautionary example. Its README states that AutoGen is in maintenance mode, will not receive new features or enhancements, and is community managed going forward, directing new users to Microsoft Agent Framework. Check maintenance status, release cadence, and successor guidance before adopting. The same check applies to licences, security review, and support: verify each one for the specific options you shortlist, from their own repositories and documentation. This article deliberately names no licence for any library, because that verification belongs in your own review, against the versions you would actually use.
On the build side, governance is about ownership. Who owns the framework, reviews changes to the loop and guardrails, and supports it when the original authors are away? A custom framework without a named owner, a changelog, and internal documentation is not a platform; it is one team’s habits, and it becomes a bottleneck the moment a second team depends on it. Anthropic’s closing principles apply here: simplicity in design, transparency in planning steps, and thorough tool documentation and testing.
Evaluation belongs on both sides. LangSmith’s trajectory view aggregates messages from humans, models, and tools across an agent and its subagents into one chronological session view that can be scored and routed for review. Whether you adopt or build, you need a record of full runs, not just final answers. Treat the evaluation harness — datasets, evaluators, review queues — as a portable asset that survives a framework change.
The hybrid path: adopt now, build later — or build thin and borrow

Most organizations do not need to choose once and for all. Adopt now with a clean boundary, build thin where it matters, and test a later move in a pilot rather than assuming one. Tool definitions, state schemas, prompts, and evaluation harnesses should live in your code, in your formats, not buried in framework-specific constructs. That boundary reduces coupling and can limit the work a later move requires, though reuse must be validated in the pilot; the documented transition is the specific LangChain-to-LangGraph drop-down, not a general guarantee. LangChain’s design supports this shape: because its agents are built on LangGraph, a team can start with high-level APIs and drop down to the runtime for the parts that need explicit control.
Run the decision as a time-boxed spike and pilot. Build a prototype on the library against a real use case, evaluate it on real trajectories, and set explicit go and no-go criteria first: accuracy targets, latency and cost bounds from your own measurements, and the specific requirements the library must satisfy. OpenAI’s evaluation-first advice fits here: establish a baseline with the most capable model, then optimize cost and latency by swapping in smaller models where they still meet the target. If the prototype meets its criteria, adopt. If it fails on a specific, named requirement, you have evidence for a custom build — or a thinner custom layer — instead of an opinion.
Building thin is often the best of both: keep the library’s loop, tracing, and persistence, and build only the part that is genuinely yours, such as a governed tool layer or a human-approval workflow. The test is the same as for a full custom framework: does the requirement survive contact with the library, documented and specific, or dissolve once someone tries the library’s way of doing it?
A decision checklist and when to revisit it
Score these honestly, as a team. Control needs: durable state, long pauses for approval, or auditable branching a standard loop cannot express? Team size and skills: how many engineers can own framework internals, and for how long? Time horizon: prototype, product, or platform for several teams? Compliance: what must you show, and whose standards must tracing meet? Exit cost: if you left this choice in a year, which parts — tools, state, prompts, evaluations — would you keep? High scores on control, horizon, and shared use, with named compliance needs, argue for building. High scores on speed, a small team, and a standard use case argue for adopting. A split score argues for the hybrid path.
Two illustrative scenarios show how the checklist lands differently. A small product team adding one agent feature — a single workflow, a handful of tools, one team, no regulatory audit trail beyond normal logging — should adopt a library, or build the loop directly, and resist building a framework it alone will use. A platform team building infrastructure for several teams in a regulated business, with multi-day approvals, strict audit requirements, and internal systems no public library integrates with, should build, or build thin on a low-level runtime, with a named owner and a governance plan. These scenarios illustrate the reasoning; they are not reports of real organizations, and your own checklist answers are the evidence that matters.
Decide in advance when to revisit the decision: a second team wanting to build on the framework, a sharp change in team size, a breaking upstream change or a move to maintenance mode, or a compliance change. Build a custom agent framework when the need is durable and shared, the requirement is specific and documented, and your team can own the machinery for as long as the agents run. Otherwise, adopt, keep the boundary clean, and spend your engineering time on the agent itself.












