Agentic Systems iconAgentic Systems hover icon

Agentic Systems

TaskGen: Shared Memory Architecture for Multi-Agent Task Decomposition

TaskGenTaskGen
OpenAIOpenAI

Key Takeaway

TaskGen's task-based decomposition with RAG over function space enables reliable multi-agent execution by semantically matching user goals to available functions before generating subtask plans, while avoiding the token inefficiency of conversational frameworks through structured state management.

The State Management Problem in Agentic Systems

Multi-agent frameworks typically struggle with two competing requirements: agents need isolated context for focused subtask execution, yet they must share state to maintain coherence across complex workflows. Conversational frameworks like AutoGen create verbose message chains that dilute task focus. TaskGen solves this by introducing a shared memory architecture where a Meta Agent decomposes tasks into subtasks, delegates to Inner Agents with isolated contexts, and maintains global state through a shared variable store that persists across function calls.

Task-Based Decomposition with RAG Over Function Space

TaskGen's core philosophy centers on breaking goals into bite-sized, executable subtasks rather than generating conversational responses. The Meta Agent analyzes the user's task and available function signatures, then generates a subtask sequence where each step maps to a specific function call. What makes this powerful is the RAG (Retrieval-Augmented Generation) over function space: before generating subtasks, the agent retrieves relevant functions from its function registry based on semantic similarity to the task description. This prevents the agent from hallucinating non-existent capabilities and ensures each subtask can actually be executed.

Subtask Generation Flow:

Stage Process Output
Function Retrieval Semantic search over function docstrings Filtered function set
Task Analysis LLM decomposes goal into steps Subtask sequence
Function Mapping Match subtasks to retrieved functions Executable plan with parameters
Execution Sequential subtask processing Results stored in subtasks completed

TaskGen vs AutoGen vs BabyAGI

TaskGen differentiates itself through structured execution over conversational drift. AutoGen relies on multi-agent conversations where agents exchange free-form messages until consensus emerges, leading to token-heavy interactions and unpredictable reasoning paths. BabyAGI uses task list management with priority queues but lacks function-level orchestration and shared memory primitives. TaskGen combines the best of both: deterministic task decomposition like BabyAGI with multi-agent capabilities like AutoGen, but enforces structured outputs through StrictJSON and maintains state through shared variables rather than conversation history. This makes TaskGen more token-efficient for workflows requiring 3 to 10 function calls with deterministic outputs.

Applied Insight: When Memory Isolation Beats Shared Context

Use TaskGen's architecture when you need multi-step workflows where intermediate results should not pollute future reasoning, such as data pipelines where each transformation must be deterministic, or research tasks where different information retrieval steps require distinct contexts. The framework excels with 3 to 10 subtasks but becomes overhead for simple single-step queries. The shared variables pattern is critical for non-text modalities like images or audio where you need reference passing without token bloat. Avoid TaskGen for open-ended exploration tasks where conversational frameworks like AutoGen better handle emergent reasoning patterns.

© 2025 BeautifulCode. All rights reserved.