Building Code Mode Agents

Published: 01 January 1970
on channel: Union-ai
99
6

code: https://github.com/unionai/workshops/
Flyte: https://github.com/flyteorg/flyte
Slack: https://slack.flyte.org/

Connect with Sage Elliott:   / sageelliott  

Most agents use tools by emitting one structured tool call at a time. The model picks a tool, waits for the result, picks the next, and every intermediate result flows back through its context. As the number of tools and steps grows, that gets expensive, slow, and brittle.

​Code mode flips this. Instead of calling tools one at a time, the agent writes code that calls them as functions, runs that code in a sandbox, and returns only what matters back to the model. Why this works well in practice: models are trained on far more code than tool-call traces, so they compose operations more reliably in a language they already know. Loops, branching, filtering, and data transforms happen in the sandbox instead of as separate round-trips. Large intermediate results stay out of the context window, and tool definitions load on demand instead of all up front. The result is an agent that does more per step and spends fewer tokens doing it.


On this page of the site you can watch the video online Building Code Mode Agents with a duration of hours minute second in good quality, which was uploaded by the user Union-ai 01 January 1970, share the link with friends and acquaintances, this video has already been watched 99 times on youtube and it was liked by 6 viewers. Enjoy your viewing!