Rohit Edathil writes about Dagic, a minimal workflow Directed Acyclic Graph (DAG) definition language and asynchronous execution engine implemented in Python designed for LLM agents. It provides a middle ground between standard tool calling and full code execution by allowing models to describe workflows through assignments and function calls that are parsed, type-checked, and executed concurrently without the security risks of arbitrary code execution.
- Performs ~7x more efficiently than per-call tools in math benchmarks regarding token usage
- Executes independent branches of a workflow concurrently using Python's asyncio
- Provides static type checking for tool arguments to prevent mid-run failures
- Avoids the need for sandboxing arbitrary model-generated code by restricting execution to host-registered functions