Optimizing Multi-Agent Workflow Orchestration for Complex Document Analysis Tasks
The setup involves a "Router" agent, two "Extractor" agents, and a "Reviewer" agent. When using GPT-4o as the orchestrator, I noticed a tendency for the agents to "agree" too quickly, leading to confirmation bias where the Reviewer simply echoed the Extractor's mistakes. Switching the orchestrator to Claude 3.5 Sonnet immediately tightened the loop; Sonnet is significantly more pedantic about contradictions, which is exactly what you want in a multi-agent verification flow.
However, for the actual extraction phase—the "grunt work" of parsing dense text—DeepSeek-V3 is punching way above its weight. In my tests, DeepSeek handled the raw extraction of nested tables and footnotes with higher precision than Gemini 1.5 Pro, despite Gemini's massive context window. Gemini is great for "finding a needle in a haystack," but it often hallucinates the surrounding context when asked to format that needle into a specific JSON schema.
Here is the prompt logic I'm using for the Reviewer agent to force a critical lens:
You are a Skeptical Auditor. Your sole goal is to find discrepancies between the Extracted Data and the Source Document.
Do not summarize. Only output:
1. Discrepancy found: [Quote from source] vs [Extracted value]
2. Confidence score: [0-1]
If no error is found, output "VERIFIED".Performance-wise, the latency hit of a multi-agent loop is the biggest bottleneck. Using a "dense" orchestration (where every agent talks to every other agent) kills throughput. I've found that a linear DAG (Directed Acyclic Graph) structure is the only way to keep this viable.
The trade-offs I've observed:
Claude 3.5 Sonnet: Best for orchestration and final synthesis. It follows complex system prompts without drifting. The "reasoning" feel is more natural, and it catches nuances in document contradictions that other models miss.
DeepSeek-V3: The efficiency king for extraction. It handles structured data output (JSON/Markdown) with fewer syntax errors than GPT-4o and is significantly cheaper for high-volume document processing.
GPT-4o: The safest "all-rounder," but it feels too "polite" for agentic workflows. It often misses subtle errors because it tries to be helpful rather than critical.
Gemini 1.5 Pro: Unbeatable for initial ingestion of massive folders, but the "lost in the middle" phenomenon still plagues it when the orchestration requires precise jumps between page 2 and page 48.
If you're building this, don't use a single model for the whole chain. Use Gemini or DeepSeek for the heavy lifting of extraction, and pipe the results into Claude for the orchestration and auditing. The delta in accuracy is roughly 15-20% compared to a mono-model pipeline.
All Replies (0)
No replies yet — be the first!
