Chuyển đến nội dung
Skillpedia
Agent48k · #5256

multi-agent-architect

Skill này làm gì

Agent AI này giúp xây dựng và cải thiện các hệ thống AI phức tạp gồm nhiều agent. Nó dùng các công cụ như LangGraph và LangChain để tổ chức công việc giữa các agent AI khác nhau, đảm bảo chúng giao tiếp và phối hợp hiệu quả để đạt mục tiêu.

Khi nào nên dùng

  • ✓Khi tạo một hệ thống AI nhiều agent từ đầu.
  • ✓Khi tổ chức giao tiếp và quy trình làm việc giữa các agent AI.
  • ✓Khi gỡ lỗi hoặc tối ưu một hệ thống AI hiện có dùng LangGraph hoặc LangChain.

Liên kết skill

https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/multi-agent-architect/SKILL.md

Sao chép rồi dán vào AI của bạn (Claude, ChatGPT hoặc Cursor) và nhờ nó làm theo hướng dẫn.

Cách dùng

Cách dễ nhất: sao chép tin nhắn và dán vào AI của bạn. AI sẽ đọc skill và làm theo hướng dẫn.

Tin nhắn có sẵn để dán

Hãy dùng skill này để giúp tôi: https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/multi-agent-architect/SKILL.md Đọc tệp SKILL.md tại liên kết đó và làm theo hướng dẫn cho việc của tôi.
Bạn muốn AI tự tìm những skill như thế này?Cài MCP Skillpedia miễn phí: chỉ một dòng, và AI sẽ tìm trong 15.000+ skill trước mỗi việc.Cài đặt trong 1 phút →

Ví dụ cách nhờ AI

“Tạo một hệ thống AI với một agent nghiên cứu và một agent lập trình để giúp tôi viết bài báo về năng lượng mặt trời.”

5 skill mới mỗi tuần. Đọc chỉ 1 phút.

Cách hoạt động

Agent định nghĩa vai trò của từng agent (như người giám sát, người nghiên cứu, người lập trình), cách chúng chia sẻ thông tin (state) và cách giao tiếp. Sau đó, nó ghép các phần này thành một 'graph' xác định quy trình làm việc.

Nội dung kỹ thuật (SKILL.md gốc)

Lấy nguyên văn từ GitHub, do tác giả viết bằng tiếng Anh.

Multi-Agent Architect & Updater Skill

Overview

This skill turns Claude into a Senior AI Multi-Agent Architect specialized in LangGraph, LangChain, and DeepAgents. It provides structured workflows for creating and updating production-grade multi-agent systems — including supervisor agents, planners, researchers, coders, and memory-backed autonomous pipelines. Use it whenever you need to design, build, debug, or scale any multi-agent AI system.

If this skill adapts material from an external GitHub repository, declare both:

  • source_repo: owner/repo
  • source_type: official or source_type: community

When to Use This Skill

  • Use when you need to create a new agent or multi-agent workflow from scratch
  • Use when working with LangGraph state graphs, nodes, edges, or conditional routing
  • Use when the user asks about agent communication, memory systems, or tool-calling pipelines
  • Use when debugging or optimizing an existing LangChain/LangGraph agent system
  • Use when architecting supervisor, planner, research, coding, or validation agent roles
  • Use when integrating DeepAgents with hierarchical planning and delegation

How It Works

Step 1: Understand the Goal

Before writing any code, clarify:

  • What is the business objective this agent system must achieve?
  • What agent roles are needed (supervisor, planner, researcher, coder, validator)?
  • What tools does each agent require?
  • What memory strategy is needed (Redis, Vector DB, LangChain Memory)?
  • What communication protocol connects agents (shared state, message passing)?

Step 2: Define the State Schema

All agents share a typed state object passed through the graph:

from typing import TypedDict

class AgentState(TypedDict):
    user_goal: str
    tasks: list[str]
    completed_tasks: list[str]
    next_agent: str
    context: dict
    step_count: int          # guards against infinite loops
    error: str | None

Step 3: Define Agent Nodes

Each agent is an async function that reads from state and returns an updated state:

import logging
from langchain_openai import ChatOpenAI

logger = logging.getLogger(__name__)

async def research_node(state: AgentState) -> AgentState:
    logger.info("research_node: starting")
    llm = ChatOpenAI(model="gpt-4o")
    result = await llm.bind_tools(research_tools).ainvoke(state["user_goal"])
    state["context"]["research"] = result.content
    state["next_agent"] = "coder"
    return state

Step 4: Build the LangGraph

Wire nodes together with edges and conditional routing:

from langgraph.graph import StateGraph, END
from langgraph.prebuilt import ToolNode

def build_graph() -> StateGraph:
    graph = StateGraph(AgentState)

    graph.add_node("supervisor", supervisor_node)
    graph.add_node("research",   research_node)
    graph.add_node("coder",      coding_node)
    graph.add_node("validator",  validation_node)
    graph.add_node("tools",      ToolNode(all_tools))

    graph.set_entry_point("supervisor")

    graph.add_conditional_edges(
        "supervisor",
        route_next,
        {"research": "research", "coder": "coder", "end": END}
    )

    graph.add_edge("research",  "supervisor")
    graph.add_edge("coder",     "validator")
    graph.add_edge("validator", "supervisor")

    return graph.compile()

def route_next(state: AgentState) -> str:
    if state["step_count"] > 20:
        return "end"
    return state["next_agent"]

Step 5: Add Memory

from langchain_community.chat_message_histories import RedisChatMessageHistory

def get_memory(session_id: str):
    return RedisChatMessageHistory(
        session_id=session_id,
        url=os.getenv("REDIS_URL"),
        ttl=3600
    )

Step 6: Run the Graph

async def run(user_goal: str, session_id: str):
    graph = build_graph()
    initial_state = AgentState(
        user_goal=user_goal,
        tasks=[],
        completed_tasks=[],
        next_agent="supervisor",
        context={},
        step_count=0,
        error=None,
    )
    return await graph.ainvoke(initial_state)

Step 7: Expose via FastAPI (optional)

from fastapi import FastAPI
from pydantic import BaseModel

app = FastAPI()

class RunRequest(BaseModel):
    goal: str
    session_id: str

@app.post("/run")
async def run_agent(req: RunRequest):
    result = await run(req.goal, req.session_id)
    return {"result": result}

…

Câu hỏi thường gặp

“Agent” trong ngữ cảnh này là gì?

Agent giống như những công nhân AI chuyên biệt. Mỗi agent có một nhiệm vụ cụ thể, như nghiên cứu thông tin, viết mã hoặc kiểm tra kết quả.

LangGraph và LangChain là gì?

Đây là các công cụ giúp xây dựng và quản lý hệ thống nhiều agent. LangGraph tổ chức quy trình và giao tiếp, còn LangChain giúp kết nối các thành phần AI khác nhau.

Các agent giao tiếp với nhau như thế nào?

Chúng chia sẻ một 'state' chứa thông tin quan trọng, như mục tiêu của người dùng, các việc đã hoàn thành và bối cảnh. Nhờ vậy, mọi agent đều có thông tin cần thiết để làm việc.

Chi tiết

Mô tả gốc của tác giả

Design and optimize production-grade multi-agent systems with LangGraph, LangChain, and DeepAgents for complex AI workflows.

repo: sickn33/agentic-awesome-skills

Độ phổ biến

Sao GitHub
48k
Vị trí xếp hạng
#5256
Giấy phép
MIT
Cập nhật
15/10/2026

Skill này có hữu ích không?

0

Đăng nhập để bình chọn.

Bình luận

  • …

Thêm skill từ kho mã này

Skill tương tự