I want to automate our entire social media pipeline. I’m thinking of a "Researcher Agent" to find trending topics, a "Writer Agent" to draft posts, and an "Editor Agent" to check for brand voice. Has anyone used Multi-Agent Systems (MAS) for this? I’m specifically curious about how to pass context between agents without the information getting garbled or lost. Should I use a shared memory bus or just pass a standard JSON output between the different nodes in the graph?
3 answers
Using a graph-based approach like LangGraph is superior for marketing because tasks aren't always linear. Sometimes the Editor needs to send the post back to the Writer for a rewrite. For passing context, I recommend a "Shared State" object. In LangGraph, this is built-in; all agents can read and write to a common state dictionary. This prevents the "Telephone Game" effect where data degrades as it passes through the chain. Just make sure your Editor agent has a very strict "Persona" prompt so it doesn't accidentally change the factual data the Researcher found.
How do you deal with token costs when you have three or four agents "talking" to each other? Doesn't the overhead of all those agent-to-agent prompts make this way more expensive than a single prompt?
Start with CrewAI if you want something easy to set up. It’s very intuitive for defining "Roles" and "Tasks." For complex loops, then move to LangGraph.
I second that. CrewAI is perfect for getting a POC (Proof of Concept) up in a weekend. Once you need to handle state and persistence at scale, LangGraph is the logical next step.
Brian, the cost is higher per "task," but the quality is 10x better. To optimize, use a smaller model (like GPT-4o-mini) for the "Manager" agent that just routes tasks, and only use the "big" models (like Claude 3.5 Sonnet) for the actual content generation. We’ve found that specialized agents using cheaper models often outperform a single "Generalist" model because their focus is much narrower. This "Mix of Agents" strategy is the current industry gold standard for cost-effective AI.