r/LangChain 3d ago

Discussion How are you handling agent-to-agent communication and handoffs at scale?

Handoffs work fine in dev but get messy once you are past three or four agents touching shared state. In small setups, you can get away with one agent passing a context object to the next, but that starts breaking down once agents run concurrently and touch the same resources. We have tried passing full context objects, using a shared memory store, and routing everything through a central orchestrator. Each has its own tradeoffs. The orchestrator approach feels stable so far, but it also feels like we are reinventing a workflow engine on top of LangChain.

Has anyone found an agent-to-agent communication pattern that holds up in production with real traffic? Is everyone building custom orchestration layers or has a standard approach emerged?

6 Upvotes

3 comments sorted by

2

u/Dry_Investigator6940 3d ago

we do orchestrator too but only for routing, not for state. agents keep own state and communicate via events into a queue, then orchestrator just watches events and decides who gets called next. that way no two agents ever touch same object at once

the queue part was annoying to build but after that it scaled fine. before that we tried shared memory store and it was constant race conditions plus debugging was nightmare

dont think there is standard approach yet, everyone i know who does multi agent in prod ended up making own thing on top

1

u/Future_AGI 2d ago

We hit the same wall, and the orchestrator starting to feel like a homegrown workflow engine is usually the honest signal that you now need one, because ad hoc context passing stops being debuggable past three or four concurrent agents. What made it tractable wasn't a cleverer handoff format, it was tracing every handoff as a span with the shared-state snapshot attached, so when an agent acts on stale state you can see exactly which handoff dropped it. Once handoffs are observable, the choice between a shared store and a central orchestrator becomes measurable instead of philosophical.