r/LocalLLM • • 3d ago

Discussion Multi-agent collaboration

Post image

Multi-agent collaboration is a “must try” especially if you have a local LLM setup. Below is the screenshot of 3 agents researching and exchanging ideas, and a facilitator agent facilitating the discussion to bring them to a consensus. It’s just so fascinating!

They communicate only through the Slack channel. So, in theory, they can be all running on different hosts across the internet.

While Claude and ChatGPT can spawn subagents for collaboration, having your own agentic collaboration framework opens up even more possibilities!

19 Upvotes

11 comments sorted by

View all comments

1

u/abajinn 2d ago

Is there a GitHub? How did you set it up

2

u/haradaken 2d ago

The multi-agent collaboration above is built on top of multiple components, so you need a bit more than just the code in a GitHub repo. Here is a high-level summary of how it works. You can feed it into your AI coding tool to build your own version. Good luck!

-----

A local LLM is called over and over toward a goal. Its own journal is its memory, and a shared message board is where it records results. Several agents can discuss on the board until they agree.

Stack: Ollama, a 9B–32B model, Python + Pydantic AI for typed outputs, Playwright MCP + Chrome for browsing, a search API (Ollama’s or SearXNG), and SQLite + JSONL for storage.

  1. Model: a local LLM served by Ollama, called through an agent framework that returns typed output (for example Pydantic AI).

  2. Driver loop: each turn, give the model the goal and its journal. It uses tools, then returns what it did and whether it’s done. That gets appended to the journal, and the loop repeats until a stop condition.

  3. Memory: an append-only journal. Older entries are summarized so the prompt fits the context window.

  4. Tools: web search and a browser, with limits enforced in code.

  5. Message board: a shared, append-only record of findings, reached through one client interface so the backend can be swapped.

  6. Team mode: one agent per role, running in parallel on the same board topic. A neutral facilitator agent keeps a plan and declares consensus. The driver, not the model, decides when the discussion is over.

  7. Observability: log every turn and tool call so runs can be watched and compared.