Skip to main content

LangGraph + Gemini Skills System

파일 기반 동적 스킬 로딩 시스템 for LangGraph and Gemini API

특징

  • 📁 /skills/스킬이름/SKILLS.md 파일 기반 동적 스킬 로딩
  • 🚀 LangGraph를 활용한 워크플로우 관리
  • 🤖 Gemini API Function Calling 통합
  • 📊 스킬 등록 현황 자동 표시
  • 🔄 실시간 스킬 리로드 지원

프로젝트 구조

skills_example/
├── run.py                  # 메인 실행 스크립트 (진입점)
├── core/                   # 핵심 모듈
│   ├── base.py             # BaseSkill 추상 클래스
│   ├── loader.py           # 마크다운 기반 스킬 동적 로더
│   ├── registry.py         # 스킬 등록/관리 레지스트리
│   └── orchestrator.py     # LangGraph 워크플로우 오케스트레이터
├── skills/                 # 스킬 정의 디렉토리
│   ├── builtin.py          # 내장 스킬 (파일읽기, 터미널, 디렉토리조회)
│   └── sample/
│       └── SKILLS.md       # 샘플 스킬 (날씨 조회)
├── utils/
│   └── logger.py           # 스킬 실행 로깅 유틸리티
├── examples/
│   └── sample_skill.py     # 스킬 작성 예제
├── .env                    # 환경 변수 (API 키 등)
├── requirements.txt        # Python 의존성
└── setup.py                # 패키지 설정

동작 흐름

사용자 입력
    ↓
parse_intent (Gemini가 의도 분석 + Function Calling)
    ↓
[조건부 라우팅]
    ├→ execute_skills (스킬 실행 필요 시 → 병렬 실행)
    └→ generate_response (스킬 불필요 시 → 직접 응답)
    ↓
generate_response (결과 종합 → 최종 응답 생성)
    ↓
사용자에게 응답 출력

설치

uv pip install -r requirements.txt

환경 설정

.env 파일에 아래 항목을 설정합니다:

GEMINI_API_KEY=your_api_key_here
GEMINI_MODEL=gemini-3-flash-preview
SKILLS_ROOT=./skills
LOG_LEVEL=INFO

실행

venv/Scripts/activate
python run.py

실행 후 대화형 프롬프트가 나타나며, 자연어로 명령을 입력할 수 있습니다. 종료 시 quit, exit, bye, 종료 중 하나를 입력합니다.

내장 스킬

스킬 이름 설명
FileReadSkill read_file 파일 내용 읽기
TerminalSkill run_terminal 터미널 명령어 실행 (30초 타임아웃)
ListDirectorySkill list_directory 디렉토리 파일/폴더 목록 조회

커스텀 스킬 추가

skills/ 디렉토리에 새 폴더를 만들고 SKILLS.md 파일을 작성합니다:

---
name: my_skill
description: 스킬 설명
version: 1.0.0
author: 작성자
dependencies: 필요한패키지
---

# My Skill

스킬에 대한 설명

## Parameters

- `param1`: 파라미터 설명

```python
class MySkill(BaseSkill):
    def __init__(self):
        super().__init__(name="my_skill", description="스킬 설명")

    async def execute(self, param1: str, **kwargs) -> str:
        return f"결과: {param1}"

    def _get_parameters(self) -> Dict:
        return {
            "type": "object",
            "properties": {
                "param1": {
                    "type": "string",
                    "description": "파라미터 설명"
                }
            },
            "required": ["param1"]
        }
`` `

시스템 재시작 없이 자동으로 로드됩니다.

기술 스택

  • Python 3.8+
  • LangGraph — 상태 기반 워크플로우 관리
  • Google Gemini API (google-genai SDK) — 의도 분석 및 Function Calling
  • Pydantic — 데이터 검증

Metadata

Release files for langgraph-skills 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for langgraph-skills 0.1.0
File Size Uploaded
langgraph_skills-0.1.0.tar.gz 20.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for langgraph-skills 0.1.0
File Interpreter ABI Platform
langgraph_skills-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 38.4 kB

Release files / langgraph_skills-0.1.0.tar.gz

Download URL langgraph_skills-0.1.0.tar.gz
Size 20.2 kB
Tags Source
SHA-256 checksum
How to use checksums
4f58c297e804730f1284b3de84908bd94459d4913cdaa5327b2aaece5140f82a
BLAKE2b-256 checksum
How to use checksums
2e9de4eb9ef34cbc0f1936aead76447ad4525740903ee4735d26cb40fb3352d4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.11.9

Release files / langgraph_skills-0.1.0-py3-none-any.whl

Download URL langgraph_skills-0.1.0-py3-none-any.whl
Size 18.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
3ea482bcfd2e81fb4c5a416ffbd8b0a57f4e1c3e9ae8b84b0c4c41275100b88c
BLAKE2b-256 checksum
How to use checksums
b313bf02d124c60f3e9176b2b6308600117c886b2d365c7e7178e1d5a73cafd9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.11.9

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page