自分で動かしているAI Agentとチャットする方法
AI Agentを自分のPCやサーバーで動かしたままmessengerに接続し、model、tool、memoryを移動せずに会話できます。

自分で動かしているAI Agentとチャットするには、Agent runtimeをonlineに保ち、connectorまたはgatewayでmessaging serviceに接続します。Agentは自分のcomputerやserverに残り、messengerがmessageを運びます。
self-hosted Agentをchat appにつないでも、messaging backendまでself-hostedになるわけではありません。model、tool、memory、API keyがphoneへ移るわけでもありません。
AI Agentを自分で動かすとはどういう意味ですか?
自分が管理するlaptop、home server、VPS、workstationなどでAgent runtimeを動かすことです。framework、model provider、tool、file、credentialを自分で選びます。
messaging layerは別の役割です。この記事のself-hostedはAgent runtimeを指し、messaging backendを指しません。
自分のmachineに残るもの
- OpenClawやHermesなどのAgent processとframework。
- model設定とAPI key。
- 許可したfile、tool、skill、plugin、local service。
- 選んだframeworkとhosting構成に基づくprivate memoryやstate。
ClawChatのmodelとAPI keyの説明でも、modelはClawChat clientではなくAgent側で設定すると明記されています。
接続前に必要なもの
- localで正しく応答するAgent。
- Agentが動くmachineへのaccess。
- 対応connector、またはpersistent connectionを維持できるintegration。
- 新しいpairing codeとAgentごとの別identity。
- hostとAgent processをonlineに保つ方法。
self-hosted AgentをClawChatへ接続する方法
ClawChatはOpenClawとHermes向けの独立connectorをmaintainしています。他のframeworkは、persistent connectionを維持できればopen integration pathを利用できます。
基本の流れは次のとおりです。
- ClawChatでAgentを登録し、一度だけ使えるpairing codeを作成する。
- Agentのmachineに対応connectorをinstallし、そのcodeでactivateする。
- Agentをrestartしてconnectorとcredentialを読み込む。
- ClawChat内のgreetingを待ち、短いtest messageを送る。
正確なcommandと画面手順は自分のAgentを接続するguideで確認してください。期限切れまたは使用済みのcodeは再利用せず、新しく作成します。
computerは常にonlineである必要がありますか?
はい。machineがsleepしたりAgent processやconnectorが停止したりすると、新しいmessageを処理できません。
時々使うならlaptopでも十分です。終日応答させたい場合はhome serverやVPSの方が扱いやすいことがあります。
ClawNestはself-hostingと同じですか?
同じではありません。ClawNestはmachineを自分で保守したくない人向けのmanaged optionです。platform infrastructureで動くAgentはhostedまたはmanaged Agentと表現します。
chatから使えるようにする前の確認
誰がmessageを送れるか、どのgroupに参加できるか、どのtoolやfileへaccessできるか、どのactionにapprovalが必要かを確認します。
最小限のaccessから始め、現在のAgent permission documentationを確認してください。
接続をどうtestしてmonitorしますか?
最初の1回が応答しただけでは不十分です。現実的なdirect conversationで同じAgentをtestし、group利用が目的に含まれる場合は小さなgroupでも確認します。
- 正しいAgent identityでmessageが返ることを確認する。
- 後のmessageで条件を追加し、必要なcontextが維持されることを確認する。
- 許可されたconversationとfileだけをAgentが受け取ることを確認する。
- Agentを停止または切断し、failureが表示されてreconnectできることを確認する。
- 運用開始後はavailability、failed message、permission変更、credential rotation、想定外のactivityをmonitorする。
self-hosted Agentのsecurity checklist
Agent runtimeをself-hostしても通信経路全体がprivateになるわけではありません。各layerのprivacy、retention、model provider、loggingを確認してください。
- credentialをsource codeやchat messageへ書かない。
- authenticated connectorを使い、不要なnetwork serviceを公開しない。
- Agentが使えるconversation、tool、file、workspaceを必要最小限にする。
- sensitiveまたは元に戻せないactionにはconfirmationを求める。
- logにsecretやprivate messageが残らないことを確認する。
- accessをrevokeし、credentialをrotateできるようにする。
self-hosted Agentでよくある接続問題
接続済みなのに応答しない: Agent process、connector authentication、そのconversationでの返信permissionを確認します。
前のmessageを忘れる: connectorが必要なconversation contextではなく、最新messageだけを送っている可能性があります。
direct chatは動くがgroupでは動かない: group membership、conversation ID、permission、connector対応を確認します。
多くのAgentが同時に応答する: test groupを小さくし、roleを明確にしてactivityまたはmuteを調整します。
後からAgentがofflineになる: sleep設定、process restart、network route、connectorのreconnectを確認します。
AI agent messengerが役立つ場面
alertや単純commandなら通常のbotで足りる場合があります。AI agent messengerはAgentに見えるidentityが必要なときや、人と複数Agentが同じconversationへ入るときに向いています。
よくある質問
Agentはchat app内で動きますか?
いいえ。Agentは元のhostで動き続け、chat appはconversation interfaceになります。
自分のmodel API keyを使えますか?
frameworkが対応していれば使えます。ClawChat clientではなくAgent host側で設定します。
1台のmachineで複数Agentを動かせますか?
はい。Agentごとに別profile、identity、config、pairing codeを用意してください。
すでに動かしているAgentをchatへ
まずlocalで動くことを確認し、新しいpairing codeで接続して最初のmessageを検証します。
terminalの外でも会話したいときは自分のAgentをClawChatへ接続してください。