Hermes Agent: Profile設定

最終更新:2026-08-31

ProfileはHermes AgentのユーザーIDです。異なる人には異なる嗜好があり、Profileにより1つのエージェントが複数人にサービスを提供する際、それぞれが自分のメモリ、スキル、スタイルを持てます。

💡 ヒント: Profileはユーザーの基本情報だけでなく、独立したメモリ空間、スキルセット、ユーザープロファイル、プラットフォーム嗜好も関連付けます。マルチユーザーシナリオでは、Profile分離がプライバシーを確保します。

📋 前提知識: 第6課 メモリシステム

1. 学ぶ内容

# 内容
Profileの概念と構造
Profileの作成と管理
マルチユーザー分離の仕組み
チームProfileと共有
Profileの移行とバックアップ

2. ストーリー

(1) 課題:チームで1つのBotを共有すると相互干渉

Bobと同僚が1つのTelegram Botを共有しているが、Bobは中国語が好み、同僚は英語。Bobのプロジェクトはフロントエンド、同僚はバックエンド。エージェントが混同してしまう。

(2) 解決策:ユーザーごとにProfile

BASH
# BobのProfile
hermes chat --user bob
> こんにちはBob!嗜好: React + TypeScript + 中国語

# 同僚のProfile
hermes chat --user carol
> Hi Carol! Preference: Python + FastAPI + English

3. Profile構造

(1) Profileファイル

YAML
# ~/.hermes/profiles/bob.yaml
user:
  id: "bob"
  name: "Bob"
  language: "ja"
  timezone: "Asia/Tokyo"
  
preferences:
  tech_stack:
    - "React"
    - "TypeScript"
    - "Tailwind CSS"
  code_style: "concise"
  communication: "direct"
  
model:
  default: "gpt-4o"
  temperature: 0.7
  
personality:
  tone: "friendly"
  verbosity: "balanced"
  
platforms:
  telegram:
    chat_id: 123456789
  slack:
    user_id: "U12345"
    
skills:
  custom:
    - "react-component-review"
    - "git-commit-helper"
  disabled:
    - "java-code-review"
    
memory:
  isolated: true        # 独立メモリ空間
  share_with: []        # 他ユーザーと共有しない

4. Profile管理

(1) コマンドライン操作

BASH
# Profileの作成
hermes profile create --name "bob"

# インタラクティブ作成
hermes profile create --interactive
? 名前: Bob
? 言語: ja
? デフォルトモデル: gpt-4o
? 技術スタック: React, TypeScript
? コミュニケーションスタイル: 簡潔・直接的

# 全Profile一覧
hermes profile list

# Profileの切り替え
hermes profile switch bob

# 現在のProfileの確認
hermes profile show

# Profileの編集
hermes profile edit bob

# Profileの削除
hermes profile delete bob

(2) 会話中の管理

BASH
me: /profile
Agent: 現在のProfile: Bob
  言語: ja | モデル: gpt-4o | 技術スタック: React, TypeScript
  
me: /profile switch carol
Agent: CarolのProfileに切り替えました
  言語: en | モデル: claude-3.5-sonnet | 技術スタック: Python, FastAPI

5. マルチユーザー分離の仕組み

(1) データ分離

~/.hermes/
├── profiles/
│   ├── bob.yaml           # BobのProfile
│   ├── carol.yaml         # CarolのProfile
│   └── team-frontend.yaml # チームProfile
├── memory/
│   ├── bob/               # Bobの独立メモリ
│   │   ├── working/
│   │   ├── long_term/
│   │   └── user_model/
│   └── carol/             # Carolの独立メモリ
│       ├── working/
│       ├── long_term/
│       └── user_model/
└── skills/
    ├── bob/               # Bobのカスタムスキル
    └── carol/             # Carolのカスタムスキル

(2) 分離ルール

データ 分離レベル 説明
メモリ 完全分離 各ユーザーに独立メモリ空間
スキル 選択的分離 カスタムスキルは分離、組み込みスキルは共有
ユーザープロファイル 完全分離 Honchoが各ユーザーをモデリング
設定 選択的分離 グローバル設定をオーバーライド可能
プラットフォーム紐付け 完全分離 各ユーザーのプラットフォームアカウントに紐付け

6. チームProfileと共有

(1) チームProfile

YAML
# ~/.hermes/profiles/team-frontend.yaml
user:
  id: "team-frontend"
  name: "Frontend Team"
  type: "team"

shared:
  skills:
    - "react-component-review"
    - "eslint-rules"
    - "deploy-frontend"
  memory:
    categories:
      - "team-conventions"    # チームルール(共有)
      - "project-info"        # プロジェクト情報(共有)
  conventions:
    code_style: "ESLint + Prettier"
    commit_style: "Conventional Commits"
    review_checklist:
      - "TypeScript strict mode"
      - "Accessibility (WCAG 2.1)"
      - "Performance (Lighthouse > 90)"

(2) 共有スキル

BASH
# Aliceがスキルを作成しチームに共有
/learn --share team-frontend コンポーネントレビュー時にチームルールをチェック

# チームメンバーが共有スキルを使用
hermes chat --user bob --team team-frontend
Agent: [チームスキルを読み込み] react-component-review, eslint-rules
       [個人メモリを読み込み] Bobの嗜好とプロジェクト...

7. Profileの移行とバックアップ

(1) エクスポートとインポート

BASH
# Profileのエクスポート(メモリとスキル込み)
hermes profile export bob --include-memory --include-skills

# 出力:bob-profile-20260315.tar.gz
# 内容:profile.yaml + memory/ + skills/

# 別のマシンにインポート
hermes profile import bob-profile-20260315.tar.gz

(2) 同期

BASH
# Git同期(チームでの使用を推奨)
cd ~/.hermes
git init
git remote add origin git@github.com:team/hermes-config.git
git add profiles/ skills/
git commit -m "sync profiles"
git push

# 別のマシンでプル
git pull

❓ よくある質問

Q デフォルトのProfileは何ですか?
A default Profileで、初回hermes init時に作成されます。--userを指定しない場合はデフォルトProfileが使用されます。
Q Profile数に制限はありますか?
A 制限なし。各Profileは独立して保存され、互いに影響しません。
Q 「部分的な共有」を実現するには?
A チームProfileでスキルとルールを共有し、個人Profileで独立したメモリと嗜好を維持。--teamパラメータで重ねて使用します。
Q Profileの切り替えは実行中のタスクに影響しますか?
A 既に実行中のタスクには影響しません。新しい会話には切り替え後のProfileが使用されます。
Q Profile内のAPI Keyは安全ですか?
A API Keyは環境変数または.envファイルに保存され、Profile YAMLには書き込まれません。Profileは変数名のみ参照します。
Q Profileとそのすべてのデータを削除するには?
A hermes profile delete <name> --purgeで、Profileファイル、メモリ、スキルを削除。先にエクスポートでバックアップを推奨。

📖 まとめ


📝 練習問題

  1. 基本(⭐): 個人Profileを作成し、言語嗜好と技術スタックを設定し、エージェントが正しい設定を使用することを確認してください。
  2. 中級(⭐⭐): 2つのProfile(仕事用/個人用)を作成し、異なるシナリオでの自動設定切り替えを実現してください。
  3. 上級(⭐⭐⭐): チームProfileスキームを設計し、共有スキル、チームルール、メンバー別設定を含め、チームコラボレーションを実現してください。
Web-Tutorial.com

Web-Tutorial 技術チーム

複数の開発者によって共同維持されているプログラミングチュートリアルプラットフォーム。各チュートリアルは専門分野の開発者が執筆・レビューしています。正確で信頼性の高いコンテンツを目指しています — 問題を見つけた場合はお知らせください。

100%