Communitygithub.com

AG2 (AutoGen) — 다중 에이전트 대화 프레임워크

AG2(이전 AutoGen) 오픈소스 다중 에이전트 대화 프레임워크 전문가입니다. 도구 사용, 사람 개입, 코드 실행, 그룹 채팅 조정, 중첩 대화 등을 통해 여러 AI 에이전트가 협력하여 소프트웨어 개발, 연구, 데이터 분석과 같은 복잡한 작업을 수행하는 시스템을 구축할 수 있도록 도와드립니다.

AG2 (AutoGen) — 다중 에이전트 대화 프레임워크란 무엇인가요?

이 스킬은 AG2(이전 AutoGen) 다중 에이전트 대화 프레임워크에 대한 깊이 있는 전문 지식을 제공합니다. 개발자들이 구조화된 대화를 통해 여러 AI 에이전트가 협업하는 시스템을 구축할 수 있도록 지원하며, 핵심 기능으로는 이중 에이전트 대화, 그룹 채팅, 도구 사용, 코드 실행, 사람 개입 등을 포함합니다. 이 스킬은 Python 기반으로 `pip install ag2`로 설치 가능하며, 다양한 모델(GPT-4o 등)과 통합됩니다. 주요 사용 사례로는 자율 소프트웨어 개발, 연구 자동화, 데이터 분석, 복잡한 워크플로우 관리가 있습니다. 각 에이전트의 명확한 역할 정의, speaker selection 방법 설정, 종료 조건 구성, Docker 기반 안전한 코드 실행, 도구 등록 시 caller/executor 쌍 지정 등과 같은 모범 사례를 통해 비용 효율적이고 안정적인 다중 에이전트 시스템을 구축할 수 있습니다. 이 스킬은 Claude Code, Cursor와 같은 AI 에이전트 플랫폼에서 활용 가능합니다.

지원 대상~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/TerminalSkills/skills/tree/HEAD/skills/ag2

즐겨 사용하는 AI에게 물어보기

이 에이전트 스킬이 미리 로드된 새 채팅을 엽니다.

문서

AG2 (AutoGen) — 다중 에이전트 대화 프레임워크은(는) 무엇을 하나요?

당신은 AG2(이전 AutoGen) 오픈소스 다중 에이전트 대화 프레임워크 전문가입니다. 도구 사용, 사람 개입, 코드 실행, 그룹 채팅 조정, 중첩 대화 등을 통해 여러 AI 에이전트가 협력하여 소프트웨어 개발, 연구, 데이터 분석과 같은 복잡한 작업을 수행하는 시스템을 구축할 수 있도록 도와드립니다.

핵심 기능

이중 에이전트 대화

from autogen import ConversableAgent, UserProxyAgent

# AI 어시스턴트 에이전트
assistant = ConversableAgent(
    name="Engineer",
    system_message="""당신은 시니어 소프트웨어 엔지니어입니다.
    깨끗하고 테스트된 Python 코드를 작성하세요. 설계 결정을 설명하세요.""",
    llm_config={"model": "gpt-4o", "temperature": 0.2},
)

# 사용자 프록시 (자동 승인 또는 사람 입력 필요)
user_proxy = UserProxyAgent(
    name="User",
    human_input_mode="NEVER",             # NEVER / ALWAYS / TERMINATE
    max_consecutive_auto_reply=10,
    is_termination_msg=lambda msg: "TERMINATE" in msg.get("content", ""),
    code_execution_config={
        "work_dir": "workspace",
        "use_docker": True,               # Docker에서 안전한 코드 실행
    },
)

# 대화 시작 — 작업이 완료될 때까지 에이전트 대화
result = user_proxy.initiate_chat(
    assistant,
    message="JWT를 사용한 사용자 인증이 포함된 FastAPI 앱을 만드세요. 테스트를 포함하세요.",
)
# 엔지니어가 코드 작성 → 사용자 프록시 실행 → 엔지니어가 출력 검토 → 반복

그룹 채팅 (다중 에이전트)

from autogen import GroupChat, GroupChatManager

# 전문 에이전트들
architect = ConversableAgent(
    name="Architect",
    system_message="시스템 아키텍처를 설계합니다. 확장성, 신뢰성, 깔끔한 인터페이스에 집중하세요.",
    llm_config={"model": "gpt-4o"},
)

developer = ConversableAgent(
    name="Developer",
    system_message="아키텍트의 설계를 기반으로 기능을 구현합니다. 프로덕션 품질의 코드를 작성하세요.",
    llm_config={"model": "gpt-4o"},
)

reviewer = ConversableAgent(
    name="Reviewer",
    system_message="버그, 보안 문제, 모범 사례에 대해 코드를 검토합니다. 철저하지만 건설적으로 하세요.",
    llm_config={"model": "gpt-4o"},
)

tester = ConversableAgent(
    name="Tester",
    system_message="포괄적인 테스트를 작성합니다. 엣지 케이스와 통합 시나리오를 다루세요.",
    llm_config={"model": "gpt-4o"},
)

# 라운드 로빈 또는 AI 선택 발언자를 사용한 그룹 채팅
group_chat = GroupChat(
    agents=[user_proxy, architect, developer, reviewer, tester],
    messages=[],
    max_round=20,
    speaker_selection_method="auto",      # LLM이 컨텍스트에 따라 다음 발언자 선택
)

manager = GroupChatManager(groupchat=group_chat, llm_config={"model": "gpt-4o"})

user_proxy.initiate_chat(
    manager,
    message="WebSocket 지원, Redis pub/sub, 속도 제한이 있는 실시간 알림 서비스를 구축하세요.",
)
# 아키텍트 설계 → 개발자 구현 → 리뷰어 이슈 발견 → 수정 → 테스터가 테스트 추가

도구 사용

from autogen import register_function

def search_codebase(query: str, file_pattern: str = "*.py") -> str:
    """특정 패턴에 대해 코드베이스를 검색합니다.

    Args:
        query: 검색 쿼리 (정규식 지원)
        file_pattern: 검색할 파일 글로브 패턴
    """
    import subprocess
    result = subprocess.run(["grep", "-rn", query, "--include", file_pattern, "."],
                           capture_output=True, text=True)
    return result.stdout[:2000]

def run_tests(test_path: str = "tests/") -> str:
    """지정된 테스트 디렉토리에서 pytest를 실행합니다.

    Args:
        test_path: 테스트 파일 또는 디렉토리 경로
    """
    import subprocess
    result = subprocess.run(["python", "-m", "pytest", test_path, "-v", "--tb=short"],
                           capture_output=True, text=True)
    return f"STDOUT:\n{result.stdout}\nSTDERR:\n{result.stderr}"

# 특정 에이전트에 도구 등록
register_function(search_codebase, caller=developer, executor=user_proxy,
    description="코드베이스에서 코드 패턴 검색")
register_function(run_tests, caller=tester, executor=user_proxy,
    description="테스트를 실행하여 코드 정확성 확인")

설치

pip install ag2                           # Or: pip install pyautogen

모범 사례

  1. 명확한 시스템 메시지 — 각 에이전트의 역할을 정확하게 정의하세요. 모호한 지시는 집중되지 않은 대화로 이어집니다.
  2. 발언자 선택 — 그룹 채팅에서는 auto를 사용하여 LLM이 발언자를 선택하게 하고, 예측 가능한 흐름이 필요하면 round_robin을 사용하세요.
  3. 종료 조건 — is_termination_msg와 max_consecutive_auto_reply를 설정하여 무한 루프를 방지하세요.
  4. 코드 실행을 위한 Docker — 안전한 코드 실행을 위해 use_docker: True를 활성화하세요. 에이전트가 신뢰할 수 없는 코드를 실행할 수 있습니다.
  5. 사람 개입 — 중요한 액션에 승인이 필요하면 TERMINATE 모드를, 완전 자동화에는 NEVER를 사용하세요.
  6. 도구 등록 — 특정 caller/executor 쌍으로 도구를 등록하세요. 모든 에이전트가 모든 도구를 필요로 하지는 않습니다.
  7. 중첩 채팅 — 하위 작업에 중첩 대화를 사용하세요. 에이전트가 측면 대화를 생성하고 결과를 반환할 수 있습니다.
  8. 비용 제어 — max_round와 max_consecutive_auto_reply를 설정하고, 그룹 채팅에서 토큰 사용량을 모니터링하세요.

Individual skills in this repo

This repo contains 20 individual skills — each has its own dedicated page.

TerminalSkills/skills

>- Run GitHub Actions locally with act. Use when a user asks to test GitHub Actions workflows locally, debug CI pipelines without pushing, or run workflows offline.

TerminalSkills/skills

>- Generate short-form videos with AI — script writing, text-to-speech narration, stock footage selection, subtitle generation, and video assembly. Use when: creating TikTok/YouTube Shorts/Reels content, automating video production, building content pipelines.

TerminalSkills/skills

>- Animate 3D objects and characters in Blender with Python. Use when the user wants to keyframe properties, create armatures and rigs, set up IK/FK chains, animate shape keys for facial animation, edit F-Curves, use the NLA editor to blend actions, add drivers for expression-based animation, or script any animation workflow in Blender.

TerminalSkills/skills

>- Automate motion capture and tracking workflows in Blender with Python. Use when the user wants to import BVH or FBX mocap data, retarget motion to armatures, track camera or object motion from video, solve camera motion, clean up motion capture data, or script any tracking pipeline in Blender.

TerminalSkills/skills

>- You are an expert in Bolt.new by StackBlitz, the AI-powered full-stack development environment that runs entirely in the browser. You help developers go from idea to deployed app in minutes using natural language prompts — Bolt generates complete applications with frontend, backend, database, and deployment, all running in a WebContainer without local setup.

TerminalSkills/skills

>- Assists with using Bun as an all-in-one JavaScript/TypeScript runtime, package manager, bundler, and test runner. Use when building HTTP servers, managing packages, running tests, or migrating from Node.js. Trigger words: bun, bun serve, bun install, bun test, bun build, javascript runtime, bun runtime.

TerminalSkills/skills

>- Self-host customer support with Chatwoot. Use when a user asks to set up open-source customer support, add live chat without SaaS costs, build a multi-channel inbox, or deploy a free Intercom alternative.

TerminalSkills/skills

>- You are an expert in Chi, the lightweight, idiomatic Go HTTP router built on `net/http`. You help developers build composable HTTP services using Chi's middleware stack, route groups, URL parameters, sub-routers, and context-based request scoping — providing Express-like ergonomics while staying 100% compatible with Go's standard library.

TerminalSkills/skills

When the user wants to edit, review, or improve existing marketing copy. Also use when the user mentions 'edit this copy,' 'review my copy,' 'copy feedback,' 'proofread,' 'polish this,' 'make this better,' or 'copy sweep.' This skill provides a systematic approach to editing marketing copy through multiple focused passes.

TerminalSkills/skills

>- Add live chat and customer support with Crisp. Use when a user asks to add a chat widget, implement live customer support, set up a help desk, create a knowledge base, or add a chatbot to a website.

TerminalSkills/skills

>- Assists with building custom interactive data visualizations using D3.js. Use when creating charts, graphs, maps, force layouts, or hierarchical diagrams that require fine-grained control beyond what charting libraries provide. Trigger words: d3, data visualization, chart, svg, scales, force graph, treemap, choropleth.

TerminalSkills/skills

dbt (data build tool) transforms data in your warehouse using SQL SELECT statements. Learn project setup, models, tests, documentation, incremental materializations, and integration with data warehouses like PostgreSQL, BigQuery, and Snowflake.

TerminalSkills/skills

>- You are an expert in dlt, the open-source Python library for building data pipelines. You help developers load data from any API, file, or database into warehouses and lakes using simple Python decorators — with automatic schema inference, incremental loading, and built-in data contracts. dlt is the "requests library for data pipelines.

TerminalSkills/skills

Data Version Control for ML projects. Track large datasets and models alongside Git, build reproducible ML pipelines, and run experiments with metric comparison. Works with any storage backend including S3, GCS, Azure, and local filesystems.

TerminalSkills/skills

>- You are an expert in E2B, the cloud platform for running AI-generated code in secure sandboxes. You help developers give AI agents the ability to execute code, install packages, read/write files, and run long processes in isolated cloud environments — each sandbox is a lightweight VM that boots in ~150ms with full Linux, filesystem, and networking.

TerminalSkills/skills

>- Transcode, convert, edit, and process audio and video with FFmpeg. Use when a user asks to convert video formats (webm to mp4, mkv to mp4), extract audio from video, compress video files, trim or cut clips, concatenate videos, add subtitles, create thumbnails, apply filters, change resolution or bitrate, re-encode media, create GIFs from video, add watermarks, normalize audio, stream media, or build automated media processing pipelines.

TerminalSkills/skills

>- Create advanced animations with GSAP. Use when building complex timelines, scroll-driven animations, SVG morphing, text animations, or high-performance web animations beyond CSS capabilities.

TerminalSkills/skills

>- Generate deterministic MP4 videos from HTML, CSS, media, and seekable animations using HeyGen's HyperFrames framework. Use when someone asks to "render HTML to video", "make a video with HyperFrames", "create a programmatic video", "turn an animation into MP4", "build a launch/product video from HTML", "render GSAP/Lottie/Three.js to video", or set up an agent-driven video pipeline. Covers init/preview/render/add/lint/inspect commands, data-* timing attributes, animation adapters, and the component catalog.

TerminalSkills/skills

When the user wants to perform load testing, stress testing, or performance testing of APIs and websites using k6. Also use when the user mentions "k6," "load test," "performance test," "stress test," "spike test," "soak test," "thresholds," "virtual users," or "VUs." For browser-based testing, see selenium.

TerminalSkills/skills

>- Lovable (formerly GPT Engineer) is a browser-based AI app builder that turns a natural-language description into a working full-stack web app with a built-in backend, authentication, database and one-click publishing. Use when the user wants to prototype or ship a web app with Lovable, write effective Lovable prompts, connect Supabase or GitHub, review generated security rules, or move a Lovable project into their own editor.

관련 스킬