Home > Core > Cognitive Modes
ParallelMode
Core Architecture
Concurrent
Batch Engine
High-throughput orchestration that expands variables into task combinations and executes them concurrently.
ParallelPlan.json
{
"variables": {
"file": "src/**/*.kt",
"action": ["Review", "Document"]
},
"template": "Perform {{action}} on {{file}}",
"concurrency": 4,
"mode": "CrossJoin"
}
→
Tabbed Execution UI
● Running 12 tasks (Concurrency: 4)
Main.kt,Review
Util.kt,Review
Main.kt,Doc...
+9 more
[Task: Main.kt,Review] Executing CodingTask...
Analyzing src/Main.kt for architectural patterns and potential refactors...
ParallelPlan Parameters
The ParallelMode uses an LLM-driven parser to extract these parameters from user prompts.
| Field | Type | Description |
|---|---|---|
| variables | Map<String, Any> | Keys are template placeholders. Values can be lists or Glob patterns (e.g., *.kt). |
| template | String | The task request string using {{variable}} syntax. |
| concurrency | Int | Maximum number of simultaneous tasks. Defaults to 4. |
| mode | Enum | Determines how variables are combined: CrossJoin or Zip. |
Combination Strategies
CrossJoin
Cartesian product of all variable values. Ideal for matrix testing or multi-file operations.
Example: 2 files × 2 actions = 4 tasks.
Zip
Pairs items by index. Stops at the shortest list. Used for processing corresponding pairs.
Example: File A with Action 1, File B with Action 2.
Note: Glob patterns are automatically expanded into lists before combination logic is applied.
Configuration
Set the default behavior in your OrchestrationConfig.
kotlin
val config = OrchestrationConfig(
mode = CognitiveMode.Parallel,
// Optional: Override defaults
overrides = mapOf(
"defaultConcurrency" to 8,
"defaultMode" to "Zip"
)
)