What This Example Shows
- A
HierarchicalSwarmmodeling a real M&A diligence team, not a single-discipline review - A Deal Lead (director) coordinating four specialist workers: Financial Analyst, Legal Counsel, Tax Counsel, and Technical Auditor
- How the director synthesizes parallel findings into one structured deal memo: red flags, financial highlights, legal risks, and go / no-go / conditional
- How to fan the same swarm across a portfolio of targets overnight using
/v1/swarm/batch/completions - Concrete cost-per-target versus a real mid-market diligence engagement
This example runs on premium swarm infrastructure, and the batch endpoint at the end requires a Pro / Ultra / Premium plan. Manage your plan and credits at https://swarms.world/platform/account.
Why This Matters
A mid-market M&A diligence engagement typically runs $150,000 to $500,000+ across legal, financial, tax, and technical advisors, with partner-level attorney rates of $800 to $1,500 per hour and Big-Four diligence fees in similar ranges. Most of that spend goes into the first-pass screen — the read that decides whether the target is even worth a full diligence engagement. That first-pass screen is exactly the job this swarm does: cross-functional, structured, opinionated, and cheap enough to run on every target in your pipeline. The differentiator versus a single-discipline legal-review swarm is that deals are killed by tax exposure, broken financials, or tech debt as often as by legal risk — you need all four lenses simultaneously, with one synthesizer at the top.Step 1: Setup
.env file:
Step 2: Configure the Client
Step 3: Describe the Target
Step 4: Build the Diligence Team
The Deal Lead is intentionally constrained to synthesis and a recommendation — not redoing the workstreams. Each specialist owns one lane.Step 5: Run the Diligence
Workers do not see each other’s drafts. The Deal Lead sees every specialist output and writes the final memo. This is the right shape for first-pass diligence: independent workstreams in parallel, then one synthesizer.
The Cost Story
The swarm does not replace your advisors. It replaces the decision of whether to spend $150K on advisors. At a few dollars per run, you can screen every target your bankers send you instead of only the ones that already look interesting — which is where most missed deals hide.
Step 6: Run a Portfolio Overnight
The biggest practical win of this pattern is running it as a batch across every target in your pipeline. Same swarm config, list of tasks, one API call. Results land in your inbox in the morning.Differentiation From Related Examples
- The Legal Document Review Swarm is a sequential, legal-only contract review. This swarm is hierarchical and cross-functional — finance, tax, and technical specialists work alongside legal, because deals are killed by all four.
- The Supply Chain Hierarchical Swarm uses the same architectural pattern in a different domain — useful as a template for any cross-functional analyst team.
Next Steps
- Read Batch Swarm Completions for the full portfolio-mode pattern
- Try Claude Opus 4.8 as the model for the Deal Lead for sharper synthesis
- Adapt to other professional-services workflows using the Hierarchical Workflow Example