Theme: The Craft
Length: ~700 words
Hook: Analytical — expose the invisible cost everyone pays
Here's something every team building AI agents has experienced but few talk about: the glue code tax.
You start with a framework. LangChain, CrewAI, AutoGen — pick one. You write your first agent. It's 50 lines. It works. You're happy.
Then you add a second agent. They need to communicate. You write 100 lines of glue code to connect them.
Then you add tools. Each tool needs to be registered, typed, documented, and wired. Another 200 lines.
Then you add memory. The framework's memory module doesn't quite fit your use case, so you write a custom adapter. 150 lines.
Then you add RAG. The framework's RAG integration expects a specific vector store, but you're using a different one. Another 100 lines of adapter code.
Then you add governance. The framework doesn't have governance, so you import a separate tool and wire it in. 200 lines.
Then you add monitoring. Another library, another integration, another 100 lines.
You started with 50 lines of agent logic. You now have 800 lines of agent logic and 1,200 lines of glue code. The glue code is 70% of your codebase.
The tax compounds.
The glue code doesn't just exist — it has to be maintained. Every framework update might break an adapter. Every new tool requires new wiring. Every change to the agent flow requires touching 5 files across 3 libraries.
The tax shows up in ways that are hard to measure:
- Onboarding time: A new developer needs to understand 3 frameworks, 2 adapters, and 1,200 lines of glue before they can change a single agent behavior.
- Debugging time: When something breaks, you're debugging across framework boundaries. The error happens in LangChain but the cause is in your CrewAI adapter. The stack trace doesn't help.
- Testing time: You can't unit test glue code easily. It's integration code by definition. So you test manually, which is slow and incomplete.
- Upgrade risk: Upgrading any framework is a multi-day project because you need to verify that every adapter still works. So you delay upgrades. Now you're running outdated frameworks with known bugs.
Why this happens.
The root cause is simple: you're using general-purpose languages (Python, TypeScript) with agent frameworks bolted on top. The frameworks don't know about each other. The language doesn't know about agents. You're the bridge.
In every other domain that got complex enough, the solution was the same: a domain-specific language.
SQL solved the glue code problem for data queries. Before SQL, you wrote imperative code to traverse databases. After SQL, you declared what you wanted and the engine figured out how.
HTML solved the glue code problem for web pages. Before HTML, you wrote imperative code to render text and images. After HTML, you declared the structure and the browser figured out how.
Kubernetes YAML solved the glue code problem for infrastructure. Before Kubernetes, you wrote imperative scripts to deploy and configure services. After Kubernetes, you declared the desired state and the controller figured out how.
Agents are at the same inflection point. The domain is complex enough. The glue code is painful enough. The solution is the same: a declarative language where agents, tools, memory, RAG, and flows are first-class constructs — not imported classes wired together with boilerplate.
What the alternative looks like.
Instead of 1,200 lines of glue code, you write 50 lines of declaration:
agent ResearchBot {
model: @anthropic/claude-4
tools: [WebSearch, DocStore.retrieve]
memory: episodic
fn run(query: Str) -> Result<Report, AgentError> {
let plan = await spawn Planner().plan(query)?
let results = await pool(size: 3, target: Worker).investigate(plan)?
Ok(await spawn Summarizer().summarize(results)?)
}
}
The compiler handles the wiring. The type checker catches errors before runtime. The codegen produces Python or TypeScript. No adapters. No glue. No tax.
The bigger point.
Glue code isn't just ugly. It's the reason agent projects become unmaintainable. It's the reason teams spend 70% of their time on infrastructure and 30% on agent behavior. It's the reason upgrades are terrifying and onboarding is slow.
When a domain gets complex enough, you stop writing glue and start writing declarations. Agents have reached that point.
How much of your agent codebase is glue — and what would you build if it was zero?