Multi-Agent
The Cost of Concurrency: Who Can Run in Parallel
Reads can be parallel: multiple searches running simultaneously won't conflict. Writes must queue: two Agents modifying the same file at the same time will cause data corruption. The key question for whether an operation can run concurrently: is it read-only?
Parallelizable vs. Must Serialize
Parallelizable (read-only operations)
Search the web
Read files
Query API
Data analysis
Database query
Read notes
These operations don't modify anything, so multiple simultaneous runs don't interfere. 10 Agents searching concurrently won't conflict.
Must Serialize (write operations)
Write to file
Send email
Execute command
Delete resource
Payment operation
Edit notes
These operations change external state. Two Agents modifying the same file simultaneously = data overwrite, content loss.
Timeline Comparison
Same task: 3 searches + 1 write
3 searches in parallel, write comes last
0s2s4s6s
Total: ~4 seconds ✓
Decision Rule
One rule to determine concurrency:
After this operation completes, has the world changed? No → can be parallel
After this operation completes, has the world changed? Yes → must queue
Two write operations targeting different resources (different files, different DB tables) → can also be parallel
Simply put: conflicts occur when multiple operations modify the same resource. As long as the targets differ, write operations can also be parallel.
Parallelism saves time, but only read-only operations are safe to parallelize; write operations must queue. When designing a multi-Agent system, the first step is to classify tools into "read" and "write" categories.