Event-Driven Multi-Agent Systems: Let Agents Act, Not Wait

AI is no longer just about single-use automation. The real power lies in multi-agent systems, networks of AI agents that work together, each specializing in a task but coordinating as part of a larger, intelligent system.

The fastest way to turn promising multi-agent prototypes into production systems is to make them event-driven. Replace brittle request/response chains with a shared event log and topic-based messaging so agents can react in real time, scale independently, and recover from failure by replay. Four field-tested patterns—orchestrator-worker, hierarchical, blackboard, and market-based—map cleanly onto streams (e.g., Kafka topics) and solve most coordination problems you’ll hit in the wild.

The Challenges of Multi-Agent Collaboration

AI agents don’t operate in isolation.

They need to share context, coordinate actions, and make real-time decisions — all while integrating with external tools, APIs, and data sources. When communication is inefficient, agents end up duplicating work, missing critical updates from upstream agents, or worse, creating bottlenecks that slow everything down.

Beyond communication, multi-agent systems introduce additional scaling challenges:

  • Data Fragmentation — Agents need access to real-time data, but traditional architectures struggle with ensuring consistency without duplication or loss.
  • Scalability and Fault Tolerance — As the number of agents grows, failures become more frequent. A resilient system must adapt without breaking.
  • Integration Overhead — Agents often need to interact with external services, databases, and APIs, but tightly coupled architectures make this difficult to scale.
  • Delayed Decision-Making — Many AI-driven applications, from fraud detection to customer engagement, require real-time responsiveness. But conventional request/response architectures slow this down.

 

Why multi-agent systems struggle in production

Multi-agent AI shines when specialized agents collaborate: one reasons over intent, another calls tools, another validates outputs, another enforces policy. But the moment you wire them together with synchronous calls, you create tight coupling, cascading timeouts, and opaque failure modes—exactly the problems early microservices faced before they moved to events. Agents need to react to what happened, not block each other waiting for RPCs.

Key pain points you’ll see at scale:

  • Communication bottlenecks and tangled dependencies

  • Data staleness and inconsistent context across agents

  • Fragile scaling & fault tolerance when agents come and go

  • Debuggability—it’s hard to reconstruct “who did what, when, and why” without an immutable log of event

These are precisely what event-driven design addresses.

Core idea: Agents as event processors + a shared log

Switch the mental model from “agents calling agents” to agents that consume commands/events and emit new events. Give them:

  • Input: subscriptions to topics (events/commands)

  • Processing: reasoning + tool use + retrieval over state

  • Output: new events (facts, decisions, tool results) appended to the log

With a durable, immutable event log (e.g., Kafka), you gain replay, time-travel debugging, and fan-out (many agents can react to the same event). Loose coupling drops operational complexity and lets you add/remove agents without re-wiring peers.

Four event-driven patterns you can ship today

These patterns come from distributed systems and MAS research, adapted to an event streaming backbone. Use them as building blocks rather than a religion—most real systems combine two or more.

1. Orchestrator-Worker

A central orchestrator breaks work into tasks and publishes them to a commands topic using a keying strategy (e.g., by session or customer). Workers form a consumer group, pull tasks, and publish results to a results topic. Scaling up = adding workers; failure recovery = replay from the last committed offset.

Use when: you need ordered handling per key, clear ownership of “who decides next,” and easy horizontal scale.

2. Hierarchical Agents

A tree of orchestrators: higher-level agents decompose goals into sub-goals for mid-level agents, which orchestrate leaf agents. Each layer is just a specialized orchestrator-worker pattern with its own topics, so you can evolve the tree without bespoke glue code.

Use when: problems decompose naturally (e.g., “Plan → Research → Draft → Review → Approve”).

3. Blackboard (Shared Memory)

Agents collaborate by reading/writing to a shared blackboard topic (or set of topics). Instead of point-to-point calls, each agent posts partial findings and subscribes to the evolving “state of the world.” Add lightweight schema tags (origin, confidence, step) for downstream filtering.

Use when: contributions are incremental and loosely ordered (perception → hypotheses → refinement).

4. Market-Based (Bidding)

Agents “bid” on a task by posting proposals; an aggregator selects winners after N rounds. Moving bids and awards onto topics prevents the O(N²) web of direct connections between solvers and keeps negotiation auditable.

Use when: you want competition among diverse solvers (planning, routing, pricing, ensemble reasoning).

Architecture sketch

At minimum you’ll want:

  1. Topics: agent.commands.*, agent.events.*, agent.results.*, plus domain streams (orders, alerts, leads).

  2. Schemas: JSON/Avro with versioned envelopes (type, source_agent, correlation_id, causation_id, ttl, safety_level, confidence).

  3. State: local caches or stateful processors (Flink/ksqlDB) for per-key context, backed by a durable changelog.

  4. Governance: central registry for schemas, PII tags, retention, and ACLs; redaction at the edge.

  5. Observability: trace by correlation_id; attach decision summaries to each event for auditability and evals.

From request/response to events: a practical migration path

  1. Define the agent interface as events. List the event types each agent consumes and emits. Treat these as public contracts.

  2. Introduce topics alongside your existing RPCs. Start publishing key milestones (task-created, tool-called, output-ready) even while calls remain.

  3. Move coordination out of code and into the stream. Replace “call Agent B, wait” with “publish Need:SummaryDraft and subscribe to SummaryDrafted.”

  4. Add replay-based testing. Re-feed yesterday’s log into a staging cluster to regression-test new agent policies without touching prod.

  5. Evolve toward patterns. As volume and agent count grow, snap into orchestrator-worker or blackboard to keep complexity in check.

Real-world payoffs

  • Parallelism: multiple agents respond to the same event—no coordinator bottleneck.

  • Resilience: if one agent dies, events aren’t lost; it resumes from the last offset.

  • Adaptability: add a new “critic” or “safety” agent by subscribing it to existing topics.

  • Traceability: every decision is a line in the log; audits and RCA stop being archaeology.

Pitfalls & how to avoid them

  • Schema drift → Use a schema registry and contract testing; never break consumers.

  • Unbounded topics → Set retention & compaction by domain (minutes for hot signals, days for ops, long-term in the data lake).

  • Chatty agents → Introduce back-pressure (quotas), batch low-value events, and enforce ttl.

  • Hidden coupling → If an agent can’t act without a specific peer, you’ve snuck in a request/response dependency. Refactor to events.

Example: Minimal event envelope (pseudocode)

When to pick which pattern

  • Highly structured workflowsOrchestrator-Worker

  • Goal decompositionHierarchical

  • Collaborative sense-makingBlackboard

  • Competitive ensemble solvingMarket-Based

In practice, start orchestrator-worker for reliability, add a blackboard for shared context, then scale into hierarchical as teams/features grow

The bottom line

If you’re serious about production-grade agents, architecture matters more than model choice. Event-driven design gives agents the freedom to act while staying coordinated, observable, and resilient—mirroring the same evolution that made microservices workable at scale. Now is the time to formalize your agent interfaces as events and adopt patterns that have already proven themselves in distributed systems.

Further reading

  • Four Design Patterns for Event-Driven, Multi-Agent Systems (Confluent, Feb 19, 2025). Clear, concrete mappings of MAS patterns onto Kafka. Confluent

  • AI Agents Must Act, Not Wait (Medium, Jul 9, 2025). A crisp case for event-driven MAS and the shift away from request/response. Medium

Exploring Claude Code Subagents: A Demo Setup for a RAG-Based Website Project

1. Introduction

Recently, Anthropic released an incredible new feature for its product Claude: subagents — secondary agents with specific tasks for different purposes within a user’s project.

2. Main Content

a. How to Set It Up:
First, install Claude using the following command in your Terminal window:

npm i @anthropic-ai/claude-code

If Claude is already installed but it’s an older version, it won’t have the subagent feature.

to update claude, command : claude update

Launch Claude Code in your working directory, then run the command:
/agents

Press Enter, and a management screen for agents will appear, allowing you to start creating agents with specific purposes for your project.

Here, I will set it up following Claude’s recommendation.

After the setup, I have the following subagents:

I will ask Claude to help me build a website using RAG with the following prompt:

The first subagents have started working.

The setup of the RAG project has been completed.

However, I noticed that the subagent ‘production-code-reviewer (Review RAG system code)’ didn’t function after the coding was completed. It might be an issue with my prompt, so I will ask Claude to review the code for me

After the whole working process, Claude Code will deliver an excellent final product.
Link: https://github.com/mhieupham1/claudecode-subagent

3. Conclusion

Through the entire setup process and practical use in a project, it’s clear how powerful and beneficial the Sub-agents feature introduced by Anthropic for Claude Code is. It enables us to have AI “teammates” with specialized skills and roles that operate independently without interfering with each other — allowing projects to be organized, easy to understand, and efficient.

Combining tmux and Claude to Build an Automated AI Agent System (for Mac & Linux)

1. Introduction

With the rapid growth of AI, multi-agent systems are attracting more attention due to their ability to coordinate, split tasks, and handle complex automation. An “agent” can be an independent AI responsible for a specific role or task.

In this article, I’ll show you how to combine tmux (a powerful terminal multiplexer) with Claude (Anthropic’s AI model) to build a virtual organization. Here, AI agents can communicate, collaborate, and work together automatically via the terminal.

 

2. What is tmux?

tmux lets you split your terminal into multiple windows or sessions, each running its own process independently. Even if you disconnect, these sessions stay alive. This is super useful when you want to run several agents in parallel, each in their own terminal, without interfering with each other.

 

3. What is Claude?

Claude is an advanced language AI model developed by Anthropic. It can understand and respond to text requests, and it’s easy to integrate into automated systems—acting as a “virtual employee” taking on part of your workflow.

 

4. Why combine tmux and Claude?

Parallel & Distributed: Each agent is an independent Claude instance running in its own tmux session.

Workflow Automation: Easily simulate complex workflows between virtual departments or roles.

Easy Debug & Management: You can observe each agent’s logs in separate panes or sessions.

 

5. System Architecture

Let’s imagine a simple company structure:

PRESIDENT: Project Director (sets direction, gives instructions)

boss1: Team Leader (splits up tasks)

worker1, worker2, worker3: Team members (do the work)

Each agent has its own instruction file so it knows its role when starting up.

Agents communicate using a script:

./agent-send.sh [recipient] “[message]”

Workflow:

PRESIDENT → boss1 → workers → boss1 → PRESIDENT

 

6. Installation

Since the code is a bit long, I’ll just share the GitHub link to keep things short.

tmux:
Install guide: tmux Installing Guide

Claude:
Install guide: Claude Setup Guide

Git:
Install guide: Git Download

Clone the project:

bash
git clone https://github.com/mhieupham1/claudecliagent

 

Inside, you’ll find the main folders and files:

CLAUDE.md: Describes the agent architecture, communication, and workflows.

instructions/: Contains guidance for each role.

.claude/: JSON files to manage permissions for bash scripts.

setup.sh: Launches tmux sessions for PRESIDENT, boss1, worker1, worker2, worker3 so agents can talk to each other.

agent-send.sh: Script for sending messages between agents.

 

7. Deployment

Run the setup script:

bash
./setup.sh
This will create tmux sessions for PRESIDENT and the agents (boss1, worker1, worker2, worker3) in the background.

To access the PRESIDENT session:

bash
tmux attach-session -t president


To access the multiagent session:

bash
tmux attach-session -t multiagent


In the PRESIDENT session, run the claude command to set up the Claude CLI.

Do the same for the other agents.

Now, in the PRESIDENT window, try entering a request like:

you are president. create a todo list website now
PRESIDENT will start the to-do list. PRESIDENT will send instructions to boss1, boss1 will assign tasks to worker1, worker2, and worker3.

You can watch boss1 and the workers do their jobs, approve commands to create code files, and wait for them to finish.

Result:

8. Conclusion

Combining tmux and Claude lets you create a multi-agent AI system that simulates a real company: communicating, collaborating, and automating complex workflows. Having each agent in its own session makes it easy to manage, track progress, and debug.

This system is great for AI research, testing, or even real-world workflow automation, virtual team assistants, or teamwork simulations.

If you’re interested in developing multi-agent AI systems, try deploying this model, customize roles and workflows to your needs, and feel free to contribute or suggest improvements to the original repo!

Bước tiến của AI Agent: Khả năng lập luận, lập kế hoạch, thực thi trong kỷ nguyên mới

Xin chào các bạn, tôi là Quỳnh Nga!

AI đang là một chủ đề cực kỳ nóng hổi, thu hút sự quan tâm trên toàn cầu. Hòa cùng tinh thần “tự học” sôi nổi tại công ty, tuần này tôi đã tìm hiểu về Bước tiến của AI Agent trong kỷ nguyên mới – một chủ đề đầy thú vị và hứa hẹn nhiều đột phá. Hãy cùng khám phá trong bài viết này nhé!

1. Khả năng và hạn chế hiện tại của các hệ thống AI Agent

AI Agent, hay tác tử AI, đang nổi lên như một bước tiến quan trọng trong lĩnh vực trí tuệ nhân tạo. Không còn dừng lại ở những tác vụ đơn giản, AI Agent được thiết kế để thực hiện các mục tiêu phức tạp, đòi hỏi khả năng lập luận, lập kế hoạch và tương tác với môi trường bên ngoài thông qua các công cụ (tool).

Khả năng

  • Lập luận (Reasoning): Các AI Agent hiện đại, đặc biệt là những agent dựa trên mô hình ngôn ngữ lớn (LLM), có khả năng suy luận logic, giải quyết vấn đề và đưa ra quyết định dựa trên thông tin đầu vào.
  • Lập kế hoạch (Planning): AI Agent có thể xây dựng kế hoạch hành động chi tiết để đạt được mục tiêu, bao gồm việc chia nhỏ mục tiêu lớn thành các nhiệm vụ nhỏ hơn, sắp xếp thứ tự thực hiện và điều chỉnh kế hoạch khi có thông tin mới.
  • Gọi công cụ (Tool Calling): Khả năng tương tác với các công cụ bên ngoài (ví dụ: API, cơ sở dữ liệu, ứng dụng) cho phép AI Agent mở rộng phạm vi hoạt động, truy cập thông tin và thực hiện các hành động trong thế giới thực.
  • Tự học và Thích ứng: Một số AI Agent có khả năng học hỏi từ kinh nghiệm, tự cải thiện hiệu suất và thích ứng với các tình huống mới.

Hạn chế

  • Phụ thuộc vào Dữ liệu Huấn luyện: Hiệu suất của AI Agent phụ thuộc rất nhiều vào chất lượng và số lượng dữ liệu huấn luyện. Dữ liệu thiên vị hoặc không đầy đủ có thể dẫn đến kết quả không chính xác hoặc không mong muốn.
  • Khả năng Giải thích (Explainability): Việc hiểu rõ quá trình ra quyết định của AI Agent, đặc biệt là các agent dựa trên mô hình học sâu (deep learning), vẫn còn là một thách thức lớn.
  • Khả năng Tổng quát hóa (Generalization): AI Agent có thể hoạt động tốt trong các tình huống đã được huấn luyện, nhưng gặp khó khăn khi đối mặt với các tình huống mới, chưa từng gặp.
  • Vấn đề về An toàn và Đạo đức: Cần có các biện pháp kiểm soát chặt chẽ để đảm bảo AI Agent hoạt động an toàn, tuân thủ các quy tắc đạo đức và không gây hại cho con người.

2. Những hiểu biết sâu sắc từ việc quan sát các hệ thống AI Agent trong thực tế

Sơ đồ phương pháp AutoGPT+P

Việc triển khai AI Agent trong các ứng dụng thực tế đã mang lại nhiều bài học quý giá:

  • Tầm quan trọng của ngữ cảnh: Hiệu suất của AI Agent phụ thuộc rất nhiều vào ngữ cảnh cụ thể của ứng dụng. Việc hiểu rõ yêu cầu, ràng buộc và mục tiêu của bài toán là yếu tố then chốt để thiết kế và triển khai AI Agent thành công.
  • Sự tương tác giữa Con người và AI Agent: Trong nhiều trường hợp, sự hợp tác giữa con người và AI Agent mang lại kết quả tốt nhất. Con người có thể cung cấp hướng dẫn, giám sát và can thiệp khi cần thiết, trong khi AI Agent đảm nhận các tác vụ lặp đi lặp lại, tốn thời gian hoặc đòi hỏi khả năng xử lý dữ liệu lớn.
  • Vòng lặp phản hồi (Feedback Loop): Việc thu thập phản hồi từ người dùng và môi trường là rất quan trọng để cải thiện hiệu suất của AI Agent. Phản hồi có thể được sử dụng để điều chỉnh kế hoạch, cập nhật kiến thức và khắc phục các lỗi sai.
  • Tính linh hoạt và khả năng mở rộng: Các hệ thống AI Agent cần được thiết kế để có thể dễ dàng thích ứng với các thay đổi trong môi trường, yêu cầu của người dùng và sự phát triển của công nghệ.

3. Những cân nhắc quan trọng cho sự phát triển AI Agent trong tương lai

Để AI Agent có thể phát huy hết tiềm năng, cần tập trung vào các khía cạnh sau:

  • Nghiên cứu về các kiến trúc AI Agent mới: Cần tiếp tục khám phá các kiến trúc AI Agent tiên tiến, kết hợp các phương pháp học máy khác nhau (ví dụ: học tăng cường, học sâu, học quy nạp) để nâng cao khả năng lập luận, lập kế hoạch và ra quyết định.
  • Phát triển các công cụ và Framework hỗ trợ: Cần có các công cụ và framework mạnh mẽ để giúp các nhà phát triển xây dựng, kiểm thử và triển khai AI Agent một cách dễ dàng và hiệu quả.
  • Tăng cường khả năng Giải thích và tính Minh bạch: Cần có các phương pháp để làm cho quá trình ra quyết định của AI Agent trở nên dễ hiểu hơn đối với con người, giúp tăng cường sự tin tưởng và chấp nhận của người dùng.
  • Đảm bảo An toàn và Đạo đức: Cần có các quy tắc, tiêu chuẩn và cơ chế kiểm soát để đảm bảo AI Agent hoạt động an toàn, không gây hại và tuân thủ các giá trị đạo đức của xã hội.
  • Nghiên cứu về tương tác giữa Con người và AI Agent: Cần hiểu rõ hơn về cách con người và AI Agent có thể hợp tác hiệu quả, tận dụng thế mạnh của cả hai bên để giải quyết các vấn đề phức tạp.

4. So sánh và đối chiếu kiến trúc Single-Agent và Multi-Agent

Có hai kiến trúc chính cho AI Agent: Single-Agent (tác tử đơn) và Multi-Agent (đa tác tử). Mỗi loại có ưu điểm và nhược điểm riêng, phù hợp với các loại bài toán khác nhau.

  • Single-Agent:
    • Ưu điểm: Đơn giản, dễ triển khai, phù hợp với các bài toán có phạm vi hẹp, yêu cầu rõ ràng.
    • Nhược điểm: Khó giải quyết các bài toán phức tạp, đòi hỏi sự phối hợp của nhiều tác tử. Khó khăn trong việc mở rộng và thích ứng với các thay đổi.
    • Ví dụ: ReAct, RAISE, Reflexion, AutoGPT + P, LATS. (Xem Hình 2 ở trang 5, Hình 3 ở trang 5, Hình 4 ở trang 6 để biết thêm chi tiết).

Một ví dụ về phương pháp ReAct so với các phương pháp khác

  • Multi-Agent:
    • Ưu điểm: Có thể giải quyết các bài toán phức tạp, đòi hỏi sự phối hợp của nhiều tác tử. Dễ dàng mở rộng và thích ứng với các thay đổi. Tăng cường khả năng phục hồi và độ tin cậy.
    • Nhược điểm: Phức tạp hơn, khó triển khai hơn. Đòi hỏi cơ chế giao tiếp và phối hợp giữa các tác tử.
    • Phân loại:
      • Kiến trúc dọc (Vertical Architectures): Có một tác tử lãnh đạo điều phối các tác tử khác.
      • Kiến trúc ngang (Horizontal Architectures): Các tác tử bình đẳng, giao tiếp trực tiếp với nhau.

 

  • Ví dụ: Embodied LLM Agents Learn to Cooperate in Organized Teams, DyLAN, AgentVerse, MetaGPT.

Đội ngũ AI Agent với trưởng nhóm được chỉ định rõ ràng sẽ có hiệu năng cao hơn.

 

Sơ đồ phương pháp AgentVerse

5. Tầm quan trọng của Reasoning, Planning và Tool Calling trong hệ thống AI Agent

Sơ đồ thể hiện phương pháp RAISE

Reasoning (lập luận), Planning (lập kế hoạch) và Tool Calling (gọi công cụ) là ba thành phần cốt lõi của một hệ thống AI Agent mạnh mẽ.

  • Reasoning: Cho phép AI Agent suy luận logic, giải quyết vấn đề và đưa ra quyết định dựa trên thông tin đầu vào.
  • Planning: Cho phép AI Agent xây dựng kế hoạch hành động chi tiết để đạt được mục tiêu.
  • Tool Calling: Cho phép AI Agent tương tác với môi trường bên ngoài, truy cập thông tin và thực hiện các hành động.

Sự kết hợp của ba thành phần này cho phép AI Agent giải quyết các bài toán phức tạp trong thế giới thực, vượt xa khả năng của các hệ thống AI truyền thống.

6. Kết luận

AI Agent đang mở ra một kỷ nguyên mới cho trí tuệ nhân tạo, với tiềm năng ứng dụng rộng rãi trong nhiều lĩnh vực. Tuy nhiên, vẫn còn nhiều thách thức cần vượt qua, bao gồm việc cải thiện khả năng lập luận, lập kế hoạch, gọi công cụ, tăng cường khả năng giải thích, đảm bảo an toàn và đạo đức, và phát triển các kiến trúc AI Agent tiên tiến. Việc giải quyết những thách thức này sẽ giúp AI Agent trở thành một công cụ mạnh mẽ, hỗ trợ con người giải quyết các vấn đề phức tạp và thúc đẩy sự phát triển của xã hội.