In this post, I want to review what kinds of delegation of tasks by AI agents to other AI agents exist. THis is based on my experience with building AI harnesses and observing how other people build their own harnesses.
Most basic architecture - just a loop
Simplest AI agent harnesses are built as a loop. The main AI agent receives a prompt, sends it to LLM, gets a response. If a response contains a request to call some tool, then the main AI agent calls that tool, gets a result, appends this result to the context, and sends it back to LLM. This loop continues until a LLM response does not contain any request to call a tool. Then the main AI agent returns the final result to the user.
This approach works well for simple tasks, but it has an important drawback - each request to LLM costs tokens and when context grows tool requests become too expensive. A delegation of subtasks is one of the solutions to this problem.