個人開発のDifyプラグインを、公式マーケットプレイスに載せるまで
日本語の個人情報を伏せるAPI「個人情報黒塗りくん」のDifyプラグインを作り、Dify公式マーケットプレイスに載せてもらいました。プルリクエストを出してからマージまでは約1日でした。
この記事では、プラグインの作りと、動作確認から審査を通るまでに引っかかったところをまとめます。これからDifyプラグインを公開したい人の参考になればうれしいです。
ソースは GitHub で公開しています:mamoruveilworks-hub/kuronurikun-dify-plugin
作ったもの
2つのツールを持つ、ツールプラグインです。
ツール
入力
出力変数
個人情報を伏せる
文章
masked_text、mapping_token、entity_count
個人情報を元に戻す
文章、mapping_token
restored_text
チャットフローでは、次のようにつなぐだけで「LLMに個人情報を渡さず、回答は元の名前に戻す」ボットになります。
開始 → 個人情報を伏せる → LLM → 個人情報を元に戻す → 回答
プラグインを作る前は、HTTPリクエストのブロックとコードのブロックを組み合わせた見本のチャットフローを配っていました。ただ、ブロックが7つになり、JSONの組み立てなどで引っかかる人が多そうでした。プラグインにしたことで、ブロックが5つ(開始と回答を含む)になり、コードを書く必要もなくなりました。
プラグインの構成
kuronurikun-dify-plugin/
├── manifest.yaml # プラグインの情報
├── main.py # 起動するだけ
├── provider/
│ ├── kuronurikun.yaml # APIキーの入力欄の定義
│ └── kuronurikun.py # APIキーの確認
├── tools/
│ ├── mask_pii.yaml / mask_pii.py # 伏せるツール
│ ├── unmask_pii.yaml / unmask_pii.py # 元に戻すツール
│ └── client.py # API を呼ぶ共通処理
├── _assets/icon.svg
├── README.md # 英語(マーケットプレイス用)
├── readme/README_ja_JP.md # 日本語
├── PRIVACY.md
└── requirements.txt
ツールの結果を「出力変数」で返す
ツールの結果を後ろのブロックで使いやすくするため、output_schema で出力変数を定義し、create_variable_message で値を返しています。
tools/mask_pii.yaml(抜粋)
output_schema:
type: object
properties:
masked_text:
type: string
mapping_token:
type: string
entity_count:
type: integer
tools/mask_pii.py(抜粋)
result = post("/v1/mask", self.runtime.credentials.get("api_key", ""), payload)
yield self.create_variable_message("masked_text", result.get("masked_text", ""))
yield self.create_variable_message("mapping_token", result.get("mapping_token") or "")
yield self.create_variable_message("entity_count", len(result.get("entities", [])))
こうしておくと、LLMのブロックで「伏せる」の masked_text を、変数として直接選べます。
APIキーの確認
プラグインを入れた人がAPIキーを保存するとき、_validate_credentials でキーが正しいかを確かめます。料金がかからないように、元に戻すAPIにわざと不正なトークンを送っています。返ってきたのが「キーが無効(401)」か「トークンが不正(400)」かで、キーが正しいかを見分けています。
動作確認:リモートデバッグ
パッケージにする前に、手元のPCで動かしたプラグインを、Difyにつないで試せます。
Difyの「連携」画面の左下にある「デバッグ」を開き、接続先とキーを確認します
プラグインのフォルダに .env を作ります
.env
INSTALL_METHOD=remote
REMOTE_INSTALL_HOST=debug.dify.ai
REMOTE_INSTALL_PORT=5003
REMOTE_INSTALL_KEY=(デバッグ画面に表示されるキー)
python -m main で起動すると、Difyのプラグイン一覧に「デバッグ中」として表示されます
ここで引っかかったのは次の2点です。
handshake failed, invalid key と出る:デバッグ画面を開き直すとキーが変わることがあります。画面のキーと .env のキーが同じか確認します。
ブロックが灰色になり file not found と出る:python -m main を止めると、Difyからはプラグインが消えたように見えます。デバッグ中はウィンドウを開いたままにします。
また、このプラグインは manifest.yaml で Python 3.12 を指定しているので、手元でも 3.12 で動かします。入っていなければ先に入れておきます(Windows なら winget install -e --id Python.Python.3.12)。
動かして分かった不具合
出力変数の名前に text を使うとエラーになる
元に戻すツールは、最初は結果を text という名前の出力変数で返していました。すると、処理そのものは成功しているのに、ブロックが赤いエラー表示になりました。
ツールのブロックは、もともと text・files・json という出力を持っています。そこに同じ名前の変数を返したのが原因でした。名前を restored_text に変えたら直りました。出力変数には、text・files・json 以外の名前を付けるのが安全です。
変数の前後の空白で、トークンが壊れる
元に戻すツールの mapping_token 欄に変数を入れたとき、前後に空白や改行が入ることがあります。トークンの形式チェックで弾かれていたので、受け取った値の前後の空白を取り除くようにしました。また、間違った変数(text や json など)を選んだときは、APIを呼ぶ前に「伏せるブロックの mapping_token を選んでください」と分かるエラーを出すようにしました。
マーケットプレイスに出す準備
公式のチェックツールで先に確かめる
Difyは、マーケットプレイスの審査で使うチェックを dify-marketplace-toolkit として公開しています。提出前にこれで確かめておくと、指摘のやり取りが減ります。私の場合、次の点で引っかかりました。
manifest.yaml に privacy(プライバシーポリシーのファイル)、repo(ソースのURL)、contact(連絡先)が必要
PRIVACY.md が必要。何を送り、何を保存しないかを英語で書く
README.md は英語で書く(コードブロックの外に日本語があると警告)。日本語版は readme/README_ja_JP.md に置く
外部APIに通信するプラグインは、manifest.yaml の network.domains に通信先を書いておく
manifest.yaml(抜粋)
privacy: PRIVACY.md
repo: mamoruveilworks-hub/kuronurikun-dify-plugin
contact: support@kuronurikun.com
network:
domains:
- kuronurikun.com
プルリクエストの本文もチェックの対象です。「Plugin information」「Submission type」「Risk level」「What changed」「Local validation」の見出しが必要で、本文は英語で書きます。
パッケージを作る
dify plugin package ./kuronurikun-dify-plugin
できた .difypkg を、langgenius/dify-plugins をフォークしたリポジトリの kuronurikun/kuronurikun/kuronurikun-0.1.0.difypkg に置いて、プルリクエストを出します。
審査で受けた指摘:パッケージに .git/ が入っていた
プルリクエストを出すと、初めての投稿者の場合は、担当者が許可してから自動チェックが動きます。その結果、次の指摘を受けました。
blocked directory: .git/
dify plugin package は、.git/ を自動では除外しません。Gitで管理しているフォルダをそのままパッケージにすると、.git/ の中身まで入ってしまいます。さらに、ファイルのコピーを何度かやり直した結果、プラグイン一式がもう1つ dify-plugin/ フォルダとして入っていました。
.difyignore に除外するものを書いて、作り直しました。
.difyignore
.git/
.github/
.gitignore
.env
.venv/
pycache/
*.pyc
.pytest_cache/
tests/
*.difypkg
.difypkg の中身は zip なので、提出前に一覧で確かめられます。
tar -tf kuronurikun-0.1.0.difypkg
manifest.yaml や tools/ が一番上にあり、.git/・.env・.venv/ などが入っていなければOKです。特に .env にはデバッグ用のキーが入るので、入っていないことを必ず確認します。
作り直したパッケージを同じブランチにプッシュし、直した内容をコメントで返したところ、翌日にマージされました。
おわりに
振り返ると、時間がかかったのはプラグインのコードよりも、「Difyの中でどう見えるか」の確認と、パッケージの中身の確認でした。
出力変数の名前は text・files・json を避ける
.difyignore に .git/ と .env を書き、tar -tf で中身を見てから出す
公式のチェックツールを、提出前に一度通しておく
この3つを最初から押さえておけば、かなり楽に進められると思います。
プラグインは、Difyのマーケットプレイスで「黒塗りくん」と検索すると出てきます。Difyで社内ボットを作っていて、個人情報の扱いが気になっている方は試してみてください。使い方は kuronurikun.com にまとめています。
8️⃣ Dify
⭐ 158K
Flujos agénticos y apps RAG en una sola plataforma.
🔗 langgenius/dify
5 likes · 64 views
RAG のデスクトップ
1. はじめに
古いPCに、FAISS と Dify を使用したRAG環境を構築します。NVIDIA GeForce などのグラフィックボードを搭載していないため、FAISS は最高性能ではありませんが、個人で使用するには十分です。LLM は、クラウドの OpenAI を使用します。
以前に書いた Docker Desktop、Dify のインストールの記事はこちら。
qiita.com
以前に書いた FAISS のインストールの記事はこちら。今回は NVIDIA ドライバをインストールしません。
qiita.com
qiita.com
RAG を実行するためのアプリケーションは他にもありますが、問い合わせ(テキスト)と登録した文書(テキスト)の、より正確なマッチングを行うために、単にコサイン類似度を計算したいので、FAISS を使用します。
文書の埋め込み(embedding)には、クラウドの OpenAI text-embedding-3-large を使用します。NVIDIA GeForce グラフィックボードを搭載した別のPCで、Alibaba qwen3-embedding-8b のようなローカルの embedding を使用することも可能です。
2. Xubuntu インストール
PC電源投入時、
起動メニュー F12キー
BIOS F2キー
デスクトップの使い易さのために Xubuntu を使用しています。日本語入力をセットアップしますが、画面は英語のままにしています。
xubuntu-26.04.1-desktop-amd64.iso
Rufus を使って起動 USB メモリを作成(DVD からだとアクセスが頻発して正常に動作しなかった)
PCの電源を入れて F12キーを押して USB から立ち上げる
デスクトップに表示される Install Xubuntu 26.04.1 LTS アイコンをダブルクリックして、PCへのインストールを開始
Language: English
Keyboard: Japanese
Connect to the internet: Connect to a Wi-Fi network ※ 先にメニューバーから接続しておく
An update is available for the installer: Update now ※ インストーラーを再開
Interactive installation
Xubuntu Desktop
Erase disk and install Xubuntu
Select drive: sda - 500GB SSD-PSTA/D BUFFALO
No encryption
Your name: webmaster
Your computer's name: noble34
Your username: webmaster
Password: **
Confirm password: **
Select your timezone: Asia/Tokyo
インストールが終わったら、USB メモリを外して起動
OS アップデート
sudo apt-get update
sudo apt-get upgrade
sudo apt-get dist-upgrade
再起動
SSH インストール
sudo apt update
sudo apt install openssh-server
外部から SSH で接続
ssh -l webmaster 192.168.1.41
password: **
Xfce メニュー
メニューから Panel Profiles、Xfce 4.16、Apply Configuration ボタン押下
Application -> Settings -> Xfce Screensaver
60 minutes
Application -> Settings -> Language Support
追加のインストールのためにパスワードを入力
Install / Japanese、Password
但し、画面表示は英語のままで使用する
再起動
ログイン後、バー右上、右クリック、Preference -> Input Method -> Add
Japanese -> Mozc
Preference -> General -> Keyboard Shortcuts
<Super>space から <Control>space に変更、Apply ボタン
バー右上、左クリックで Input Mode を Direct input から Hiragana に変更
固定IP
Wifi 接続の場合は、メニューバー右上でマウス右クリック、Edit Connections から設定する
Address: 192.168.1.34
Netmask: 255.255.255.0
Gateway: 192.168.1.1
DNS: 999.999.99.99, 888.888.888.88 ※プロバイダから入手
再起動
よく使うコマンド
pwd
ls -alF
ip addr show
nano .env(矢印キーでカーソル移動、保存Ctrl+S、終了Ctrl+X)
sudo reboot
sudo shutdown -h now
画面キャプチャ PrtSc、範囲指定 Shift+PrtSc、アクティブウィンドウのみ Ctrl+PrtSc ※ Alt が機能しないため Settings - Keyboard - Application Shortcuts で Ctrl に変更
3. Docker Desktop
下記リンクの手順に従って、Ubuntu に Docker Desktop をインストールします。
docs.docker.com
1.Docker の APT レポジトリの設定
# Add Docker's official GPG key
# Add the repository to Apt sources
2.Docker パッケージのインストール
sudo apt install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
3.hello-world イメージの実行
sudo docker run hello-world
docs.docker.com
sudo apt install gnome-terminal
docker-desktop-amd64.deb をダウンロード
sudo apt-get update
sudo apt install ./docker-desktop-amd64.deb
再起動
メニューから Development > Docker Desktop で起動。または systemctl --user start docker-desktop で起動
ユーザー登録は行わず、skip、skip で Docker Containers の画面が表示される
Docker Desktop のコンテナーのメモリ制限を、2GB(デフォルト)から4GBに変更する
<img src="qiita-image-store.s3.ap-northeast-1.amazonaws.com" width="600">
Docker Desktop の自動起動
Docker Engine は、Xubuntu 標準のものと、Dify のためにインストールした Docker Desktop のものがあります。次のコマンドでどちらを使用しているか確認できます。
docker context ls
webmaster@noble01:~$ docker context ls
NAME DESCRIPTION DOCKER ENDPOINT ERROR
default Current DOCKER_HOST based configuration unix:///var/run/docker.sock
desktop-linux * Docker Desktop unix:///home/webmaster/.docker/desktop/docker.sock
Docker Desktop は、ユーザーがログインした後でないと起動できません。GUI で以下を設定します。
Settings、Session and Startup、Application Autostart
Add
Name: Docker Desktop
Comment: Docker Desktop 起動
Command: /opt/docker-desktop/bin/docker-desktop
Docker Desktop を起動すると、Dify のコンテナが自動的に起動します。
4. Dify
docs.dify.ai
mkdir Repos
cd Repos
git clone --branch 1.18.0 https:\/\/github.com/langgenius/dify.git
cd dify/docker
cp .env.example .env
openssl rand -base64 32
表示されたキーを .env の DIFY_AGENT_LOCAL_SANDBOX_AUTH_TOKEN に記入する
nano .env
docker compose up -d
インストールが完了すると、Docker Desktop で実行中になる
<img src="qiita-image-store.s3.ap-northeast-1.amazonaws.com" width="450">
ブラウザで 192.168.1.34 または localhost を表示
管理者アカウントの設定
Email address
Username
Password
ブラウザで 192.168.1.34 または localhost を表示
Email と Password でログイン
LLMモデルの設定
連携 - モデルプロバイダーをインストール
OpenAI
API Key:****
デフォルトのモデルは gpt-5.4-mini
従来との互換性のために gpt-4o-2024-11-20 を選択
HTTPS 化(手順はこちら)
ドメインを取得し、ホスト名を登録する
ルーターの80と443のポートフォワードを、このPCにする
自分のドメインでこのPCの http:\/\/localhost/ が表示されることを確認する
docker/.env の編集。.env に、説明にある赤字の項目を設定する
コマンドの実行(Docker Desktop が立ち上がっていること)
cd dify/docker
docker compose --profile certbot up --force-recreate -d
コンテナが作成された後に、
docker compose exec -it certbot /bin/sh /update-cert.sh
docker/.env の(再)編集。.env に以下を設定する
NGINX_HTTPS_ENABLED=true
コマンドの実行
docker compose --profile certbot up -d --no-deps --force-recreate nginx
外部から your_domain.com で見れることを確認する
SSL 証明書の更新
docker compose exec -it certbot /bin/sh /update-cert.sh
docker compose exec nginx nginx -s reload
<img src="qiita-image-store.s3.ap-northeast-1.amazonaws.com" width="450">
5. FAISS
Anaconda
anaconda.com
ホームページでメールを登録すると、ダウンロードリンクが届きます
Linux、現在 Python 3.14.4
Anaconda3-2026.07-1-Linux-x86_64.sh
をダウンロード。home ディレクトリにファイルを移動
bash ~/Anaconda3-2026.07-1-Linux-x86_64.sh
./anaconda3/bin/conda init
次のターミナルの起動から、conda 環境(base)になります
<img src="qiita-image-store.s3.ap-northeast-1.amazonaws.com" width="600">
FAISS 用に、Python のバージョンを 3.12 にします
conda create -n faiss python=3.12 -y
conda activate faiss
echo 'conda activate faiss' >> ~/.bashrc
<img src="qiita-image-store.s3.ap-northeast-1.amazonaws.com" width="600">
解除は conda deactivate
ベクトルデータベース(faiss)のインストール
facebookresearch/faiss
事前準備
sudo apt install unzip
faiss-cpu インストール
conda install -c pytorch -c conda-forge faiss-cpu=1.15.1
※ バージョンは FAISS のウェブページに表示されているもの
動作確認のために、faiss のページにある DOWNLOAD ZIP からプログラムコード一式をダウンロードします
<img src="qiita-image-store.s3.ap-northeast-1.amazonaws.com" width="700">
unzip faiss-main.zip
cd faiss-main/tutorial/python
(faiss) webmaster@noble34:~/faiss-main/tutorial/python$ ls -1
1-Flat.py
10-FaissCuvsExample.ipynb
11-SVS.py
2-IVFFlat.py
3-IVFPQ.py
4-GPU.py
5-Multiple-GPUs.py
6-HNSW.py
7-PQFastScan.py
8-PQFastScanRefine.py
9-RefineComparison.py
python 1-Flat.py
True
100000
[[ 0 393 363 78]
[ 1 555 277 364]
[ 2 304 101 13]
[ 3 173 18 182]
[ 4 288 370 531]]
[[7.6293945e-06 7.1751785e+00 7.2076302e+00 7.2511673e+00]
[0.0000000e+00 6.3235664e+00 6.6845779e+00 6.7999382e+00]
[3.8146973e-06 5.7964020e+00 6.3917236e+00 7.2815170e+00]
[3.8146973e-06 7.2779007e+00 7.5279808e+00 7.6628418e+00]
[0.0000000e+00 6.7638016e+00 7.2951088e+00 7.3688126e+00]]
[[ 381 207 210 477]
[ 526 911 142 72]
[ 838 527 1290 425]
[ 196 184 164 359]
[ 526 377 120 425]]
[[ 9900 10500 9309 9831]
[11055 10895 10812 11321]
[11353 11103 10164 9787]
[10571 10664 10632 9638]
[ 9628 9554 10036 9582]]
python 2-IVFFlat.py
[[ 9900 9309 9810 10048]
[11055 10895 10812 11321]
[11353 10164 9787 10719]
[10571 10664 10632 10203]
[ 9628 9554 9582 10304]]
[[ 9900 10500 9309 9831]
[11055 10895 10812 11321]
[11353 11103 10164 9787]
[10571 10664 10632 9638]
[ 9628 9554 10036 9582]]
python 3-IVFPQ.py
[[ 0 78 424 608]
[ 1 555 1063 380]
[ 2 179 304 33]
[ 3 265 527 139]
[ 4 288 531 827]]
[[1.5948839 6.2905183 6.3059173 6.5697308]
[1.282814 5.9320083 5.9512424 6.5773916]
[1.698801 6.1244454 6.2004113 6.401427 ]
[1.82021 6.721145 6.8056335 6.995647 ]
[1.4857421 5.8346977 6.303232 6.400938 ]]
[[ 8746 9380 10914 9842]
[10913 11373 9014 10507]
[10719 11291 10600 11353]
[11578 9671 10709 10664]
[ 9229 9878 9905 9459]]
PostgreSQL インストール
sudo apt update
sudo apt install postgresql postgresql-contrib
psql --version
sudo -i -u postgres
psql
postgres=#
CREATE USER admin WITH PASSWORD '<font color="green">mypassword</font>' SUPERUSER;
CREATE USER webmaster WITH PASSWORD '<font color="green">mypassword</font>';
CREATE DATABASE webmaster OWNER webmaster;
\q
で抜ける
exit
で postgres ユーザーを抜ける
psql -U webmaster -d webmaster -h localhost
CREATE TABLE knowledge_documents (
id UUID PRIMARY KEY,
knowledge_id TEXT NOT NULL,
content TEXT NOT NULL,
title TEXT NOT NULL,
metadata JSONB,
created_at TIMESTAMP DEFAULT now()
);
\q
で抜ける
\d knowledge_documents (テーブル一覧)
\l (データベース一覧)
\c (現在接続しているデータベース)
SELECT * FROM knowledge_documents;
TRUNCATE TABLE knowledge_documents;
faiss_service の作成
次のように作成します。
|項目|ツール|
|---|---|
|文書データベース|PostgreSQL|
|ベクトルデータベース・検索|faiss-cpu|
|埋め込み(Embeddings)|OpenAI API(text-embedding-3-small)<br>ナレッジIDを指定して切り替え可能|
|ウェブサーバー|Python Flask|
# 一旦、通常の Ubuntu 環境に戻す
conda deactivate
sudo apt update
sudo apt install -y build-essential libpq-dev python3-dev
# conda 環境で実行
conda activate faiss
pip install flask psycopg2 openai flasgger ollama
mkdir faiss_service
cd faiss_service
nano faiss_service.py
[faiss_service.py を他のPCからコピーして入手]
LangChain を使用したチャンク分割(upload_files_chunk)は行わないこととし、upload_files_chunk の部分を削除します。また、LangChain の API_KEY も設定しません。
faiss_gpu から faiss_cpu への変更
# 変更前
res = faiss.StandardGpuResources() # use a single GPU
gpu_index = faiss.index_cpu_to_gpu(res, 0, index)
index = faiss.index_gpu_to_cpu(gpu_indexes[knowledge_id])
# 変更後
#res = faiss.StandardGpuResources() # コメントアウトまたは削除
gpu_index = index # 3か所
index = gpu_indexes[knowledge_id] # 1か所
export PSQL_DB_PASSWORD="..."
export OPENAI_API_KEY="..."
python faiss_service.py
<img src="qiita-image-store.s3.ap-northeast-1.amazonaws.com" width="450">
ウェブページを表示
http:\/\/192.168.1.34:8000/apidocs/
<img src="qiita-image-store.s3.ap-northeast-1.amazonaws.com" width="650">
コンテンツエディター
登録済みのコンテンツ(テキスト)を確認・編集するためのウェブページを作成します。[保存して更新]ボタンを押下すると、faiss_service の delete と add を呼び出します(Faiss を使用しているため、登録済みの内容は変更ではなく、再登録します)。
pip install requests
mkdir content_editor
cd content_editor
nano app.py
[app.py を他のPCからコピーして入手]
mkdir templates
nano templates/index.html
nano templates/edit.html
[index.html と edit.html を他のPCからコピーして入手]
[ 実行 ]
export PSQL_DB_PASSWORD="**"
python app.py
[ 表示 ]
localhost
または、
192.168.1.34
(他のPCからIPアドレスを指定)
<img src="qiita-image-store.s3.ap-northeast-1.amazonaws.com" width="450">
<img src="qiita-image-store.s3.ap-northeast-1.amazonaws.com" width="650">
<img src="qiita-image-store.s3.ap-northeast-1.amazonaws.com" width="650">
Ubuntu 起動時に Python プログラムを実行する
参考ページ1:
udemy.benesse.co.jp
cd ~
nano py_app_service.sh
export PSQL_DB_PASSWORD="..."
export OPENAI_API_KEY="..."
/home/webmaster/anaconda3/envs/faiss/bin/python /home/webmaster/faiss_service/faiss_service.py &
/home/webmaster/anaconda3/envs/faiss/bin/python /home/webmaster/content_editor/app.py &
wait
chmod 744 py_app_service.sh
bash py_app_service.sh
参考ページ2:
note.com
cd /etc/systemd/system
sudo nano run_python.service
[Unit]
Description=python run
After=network.target
[Service]
Type=simple
User=webmaster
WorkingDirectory=/home/webmaster/faiss_service
ExecStart=/bin/bash /home/webmaster/py_app_service.sh
Restart=on-failure
KillMode=control-group
[Install]
WantedBy=multi-user.target
※ データファイルを読み込むため、ワーキングディレクトリを faiss_service に設定する
sudo systemctl daemon-reload
sudo systemctl enable run_python.service
sudo systemctl start run_python.service
sudo systemctl status run_python.service
sudo systemctl stop run_python.service
多数のファイルを一度に登録する
faiss_service の画面では、最大20個のファイルを手動で指定し、登録できるようにしています。実際は、別に Python プログラムを作成し、テキストファイル(input.txt)に記述したファイル一覧をもとに、一括登録できるようにしています。input.txt の1行目には、すべてのファイルに共通するナレッジIDを記入し、2行目以降には登録するファイル名を記述します。プログラムは faiss_service.py の upload_files をもとに作成しいますが、ここでは内容を割愛します。
ファイル一覧の作成:
ls *.txt > input.txt
nano input.txt
1行目にナレッジIDを記入
2行目以降はファイル名
python upload_files.py
Dify と FAISS を接続
Dify で外部ナレッジベースの設定を行って、faiss_service に接続します。
ナレッジ
「外部ナレッジベースと連携 →」
<img src="qiita-image-store.s3.ap-northeast-1.amazonaws.com" width="450">
外部ナレッジベース連携APIを追加
API Key は未使用なので ABCdef など
<img src="qiita-image-store.s3.ap-northeast-1.amazonaws.com" width="450"><br>
<img src="qiita-image-store.s3.ap-northeast-1.amazonaws.com" width="450">
外部ナレッジベース名: ローカルRAG
外部ナレッジベースID: AAA-BBB-CCC
「連携 →」ボタン押下
事前準備(以前からの修正)
従来は Dify 1.13.0 を使用していましたが、1.18.0 に変更したところ、以下の対応が必要でした。
SSRF プロキシ対応
cd dify/docker
nano .env
変更前:
SSRF_PROXY_ALLOW_PRIVATE_IPS=
変更後:
SSRF_PROXY_ALLOW_PRIVATE_IPS=192.168.1.34
設定の反映
docker compose up -d --force-recreate ssrf_proxy
確認
docker exec docker-ssrf_proxy-1 \
cat /etc/squid/dify_allow_private.conf
faiss_service.py、retrieval のレスポンスにおける score の型変換
変更前:
records.append({
"score": score
変更後:
records.append({
"score": float(score)
動作確認
スタジオの、テンプレートから作成できるチャットボット(チャットフロー)のサンプルで、[ユーザー入力]と[LLM]の間に、[知識検索]を追加します。
<< LLM のプロンプト >>
あなたは質問応答タスクのためのアシスタントです。
提供されたコンテンツに基づき、重要なポイントを整理し、客観的かつ分かりやすく回答してください。
主観的な断定や過度な推測は避けてください。
コンテンツから複数の候補が見つかった場合、コンテンツを混ぜないで、それぞれで提案してください。
回答は、「コンテンツ」に書かれている内容だけに基づいてください。不明な点は「コンテンツからは確認できません」と書いてください。
コンテンツ:
[知識探索のコンテキスト]
<img src="qiita-image-store.s3.ap-northeast-1.amazonaws.com" width="650">
6. その他
□ ファイアウォール
sudo ufw enable
sudo ufw allow 'Nginx Full'
sudo ufw allow OpenSSH
sudo ufw reload
sudo ufw status
sudo ufw status numbered
sudo ufw delete 3
□ ブルートフォース攻撃対策
sudo apt update
sudo apt install fail2ban
sudo nano /etc/fail2ban/jail.d/sshd.local
[sshd]
enabled = true
backend = systemd
port = ssh
filter = sshd
maxretry = 5
findtime = 600
bantime = 86400
10分間に5回以上SSH認証に失敗したIPアドレスを、24時間遮断する設定になる
sudo systemctl enable --now fail2ban
sudo systemctl restart fail2ban
sudo systemctl status fail2ban
以上、
Dify 1.19.0——ネストしたワークフロートレースと3つの変更が企業運用に何をもたらすか
Dify でワークフローが呼び出す Workflow Tool の中で何が起きているか、今まで「Tool スパンが通った」「Tool スパンが失敗した」しか見えなかった。内部の LLM コールやステップが追えなかった。v1.19.0 でそれが変わった。
> この記事で分かること:
> - Dify 1.19.0(2026-11-04 リリース)の3つの主要変更
> - ネストしたワークフロートレースの仕組みと実務での使い所
> - アップグレード前に確認すべき Docker Compose 2.35.0 以上の要件
Dify 1.19.0 は 2026-11-04 にリリースされた。変更の全容は公式リリースページ(github.com/langgenius/dify/releases/tag/1.19.0%EF… Dify Enterprise を使っている立場から、実務に直結する3か所を整理する。
1. ネストしたワークフロートレース(Nested Workflow Tracing)
変更内容:ワークフロー内で Workflow Tool を呼び出したとき、その内部のステップや LLM コールが外部トレース(Langfuse など)に階層構造で出るようになった。
今まで:
- 外側のワークフロー → Workflow Tool のスパン(通った/失敗した)しか見えない
- Workflow Tool の中で何が起きたか、どの LLM コールが遅かったか、どのステップで詰まったかは追えない
v1.19.0 以降:
- Workflow Tool の呼び出しスパンの下に、内部のステップが階層で並ぶ
- LLM コールのプロンプト・レスポンス・トークン数も確認できる
- ネストした Tool が複数回呼ばれた場合も、各呼び出しが別々のスパンとして残る
注意点:
- 新しいトレース階層は「今後の実行」に適用される。既存の履歴はバックフィルされない
- Workflow Tool の内部ステップが永続化されている必要がある(1.18.0 以降の Console ドリルダウン機能を前提としている)
- ローリングデプロイ中はトレースキューの移行手順(ops_trace → ops_trace_v2)が必要
大企業内で Dify を使っていると、ワークフローが複数の Workflow Tool を呼び出す複雑な構成になることがある。今まで「どの Tool で詰まっているか」を切り分けるのに、ログをひとつひとつ確認する必要があった。ネストトレースが取れると、この調査時間が大きく変わる。
2. Workflow Tools の App パッケージへの同梱(.ifpkg v2)
変更内容:App をエクスポートすると、そのアプリが使っている Workflow Tools も一緒に .ifpkg パッケージに含まれるようになった。
今まで:
- App をエクスポートしても、Workflow Tools の定義は含まれなかった
- 別環境にインポートするとき、Workflow Tools を別途作成・登録する必要があった
v1.19.0 以降:
- .ifpkg(format v2)に Workflow Tools の定義が含まれる
- インポート先で既存の Tool と重複する場合は再利用し、ない場合は作成・公開・登録まで自動で行う
- 推移的な依存(Tool が呼び出す Tool)も含まれる
重要な注意:すべての Dify App エクスポートが format v2 になった。古い v1 のインポーターは受け付けない可能性がある。インポート先も 1.19.0 以上に揃えてからパッケージをインポートすること。
複数の Dify 環境(開発・ステージング・本番)を使っている場合に、この変更の影響が出る。移行の順序は「インポート先を先に 1.19.0 にアップグレードしてから、エクスポート・インポートを行う」という手順になる。
3. difyctl による Skills 管理(6コマンド追加)
変更内容:difyctl に Skills を管理する6つのコマンドが追加された。
| コマンド | 操作 |
|---|---|
| difyctl get skill | Skills の一覧(キーワード・タグフィルタあり) |
| difyctl describe skill | 詳細・ドラフトハッシュ・最新版の確認 |
| difyctl get skill version | 公開済みバージョンの一覧 |
| difyctl export skill | ドラフトまたは指定バージョンを ZIP でエクスポート |
| difyctl import skill --files | ローカルファイルから Skill を作成またはドラフトを置き換え |
| difyctl publish skill | ドラフトを新しいバージョンとして公開 |
注意点:
- アカウント caller 権限が必要(ワークスペース側の対応する権限も必要)
- Skills が有効化されている必要がある
- difyctl import は公開しない(import ≠ publish)
- 既存 Skill への上書き import は「破壊的」操作として扱われる
CI/CD に組み込んで Skill のバージョン管理をしたい場合に使える。今まで Skill の変更は GUI からしか行えなかったが、コマンドラインから操作できるようになったことで、自動化の幅が広がる。
アップグレード前に確認:Docker Compose 2.35.0 以上が必須
変更内容:Docker Compose の最小必須バージョンが 2.35.0 になった。
これは .env ファイルの優先順位の解決方法が変わったことに関係している。root の .env オーバーライドが service のデフォルトより優先されるように動くには 2.35.0 以上が必要。
確認コマンド:
docker compose version
2.35.0 未満の場合はアップグレードしてから Dify 1.19.0 に更新する。
ローリングデプロイを行う場合は、トレースキューの移行手順が必要。新しいキュー ops_trace_v2 を、API・worker・Beat のすべてで同時に切り替える必要がある。古いキュー ops_trace のワーカーは、溜まっているタスクが空になってから停止する。
その他のアップグレード注意点:
- 環境ファイル(.env)は既存のものをそのまま使う。誤って空にしないよう注意
- plugin daemon を 0.6.14-local に更新する
- 1.18.0 より前からアップグレードする場合は 1.18.0 のアップグレードガイドも確認する
- バックアップ(DB・ベクトルストア・ファイル)は事前に取っておく
今回確認したこと
v1.19.0 の変更のうち、企業 Dify 運用に直結するのは次の3点:
1. ネストトレース:Workflow Tool の内部まで追えるようになった。複雑な構成でのデバッグ・パフォーマンス調査に効く
2. Workflow Tool のパッケージ同梱:環境間移行が楽になるが、インポート先を先に 1.19.0 に揃えることが必要
3. Docker Compose 2.35.0 必須:破壊的変更。アップグレード前にバージョン確認を
Dify の活用場面や設計についてはこちらでも書いている:
Copilotで議事録を作るとき、事前にやること
Dify 1.19.0 把被调用的子工作流细节带进了 Langfuse 等追踪工具。
沿调用层级查提示词、回复和 token 用量,方便定位哪一步出错。
仅限新运行,历史追踪不会补齐。自部署升级先备份,Docker Compose 需 ≥2.35.0;其他升级要求见官方说明。
github.com/langgenius/dify/releases/tag/1.19.0
2 likes · 27 views
5 GitHub Repos for Your First AI Product
These five GitHub repos can give your first AI product one useful capability, from a spoken notification to captions that follow recorded words. See what each is for, when to skip it, and why choosing one missing part makes more sense than installing the whole list.
Chapters
00:00 One useful part
00:21 Chatterbox: text to speech
01:06 Dify: answers from documents
01:59 n8n: connected steps
02:48 Browser Use: work through a page
03:40 WhisperX: time recorded words
04:30 Choose the missing job
04:57 Test one small path
Original sources and terms
Chatterbox: resemble-ai/chatterbox
Dify: langgenius/dify
n8n: n8n-io/n8n
Browser Use: browser-use/browser-use
WhisperX: m-bain/whisperX
Dify terms: github.com/langgenius/dify/blob/main/LICENSE
n8n terms: github.com/n8n-io/n8n/blob/master/LICENSE.md
WhisperX code licence: github.com/m-bain/whisperX/blob/main/LICENSE
Original Chatterbox model: huggingface.co
Chatterbox notification: actual local English-model output. Dify, n8n, Browser Use and WhisperX examples are original illustrations of documented capabilities, not tested apps. No integrated shop application.
Original explanatory animation with Chatterbox AI narration and AI generated cover artwork. Repository excerpts credit their original maintainers on screen.
19 views
Dify deployments need a boundary between app keys and console authority
Dify deployments need a boundary between app keys and console authority
Self-hosted Dify installations combine an application-building console, runtime APIs, worker services, and a sandbox used by workflow code. They can be valuable to an organization and easy to place on the internet without a clear ownership record. For a Dify deployment, the useful inventory starts with which parts are reachable, which credential controls each part, and whether an application key has been mistaken for console authority.
At about 23:48 UTC on 29 October 2026, count-only ZoomEye SDK queries with sub_type=all and page size 1 returned 12,952 matches for app="Dify" and 11,189 for title="Dify". These are asset observations, not confirmed vulnerable installations. The difference between the fingerprints also means the two numbers should not be merged into one population. The app query is the primary observation for this article, but it does not prove authentication state or version.
Separate the planes
The console is used to create and administer applications, datasets, and workspace settings. An application API key is intended for calls to a published app and is scoped to that app. The two should not share a browser session, reverse-proxy rule, or credential distribution path. An internet-facing console needs strong administrator authentication and network policy; an application API may need a different route, rate limit, and key rotation process.
Review every reachable hostname and path, including the API, console, web front end, worker health endpoint, and sandbox service. A public web UI does not mean the internal services must be public. Put the management plane behind an identity-aware proxy or private network and require a separate approval for changes to workspace-wide configuration.
Inventory application keys as identities
Each application key should have an owner, environment, upstream app, permitted data sources, issue date, and replacement plan. Store the secret in a secrets manager, not in a repository or a static front-end bundle. Confirm the key cannot be used against a different application or the console. Test the negative case: use a valid key with the wrong app identifier and verify the service rejects the request.
Look at the data path after authentication. A workflow can call external tools, read datasets, execute code in a sandbox, or invoke a model provider with a separate credential. The application key's scope is only one part of that chain. An unprivileged caller should not be able to choose arbitrary sandbox code, call an internal metadata service, or reach a credential that belongs to a different workflow.
Inspect the deployment evidence
Use ZoomEye and internal asset data to find Dify fingerprints, then verify ownership through DNS, cloud inventory, and an authenticated owner. Record the public endpoint, response headers, TLS certificate, and authentication challenge. Do not attempt to bypass a login or test credentials you do not own. For an authorized assessment, confirm whether the console has MFA, whether default accounts remain, whether SSO is enforced, and whether administrative changes are logged.
The public count is useful for prioritization. It tells a security team that Dify is a recognizable part of the internet's application layer and that the organization should be able to find its own deployments. It does not tell them that every matching asset is exploitable or that a self-hosted instance has the same configuration as the next one.
Make the boundary observable
Alert on new internet-facing console hostnames, changes to the public API allow list, and application keys that are used from a new network or with a sudden increase in volume. Keep an audit trail of app creation, key replacement, member invitations, and dataset connections. A console login and an application API call should produce distinguishable events.
The practical test is to ask who owns the console, which applications are published, which keys are active, and which sandbox or tool credentials each workflow can reach. If those answers live in different teams with no shared inventory, a public Dify page is a symptom of missing governance as much as a possible configuration issue.
References
[1] Dify environment variable example
[2] Dify repository
[3] Dify README
[4] ZoomEye count observation for app="Dify"
30 projetos GRÁTIS do GitHub para trabalhar melhor com IA
Descubra 30 projetos gratuitos do GitHub para usar IA, criar conteúdo e organizar seu trabalho. Veja ferramentas de vídeo, produtividade, segurança, marketing e servidores, com os links organizados por assunto abaixo.
Conheça o Bora Criar com IA: boracriarcomia.com.br
CAPÍTULOS
00:00 Apresentação e inteligência artificial
00:35 Segurança
00:47 Vídeo e conteúdo
01:10 Negócios e marketing
01:30 Produtividade
01:46 Servidores e infraestrutura
02:23 Projetos para explorar
02:38 Antes de instalar
INTELIGÊNCIA ARTIFICIAL
1. Dify — langgenius/dify
2. Taskosaur — Taskosaur/Taskosaur
3. OpenWork — different-ai/openwork
4. Agent Browser — vercel-labs/agent-browser
5. Emdash — generalaction/emdash
SEGURANÇA
6. PasteGuard — sgasser/pasteguard
7. Claude Code Safety Net — kenryu42/claude-code-safety-net
VÍDEO E CONTEÚDO
8. OpenReel — Augani/openreel-video
9. BridgeClip — bridge-mind/bridgeclip
10. Recordly — webadderall/Recordly
11. Textream — f/textream
12. FFmpeg Skill — kajisho5/ffmpeg-skill
13. Presenton — presenton/presenton
NEGÓCIOS E MARKETING
14. Deskcomm CRM — melgarafael/DeskcommCRM
15. Open SEO — every-app/open-seo
16. Cogsend — deepakness/cogsend
PRODUTIVIDADE
17. Handy — cjpais/Handy
18. Kept — ericerkz/kept
19. Excalidraw MCP — excalidraw/excalidraw-mcp
20. ezBookkeeping — mayswind/ezbookkeeping
SERVIDORES E INFRAESTRUTURA
21. Dockge — louislam/dockge
22. OpenObserve — openobserve/openobserve
23. LogDeck — AmoabaKelvin/logdeck
24. WebSSH — bifrost0x/webssh
25. Breakscale — xevrion/breakscale
26. SQLit — Maxteabag/sqlit
27. Mailflare — hieunc229/mailflare
28. Open Archiver — LogicLabs-OU/OpenArchiver
PROJETOS PARA EXPLORAR
29. Vibecraft — Nearcyan/vibecraft
30. God's Eye View — bilawalsidhu/gods-eye-view
Confira licença, requisitos, custos de hospedagem e manutenção de cada projeto antes de instalar. “Gratuito” pode depender de serviços externos.
Referência de pauta: Hallen Tech — youtube.com
Qual ferramenta você vai testar primeiro? Deixe nos comentários e inscreva-se para conhecer mais recursos de IA.
#InteligenciaArtificial #GitHub #OpenSource
60 likes · 2,314 views
Aus deinen Hilfeseiten wird ein KI-Support-Agent — kostenlos
Aus deinen Hilfeseiten wird jetzt mit einem kostenlosen GitHub-Repo ein KI-Support-Agent.
Es heißt Dify und hat über hundertfünfzigtausend Sterne.
Du lädst die Anleitungen deiner Firma hoch, und die KI beantwortet damit die Fragen deiner Kunden.
So antwortet sie aus deinen eigenen Texten, aus dem, was du längst geschrieben hast.
Und du brauchst keinen Code, du baust das Ganze, indem du Kästchen auf dem Bildschirm verbindest.
Du wählst sogar selbst, welches KI-Modell dahinter läuft, und testest alles, bevor ein Kunde es sieht.
Die Community-Version läuft kostenlos auf deinem eigenen Server.
So wird aus deinem Hilfebereich etwas, mit dem deine Kunden wirklich reden können.
Der Link steht im angepinnten Kommentar.
Die Links:
Dify auf GitHub: langgenius/dify
Dify: dify.ai
Wissensdatenbank: dify.ai
Workflow-Editor: dify.ai
Mehr davon: ai2roi.de
Abonnieren: youtube.com
#dify #kiagent #kundensupport #opensource #kitools
[en-US] Turn your help pages into an AI support agent — for free
Your help pages can now be transformed into an AI support agent with a free GitHub repository.
It's called Dify and has over 150,000 stars.
You upload your company's manuals, and the AI uses them to answer your customers' questions.
It answers questions based on your own text, on what you've already written.
And you don't need any code; you build it all by connecting boxes on the screen.
You even choose which AI model runs behind it and test everything before a customer sees it.
The community version runs for free on your own server.
This turns your help section into something your customers can actually interact with.
The link is in the pinned comment.
``` The links:
Dify on GitHub: langgenius/dify
Dify: dify.ai
Knowledge Base: dify.ai
Workflow Editor: dify.ai
More from us: ai2roi.de
Subscribe: youtube.com
#dify #kiagent #customersupport #opensource #kitools
4 likes · 1 comment · 300 views
Dify-இல் chatbot, RAG, agent workflow எல்லாம் ஒரே இடத்தில் கிடைக்கிறது. Docker-இல் இயக்குங்கள். முதலில் எந்த app-ஐ உருவாக்குவீர்கள்?
langgenius/dify
Instagram-லும் பின்தொடருங்கள்: instagram.com
2 likes · 509 views
Mentions
個人開発のDifyプラグインを、公式マーケットプレイスに載せるまで 日本語の個人情報を伏せるAPI「個人情報黒塗りくん」のDifyプラグインを作り、Dify公式マーケットプレイスに載せてもらいました。プルリクエストを出してからマージまでは約1日でした。 この記事では、プラグインの作りと、動作確認から審査を通るまでに引っかかったところをまとめます。これからDifyプラグインを公開したい人の参考になればうれしいです。 ソースは GitHub で公開しています:mamoruveilworks-hub/kuronurikun-dify-plugin 作ったもの 2つのツールを持つ、ツールプラグインです。 ツール 入力 出力変数 個人情報を伏せる 文章 masked_text、mapping_token、entity_count 個人情報を元に戻す 文章、mapping_token restored_text チャットフローでは、次のようにつなぐだけで「LLMに個人情報を渡さず、回答は元の名前に戻す」ボットになります。 開始 → 個人情報を伏せる → LLM → 個人情報を元に戻す → 回答 プラグインを作る前は、HTTPリクエストのブロックとコードのブロックを組み合わせた見本のチャットフローを配っていました。ただ、ブロックが7つになり、JSONの組み立てなどで引っかかる人が多そうでした。プラグインにしたことで、ブロックが5つ(開始と回答を含む)になり、コードを書く必要もなくなりました。 プラグインの構成 kuronurikun-dify-plugin/ ├── manifest.yaml # プラグインの情報 ├── main.py # 起動するだけ ├── provider/ │ ├── kuronurikun.yaml # APIキーの入力欄の定義 │ └── kuronurikun.py # APIキーの確認 ├── tools/ │ ├── mask_pii.yaml / mask_pii.py # 伏せるツール │ ├── unmask_pii.yaml / unmask_pii.py # 元に戻すツール │ └── client.py # API を呼ぶ共通処理 ├── _assets/icon.svg ├── README.md # 英語(マーケットプレイス用) ├── readme/README_ja_JP.md # 日本語 ├── PRIVACY.md └── requirements.txt ツールの結果を「出力変数」で返す ツールの結果を後ろのブロックで使いやすくするため、output_schema で出力変数を定義し、create_variable_message で値を返しています。 tools/mask_pii.yaml(抜粋) output_schema: type: object properties: masked_text: type: string mapping_token: type: string entity_count: type: integer tools/mask_pii.py(抜粋) result = post("/v1/mask", self.runtime.credentials.get("api_key", ""), payload) yield self.create_variable_message("masked_text", result.get("masked_text", "")) yield self.create_variable_message("mapping_token", result.get("mapping_token") or "") yield self.create_variable_message("entity_count", len(result.get("entities", []))) こうしておくと、LLMのブロックで「伏せる」の masked_text を、変数として直接選べます。 APIキーの確認 プラグインを入れた人がAPIキーを保存するとき、_validate_credentials でキーが正しいかを確かめます。料金がかからないように、元に戻すAPIにわざと不正なトークンを送っています。返ってきたのが「キーが無効(401)」か「トークンが不正(400)」かで、キーが正しいかを見分けています。 動作確認:リモートデバッグ パッケージにする前に、手元のPCで動かしたプラグインを、Difyにつないで試せます。 Difyの「連携」画面の左下にある「デバッグ」を開き、接続先とキーを確認します プラグインのフォルダに .env を作ります .env INSTALL_METHOD=remote REMOTE_INSTALL_HOST=debug.dify.ai REMOTE_INSTALL_PORT=5003 REMOTE_INSTALL_KEY=(デバッグ画面に表示されるキー) python -m main で起動すると、Difyのプラグイン一覧に「デバッグ中」として表示されます ここで引っかかったのは次の2点です。 handshake failed, invalid key と出る:デバッグ画面を開き直すとキーが変わることがあります。画面のキーと .env のキーが同じか確認します。 ブロックが灰色になり file not found と出る:python -m main を止めると、Difyからはプラグインが消えたように見えます。デバッグ中はウィンドウを開いたままにします。 また、このプラグインは manifest.yaml で Python 3.12 を指定しているので、手元でも 3.12 で動かします。入っていなければ先に入れておきます(Windows なら winget install -e --id Python.Python.3.12)。 動かして分かった不具合 出力変数の名前に text を使うとエラーになる 元に戻すツールは、最初は結果を text という名前の出力変数で返していました。すると、処理そのものは成功しているのに、ブロックが赤いエラー表示になりました。 ツールのブロックは、もともと text・files・json という出力を持っています。そこに同じ名前の変数を返したのが原因でした。名前を restored_text に変えたら直りました。出力変数には、text・files・json 以外の名前を付けるのが安全です。 変数の前後の空白で、トークンが壊れる 元に戻すツールの mapping_token 欄に変数を入れたとき、前後に空白や改行が入ることがあります。トークンの形式チェックで弾かれていたので、受け取った値の前後の空白を取り除くようにしました。また、間違った変数(text や json など)を選んだときは、APIを呼ぶ前に「伏せるブロックの mapping_token を選んでください」と分かるエラーを出すようにしました。 マーケットプレイスに出す準備 公式のチェックツールで先に確かめる Difyは、マーケットプレイスの審査で使うチェックを dify-marketplace-toolkit として公開しています。提出前にこれで確かめておくと、指摘のやり取りが減ります。私の場合、次の点で引っかかりました。 manifest.yaml に privacy(プライバシーポリシーのファイル)、repo(ソースのURL)、contact(連絡先)が必要 PRIVACY.md が必要。何を送り、何を保存しないかを英語で書く README.md は英語で書く(コードブロックの外に日本語があると警告)。日本語版は readme/README_ja_JP.md に置く 外部APIに通信するプラグインは、manifest.yaml の network.domains に通信先を書いておく manifest.yaml(抜粋) privacy: PRIVACY.md repo: mamoruveilworks-hub/kuronurikun-dify-plugin contact: support@kuronurikun.com network: domains: - kuronurikun.com プルリクエストの本文もチェックの対象です。「Plugin information」「Submission type」「Risk level」「What changed」「Local validation」の見出しが必要で、本文は英語で書きます。 パッケージを作る dify plugin package ./kuronurikun-dify-plugin できた .difypkg を、langgenius/dify-plugins をフォークしたリポジトリの kuronurikun/kuronurikun/kuronurikun-0.1.0.difypkg に置いて、プルリクエストを出します。 審査で受けた指摘:パッケージに .git/ が入っていた プルリクエストを出すと、初めての投稿者の場合は、担当者が許可してから自動チェックが動きます。その結果、次の指摘を受けました。 blocked directory: .git/ dify plugin package は、.git/ を自動では除外しません。Gitで管理しているフォルダをそのままパッケージにすると、.git/ の中身まで入ってしまいます。さらに、ファイルのコピーを何度かやり直した結果、プラグイン一式がもう1つ dify-plugin/ フォルダとして入っていました。 .difyignore に除外するものを書いて、作り直しました。 .difyignore .git/ .github/ .gitignore .env .venv/ pycache/ *.pyc .pytest_cache/ tests/ *.difypkg .difypkg の中身は zip なので、提出前に一覧で確かめられます。 tar -tf kuronurikun-0.1.0.difypkg manifest.yaml や tools/ が一番上にあり、.git/・.env・.venv/ などが入っていなければOKです。特に .env にはデバッグ用のキーが入るので、入っていないことを必ず確認します。 作り直したパッケージを同じブランチにプッシュし、直した内容をコメントで返したところ、翌日にマージされました。 おわりに 振り返ると、時間がかかったのはプラグインのコードよりも、「Difyの中でどう見えるか」の確認と、パッケージの中身の確認でした。 出力変数の名前は text・files・json を避ける .difyignore に .git/ と .env を書き、tar -tf で中身を見てから出す 公式のチェックツールを、提出前に一度通しておく この3つを最初から押さえておけば、かなり楽に進められると思います。 プラグインは、Difyのマーケットプレイスで「黒塗りくん」と検索すると出てきます。Difyで社内ボットを作っていて、個人情報の扱いが気になっている方は試してみてください。使い方は kuronurikun.com にまとめています。
8️⃣ Dify ⭐ 158K Flujos agénticos y apps RAG en una sola plataforma. 🔗 langgenius/dify
RAG のデスクトップ 1. はじめに 古いPCに、FAISS と Dify を使用したRAG環境を構築します。NVIDIA GeForce などのグラフィックボードを搭載していないため、FAISS は最高性能ではありませんが、個人で使用するには十分です。LLM は、クラウドの OpenAI を使用します。 以前に書いた Docker Desktop、Dify のインストールの記事はこちら。 qiita.com 以前に書いた FAISS のインストールの記事はこちら。今回は NVIDIA ドライバをインストールしません。 qiita.com qiita.com RAG を実行するためのアプリケーションは他にもありますが、問い合わせ(テキスト)と登録した文書(テキスト)の、より正確なマッチングを行うために、単にコサイン類似度を計算したいので、FAISS を使用します。 文書の埋め込み(embedding)には、クラウドの OpenAI text-embedding-3-large を使用します。NVIDIA GeForce グラフィックボードを搭載した別のPCで、Alibaba qwen3-embedding-8b のようなローカルの embedding を使用することも可能です。 2. Xubuntu インストール PC電源投入時、 起動メニュー F12キー BIOS F2キー デスクトップの使い易さのために Xubuntu を使用しています。日本語入力をセットアップしますが、画面は英語のままにしています。 xubuntu-26.04.1-desktop-amd64.iso Rufus を使って起動 USB メモリを作成(DVD からだとアクセスが頻発して正常に動作しなかった) PCの電源を入れて F12キーを押して USB から立ち上げる デスクトップに表示される Install Xubuntu 26.04.1 LTS アイコンをダブルクリックして、PCへのインストールを開始 Language: English Keyboard: Japanese Connect to the internet: Connect to a Wi-Fi network ※ 先にメニューバーから接続しておく An update is available for the installer: Update now ※ インストーラーを再開 Interactive installation Xubuntu Desktop Erase disk and install Xubuntu Select drive: sda - 500GB SSD-PSTA/D BUFFALO No encryption Your name: webmaster Your computer's name: noble34 Your username: webmaster Password: ** Confirm password: ** Select your timezone: Asia/Tokyo インストールが終わったら、USB メモリを外して起動 OS アップデート sudo apt-get update sudo apt-get upgrade sudo apt-get dist-upgrade 再起動 SSH インストール sudo apt update sudo apt install openssh-server 外部から SSH で接続 ssh -l webmaster 192.168.1.41 password: ** Xfce メニュー メニューから Panel Profiles、Xfce 4.16、Apply Configuration ボタン押下 Application -> Settings -> Xfce Screensaver 60 minutes Application -> Settings -> Language Support 追加のインストールのためにパスワードを入力 Install / Japanese、Password 但し、画面表示は英語のままで使用する 再起動 ログイン後、バー右上、右クリック、Preference -> Input Method -> Add Japanese -> Mozc Preference -> General -> Keyboard Shortcuts <Super>space から <Control>space に変更、Apply ボタン バー右上、左クリックで Input Mode を Direct input から Hiragana に変更 固定IP Wifi 接続の場合は、メニューバー右上でマウス右クリック、Edit Connections から設定する Address: 192.168.1.34 Netmask: 255.255.255.0 Gateway: 192.168.1.1 DNS: 999.999.99.99, 888.888.888.88 ※プロバイダから入手 再起動 よく使うコマンド pwd ls -alF ip addr show nano .env(矢印キーでカーソル移動、保存Ctrl+S、終了Ctrl+X) sudo reboot sudo shutdown -h now 画面キャプチャ PrtSc、範囲指定 Shift+PrtSc、アクティブウィンドウのみ Ctrl+PrtSc ※ Alt が機能しないため Settings - Keyboard - Application Shortcuts で Ctrl に変更 3. Docker Desktop 下記リンクの手順に従って、Ubuntu に Docker Desktop をインストールします。 docs.docker.com 1.Docker の APT レポジトリの設定 # Add Docker's official GPG key # Add the repository to Apt sources 2.Docker パッケージのインストール sudo apt install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin 3.hello-world イメージの実行 sudo docker run hello-world docs.docker.com sudo apt install gnome-terminal docker-desktop-amd64.deb をダウンロード sudo apt-get update sudo apt install ./docker-desktop-amd64.deb 再起動 メニューから Development > Docker Desktop で起動。または systemctl --user start docker-desktop で起動 ユーザー登録は行わず、skip、skip で Docker Containers の画面が表示される Docker Desktop のコンテナーのメモリ制限を、2GB(デフォルト)から4GBに変更する <img src="qiita-image-store.s3.ap-northeast-1.amazonaws.com" width="600"> Docker Desktop の自動起動 Docker Engine は、Xubuntu 標準のものと、Dify のためにインストールした Docker Desktop のものがあります。次のコマンドでどちらを使用しているか確認できます。 docker context ls webmaster@noble01:~$ docker context ls NAME DESCRIPTION DOCKER ENDPOINT ERROR default Current DOCKER_HOST based configuration unix:///var/run/docker.sock desktop-linux * Docker Desktop unix:///home/webmaster/.docker/desktop/docker.sock Docker Desktop は、ユーザーがログインした後でないと起動できません。GUI で以下を設定します。 Settings、Session and Startup、Application Autostart Add Name: Docker Desktop Comment: Docker Desktop 起動 Command: /opt/docker-desktop/bin/docker-desktop Docker Desktop を起動すると、Dify のコンテナが自動的に起動します。 4. Dify docs.dify.ai mkdir Repos cd Repos git clone --branch 1.18.0 https:\/\/github.com/langgenius/dify.git cd dify/docker cp .env.example .env openssl rand -base64 32 表示されたキーを .env の DIFY_AGENT_LOCAL_SANDBOX_AUTH_TOKEN に記入する nano .env docker compose up -d インストールが完了すると、Docker Desktop で実行中になる <img src="qiita-image-store.s3.ap-northeast-1.amazonaws.com" width="450"> ブラウザで 192.168.1.34 または localhost を表示 管理者アカウントの設定 Email address Username Password ブラウザで 192.168.1.34 または localhost を表示 Email と Password でログイン LLMモデルの設定 連携 - モデルプロバイダーをインストール OpenAI API Key:**** デフォルトのモデルは gpt-5.4-mini 従来との互換性のために gpt-4o-2024-11-20 を選択 HTTPS 化(手順はこちら) ドメインを取得し、ホスト名を登録する ルーターの80と443のポートフォワードを、このPCにする 自分のドメインでこのPCの http:\/\/localhost/ が表示されることを確認する docker/.env の編集。.env に、説明にある赤字の項目を設定する コマンドの実行(Docker Desktop が立ち上がっていること) cd dify/docker docker compose --profile certbot up --force-recreate -d コンテナが作成された後に、 docker compose exec -it certbot /bin/sh /update-cert.sh docker/.env の(再)編集。.env に以下を設定する NGINX_HTTPS_ENABLED=true コマンドの実行 docker compose --profile certbot up -d --no-deps --force-recreate nginx 外部から your_domain.com で見れることを確認する SSL 証明書の更新 docker compose exec -it certbot /bin/sh /update-cert.sh docker compose exec nginx nginx -s reload <img src="qiita-image-store.s3.ap-northeast-1.amazonaws.com" width="450"> 5. FAISS Anaconda anaconda.com ホームページでメールを登録すると、ダウンロードリンクが届きます Linux、現在 Python 3.14.4 Anaconda3-2026.07-1-Linux-x86_64.sh をダウンロード。home ディレクトリにファイルを移動 bash ~/Anaconda3-2026.07-1-Linux-x86_64.sh ./anaconda3/bin/conda init 次のターミナルの起動から、conda 環境(base)になります <img src="qiita-image-store.s3.ap-northeast-1.amazonaws.com" width="600"> FAISS 用に、Python のバージョンを 3.12 にします conda create -n faiss python=3.12 -y conda activate faiss echo 'conda activate faiss' >> ~/.bashrc <img src="qiita-image-store.s3.ap-northeast-1.amazonaws.com" width="600"> 解除は conda deactivate ベクトルデータベース(faiss)のインストール facebookresearch/faiss 事前準備 sudo apt install unzip faiss-cpu インストール conda install -c pytorch -c conda-forge faiss-cpu=1.15.1 ※ バージョンは FAISS のウェブページに表示されているもの 動作確認のために、faiss のページにある DOWNLOAD ZIP からプログラムコード一式をダウンロードします <img src="qiita-image-store.s3.ap-northeast-1.amazonaws.com" width="700"> unzip faiss-main.zip cd faiss-main/tutorial/python (faiss) webmaster@noble34:~/faiss-main/tutorial/python$ ls -1 1-Flat.py 10-FaissCuvsExample.ipynb 11-SVS.py 2-IVFFlat.py 3-IVFPQ.py 4-GPU.py 5-Multiple-GPUs.py 6-HNSW.py 7-PQFastScan.py 8-PQFastScanRefine.py 9-RefineComparison.py python 1-Flat.py True 100000 [[ 0 393 363 78] [ 1 555 277 364] [ 2 304 101 13] [ 3 173 18 182] [ 4 288 370 531]] [[7.6293945e-06 7.1751785e+00 7.2076302e+00 7.2511673e+00] [0.0000000e+00 6.3235664e+00 6.6845779e+00 6.7999382e+00] [3.8146973e-06 5.7964020e+00 6.3917236e+00 7.2815170e+00] [3.8146973e-06 7.2779007e+00 7.5279808e+00 7.6628418e+00] [0.0000000e+00 6.7638016e+00 7.2951088e+00 7.3688126e+00]] [[ 381 207 210 477] [ 526 911 142 72] [ 838 527 1290 425] [ 196 184 164 359] [ 526 377 120 425]] [[ 9900 10500 9309 9831] [11055 10895 10812 11321] [11353 11103 10164 9787] [10571 10664 10632 9638] [ 9628 9554 10036 9582]] python 2-IVFFlat.py [[ 9900 9309 9810 10048] [11055 10895 10812 11321] [11353 10164 9787 10719] [10571 10664 10632 10203] [ 9628 9554 9582 10304]] [[ 9900 10500 9309 9831] [11055 10895 10812 11321] [11353 11103 10164 9787] [10571 10664 10632 9638] [ 9628 9554 10036 9582]] python 3-IVFPQ.py [[ 0 78 424 608] [ 1 555 1063 380] [ 2 179 304 33] [ 3 265 527 139] [ 4 288 531 827]] [[1.5948839 6.2905183 6.3059173 6.5697308] [1.282814 5.9320083 5.9512424 6.5773916] [1.698801 6.1244454 6.2004113 6.401427 ] [1.82021 6.721145 6.8056335 6.995647 ] [1.4857421 5.8346977 6.303232 6.400938 ]] [[ 8746 9380 10914 9842] [10913 11373 9014 10507] [10719 11291 10600 11353] [11578 9671 10709 10664] [ 9229 9878 9905 9459]] PostgreSQL インストール sudo apt update sudo apt install postgresql postgresql-contrib psql --version sudo -i -u postgres psql postgres=# CREATE USER admin WITH PASSWORD '<font color="green">mypassword</font>' SUPERUSER; CREATE USER webmaster WITH PASSWORD '<font color="green">mypassword</font>'; CREATE DATABASE webmaster OWNER webmaster; \q で抜ける exit で postgres ユーザーを抜ける psql -U webmaster -d webmaster -h localhost CREATE TABLE knowledge_documents ( id UUID PRIMARY KEY, knowledge_id TEXT NOT NULL, content TEXT NOT NULL, title TEXT NOT NULL, metadata JSONB, created_at TIMESTAMP DEFAULT now() ); \q で抜ける \d knowledge_documents (テーブル一覧) \l (データベース一覧) \c (現在接続しているデータベース) SELECT * FROM knowledge_documents; TRUNCATE TABLE knowledge_documents; faiss_service の作成 次のように作成します。 |項目|ツール| |---|---| |文書データベース|PostgreSQL| |ベクトルデータベース・検索|faiss-cpu| |埋め込み(Embeddings)|OpenAI API(text-embedding-3-small)<br>ナレッジIDを指定して切り替え可能| |ウェブサーバー|Python Flask| # 一旦、通常の Ubuntu 環境に戻す conda deactivate sudo apt update sudo apt install -y build-essential libpq-dev python3-dev # conda 環境で実行 conda activate faiss pip install flask psycopg2 openai flasgger ollama mkdir faiss_service cd faiss_service nano faiss_service.py [faiss_service.py を他のPCからコピーして入手] LangChain を使用したチャンク分割(upload_files_chunk)は行わないこととし、upload_files_chunk の部分を削除します。また、LangChain の API_KEY も設定しません。 faiss_gpu から faiss_cpu への変更 # 変更前 res = faiss.StandardGpuResources() # use a single GPU gpu_index = faiss.index_cpu_to_gpu(res, 0, index) index = faiss.index_gpu_to_cpu(gpu_indexes[knowledge_id]) # 変更後 #res = faiss.StandardGpuResources() # コメントアウトまたは削除 gpu_index = index # 3か所 index = gpu_indexes[knowledge_id] # 1か所 export PSQL_DB_PASSWORD="..." export OPENAI_API_KEY="..." python faiss_service.py <img src="qiita-image-store.s3.ap-northeast-1.amazonaws.com" width="450"> ウェブページを表示 http:\/\/192.168.1.34:8000/apidocs/ <img src="qiita-image-store.s3.ap-northeast-1.amazonaws.com" width="650"> コンテンツエディター 登録済みのコンテンツ(テキスト)を確認・編集するためのウェブページを作成します。[保存して更新]ボタンを押下すると、faiss_service の delete と add を呼び出します(Faiss を使用しているため、登録済みの内容は変更ではなく、再登録します)。 pip install requests mkdir content_editor cd content_editor nano app.py [app.py を他のPCからコピーして入手] mkdir templates nano templates/index.html nano templates/edit.html [index.html と edit.html を他のPCからコピーして入手] [ 実行 ] export PSQL_DB_PASSWORD="**" python app.py [ 表示 ] localhost または、 192.168.1.34 (他のPCからIPアドレスを指定) <img src="qiita-image-store.s3.ap-northeast-1.amazonaws.com" width="450"> <img src="qiita-image-store.s3.ap-northeast-1.amazonaws.com" width="650"> <img src="qiita-image-store.s3.ap-northeast-1.amazonaws.com" width="650"> Ubuntu 起動時に Python プログラムを実行する 参考ページ1: udemy.benesse.co.jp cd ~ nano py_app_service.sh export PSQL_DB_PASSWORD="..." export OPENAI_API_KEY="..." /home/webmaster/anaconda3/envs/faiss/bin/python /home/webmaster/faiss_service/faiss_service.py & /home/webmaster/anaconda3/envs/faiss/bin/python /home/webmaster/content_editor/app.py & wait chmod 744 py_app_service.sh bash py_app_service.sh 参考ページ2: note.com cd /etc/systemd/system sudo nano run_python.service [Unit] Description=python run After=network.target [Service] Type=simple User=webmaster WorkingDirectory=/home/webmaster/faiss_service ExecStart=/bin/bash /home/webmaster/py_app_service.sh Restart=on-failure KillMode=control-group [Install] WantedBy=multi-user.target ※ データファイルを読み込むため、ワーキングディレクトリを faiss_service に設定する sudo systemctl daemon-reload sudo systemctl enable run_python.service sudo systemctl start run_python.service sudo systemctl status run_python.service sudo systemctl stop run_python.service 多数のファイルを一度に登録する faiss_service の画面では、最大20個のファイルを手動で指定し、登録できるようにしています。実際は、別に Python プログラムを作成し、テキストファイル(input.txt)に記述したファイル一覧をもとに、一括登録できるようにしています。input.txt の1行目には、すべてのファイルに共通するナレッジIDを記入し、2行目以降には登録するファイル名を記述します。プログラムは faiss_service.py の upload_files をもとに作成しいますが、ここでは内容を割愛します。 ファイル一覧の作成: ls *.txt > input.txt nano input.txt 1行目にナレッジIDを記入 2行目以降はファイル名 python upload_files.py Dify と FAISS を接続 Dify で外部ナレッジベースの設定を行って、faiss_service に接続します。 ナレッジ 「外部ナレッジベースと連携 →」 <img src="qiita-image-store.s3.ap-northeast-1.amazonaws.com" width="450"> 外部ナレッジベース連携APIを追加 API Key は未使用なので ABCdef など <img src="qiita-image-store.s3.ap-northeast-1.amazonaws.com" width="450"><br> <img src="qiita-image-store.s3.ap-northeast-1.amazonaws.com" width="450"> 外部ナレッジベース名: ローカルRAG 外部ナレッジベースID: AAA-BBB-CCC 「連携 →」ボタン押下 事前準備(以前からの修正) 従来は Dify 1.13.0 を使用していましたが、1.18.0 に変更したところ、以下の対応が必要でした。 SSRF プロキシ対応 cd dify/docker nano .env 変更前: SSRF_PROXY_ALLOW_PRIVATE_IPS= 変更後: SSRF_PROXY_ALLOW_PRIVATE_IPS=192.168.1.34 設定の反映 docker compose up -d --force-recreate ssrf_proxy 確認 docker exec docker-ssrf_proxy-1 \ cat /etc/squid/dify_allow_private.conf faiss_service.py、retrieval のレスポンスにおける score の型変換 変更前: records.append({ "score": score 変更後: records.append({ "score": float(score) 動作確認 スタジオの、テンプレートから作成できるチャットボット(チャットフロー)のサンプルで、[ユーザー入力]と[LLM]の間に、[知識検索]を追加します。 << LLM のプロンプト >> あなたは質問応答タスクのためのアシスタントです。 提供されたコンテンツに基づき、重要なポイントを整理し、客観的かつ分かりやすく回答してください。 主観的な断定や過度な推測は避けてください。 コンテンツから複数の候補が見つかった場合、コンテンツを混ぜないで、それぞれで提案してください。 回答は、「コンテンツ」に書かれている内容だけに基づいてください。不明な点は「コンテンツからは確認できません」と書いてください。 コンテンツ: [知識探索のコンテキスト] <img src="qiita-image-store.s3.ap-northeast-1.amazonaws.com" width="650"> 6. その他 □ ファイアウォール sudo ufw enable sudo ufw allow 'Nginx Full' sudo ufw allow OpenSSH sudo ufw reload sudo ufw status sudo ufw status numbered sudo ufw delete 3 □ ブルートフォース攻撃対策 sudo apt update sudo apt install fail2ban sudo nano /etc/fail2ban/jail.d/sshd.local [sshd] enabled = true backend = systemd port = ssh filter = sshd maxretry = 5 findtime = 600 bantime = 86400 10分間に5回以上SSH認証に失敗したIPアドレスを、24時間遮断する設定になる sudo systemctl enable --now fail2ban sudo systemctl restart fail2ban sudo systemctl status fail2ban 以上、
Dify 1.19.0——ネストしたワークフロートレースと3つの変更が企業運用に何をもたらすか Dify でワークフローが呼び出す Workflow Tool の中で何が起きているか、今まで「Tool スパンが通った」「Tool スパンが失敗した」しか見えなかった。内部の LLM コールやステップが追えなかった。v1.19.0 でそれが変わった。 > この記事で分かること: > - Dify 1.19.0(2026-11-04 リリース)の3つの主要変更 > - ネストしたワークフロートレースの仕組みと実務での使い所 > - アップグレード前に確認すべき Docker Compose 2.35.0 以上の要件 Dify 1.19.0 は 2026-11-04 にリリースされた。変更の全容は公式リリースページ(github.com/langgenius/dify/releases/tag/1.19.0%EF… Dify Enterprise を使っている立場から、実務に直結する3か所を整理する。 1. ネストしたワークフロートレース(Nested Workflow Tracing) 変更内容:ワークフロー内で Workflow Tool を呼び出したとき、その内部のステップや LLM コールが外部トレース(Langfuse など)に階層構造で出るようになった。 今まで: - 外側のワークフロー → Workflow Tool のスパン(通った/失敗した)しか見えない - Workflow Tool の中で何が起きたか、どの LLM コールが遅かったか、どのステップで詰まったかは追えない v1.19.0 以降: - Workflow Tool の呼び出しスパンの下に、内部のステップが階層で並ぶ - LLM コールのプロンプト・レスポンス・トークン数も確認できる - ネストした Tool が複数回呼ばれた場合も、各呼び出しが別々のスパンとして残る 注意点: - 新しいトレース階層は「今後の実行」に適用される。既存の履歴はバックフィルされない - Workflow Tool の内部ステップが永続化されている必要がある(1.18.0 以降の Console ドリルダウン機能を前提としている) - ローリングデプロイ中はトレースキューの移行手順(ops_trace → ops_trace_v2)が必要 大企業内で Dify を使っていると、ワークフローが複数の Workflow Tool を呼び出す複雑な構成になることがある。今まで「どの Tool で詰まっているか」を切り分けるのに、ログをひとつひとつ確認する必要があった。ネストトレースが取れると、この調査時間が大きく変わる。 2. Workflow Tools の App パッケージへの同梱(.ifpkg v2) 変更内容:App をエクスポートすると、そのアプリが使っている Workflow Tools も一緒に .ifpkg パッケージに含まれるようになった。 今まで: - App をエクスポートしても、Workflow Tools の定義は含まれなかった - 別環境にインポートするとき、Workflow Tools を別途作成・登録する必要があった v1.19.0 以降: - .ifpkg(format v2)に Workflow Tools の定義が含まれる - インポート先で既存の Tool と重複する場合は再利用し、ない場合は作成・公開・登録まで自動で行う - 推移的な依存(Tool が呼び出す Tool)も含まれる 重要な注意:すべての Dify App エクスポートが format v2 になった。古い v1 のインポーターは受け付けない可能性がある。インポート先も 1.19.0 以上に揃えてからパッケージをインポートすること。 複数の Dify 環境(開発・ステージング・本番)を使っている場合に、この変更の影響が出る。移行の順序は「インポート先を先に 1.19.0 にアップグレードしてから、エクスポート・インポートを行う」という手順になる。 3. difyctl による Skills 管理(6コマンド追加) 変更内容:difyctl に Skills を管理する6つのコマンドが追加された。 | コマンド | 操作 | |---|---| | difyctl get skill | Skills の一覧(キーワード・タグフィルタあり) | | difyctl describe skill | 詳細・ドラフトハッシュ・最新版の確認 | | difyctl get skill version | 公開済みバージョンの一覧 | | difyctl export skill | ドラフトまたは指定バージョンを ZIP でエクスポート | | difyctl import skill --files | ローカルファイルから Skill を作成またはドラフトを置き換え | | difyctl publish skill | ドラフトを新しいバージョンとして公開 | 注意点: - アカウント caller 権限が必要(ワークスペース側の対応する権限も必要) - Skills が有効化されている必要がある - difyctl import は公開しない(import ≠ publish) - 既存 Skill への上書き import は「破壊的」操作として扱われる CI/CD に組み込んで Skill のバージョン管理をしたい場合に使える。今まで Skill の変更は GUI からしか行えなかったが、コマンドラインから操作できるようになったことで、自動化の幅が広がる。 アップグレード前に確認:Docker Compose 2.35.0 以上が必須 変更内容:Docker Compose の最小必須バージョンが 2.35.0 になった。 これは .env ファイルの優先順位の解決方法が変わったことに関係している。root の .env オーバーライドが service のデフォルトより優先されるように動くには 2.35.0 以上が必要。 確認コマンド: docker compose version 2.35.0 未満の場合はアップグレードしてから Dify 1.19.0 に更新する。 ローリングデプロイを行う場合は、トレースキューの移行手順が必要。新しいキュー ops_trace_v2 を、API・worker・Beat のすべてで同時に切り替える必要がある。古いキュー ops_trace のワーカーは、溜まっているタスクが空になってから停止する。 その他のアップグレード注意点: - 環境ファイル(.env)は既存のものをそのまま使う。誤って空にしないよう注意 - plugin daemon を 0.6.14-local に更新する - 1.18.0 より前からアップグレードする場合は 1.18.0 のアップグレードガイドも確認する - バックアップ(DB・ベクトルストア・ファイル)は事前に取っておく 今回確認したこと v1.19.0 の変更のうち、企業 Dify 運用に直結するのは次の3点: 1. ネストトレース:Workflow Tool の内部まで追えるようになった。複雑な構成でのデバッグ・パフォーマンス調査に効く 2. Workflow Tool のパッケージ同梱:環境間移行が楽になるが、インポート先を先に 1.19.0 に揃えることが必要 3. Docker Compose 2.35.0 必須:破壊的変更。アップグレード前にバージョン確認を Dify の活用場面や設計についてはこちらでも書いている: Copilotで議事録を作るとき、事前にやること
Dify 1.19.0 把被调用的子工作流细节带进了 Langfuse 等追踪工具。 沿调用层级查提示词、回复和 token 用量,方便定位哪一步出错。 仅限新运行,历史追踪不会补齐。自部署升级先备份,Docker Compose 需 ≥2.35.0;其他升级要求见官方说明。 github.com/langgenius/dify/releases/tag/1.19.0
5 GitHub Repos for Your First AI Product These five GitHub repos can give your first AI product one useful capability, from a spoken notification to captions that follow recorded words. See what each is for, when to skip it, and why choosing one missing part makes more sense than installing the whole list. Chapters 00:00 One useful part 00:21 Chatterbox: text to speech 01:06 Dify: answers from documents 01:59 n8n: connected steps 02:48 Browser Use: work through a page 03:40 WhisperX: time recorded words 04:30 Choose the missing job 04:57 Test one small path Original sources and terms Chatterbox: resemble-ai/chatterbox Dify: langgenius/dify n8n: n8n-io/n8n Browser Use: browser-use/browser-use WhisperX: m-bain/whisperX Dify terms: github.com/langgenius/dify/blob/main/LICENSE n8n terms: github.com/n8n-io/n8n/blob/master/LICENSE.md WhisperX code licence: github.com/m-bain/whisperX/blob/main/LICENSE Original Chatterbox model: huggingface.co Chatterbox notification: actual local English-model output. Dify, n8n, Browser Use and WhisperX examples are original illustrations of documented capabilities, not tested apps. No integrated shop application. Original explanatory animation with Chatterbox AI narration and AI generated cover artwork. Repository excerpts credit their original maintainers on screen.
Dify deployments need a boundary between app keys and console authority Dify deployments need a boundary between app keys and console authority Self-hosted Dify installations combine an application-building console, runtime APIs, worker services, and a sandbox used by workflow code. They can be valuable to an organization and easy to place on the internet without a clear ownership record. For a Dify deployment, the useful inventory starts with which parts are reachable, which credential controls each part, and whether an application key has been mistaken for console authority. At about 23:48 UTC on 29 October 2026, count-only ZoomEye SDK queries with sub_type=all and page size 1 returned 12,952 matches for app="Dify" and 11,189 for title="Dify". These are asset observations, not confirmed vulnerable installations. The difference between the fingerprints also means the two numbers should not be merged into one population. The app query is the primary observation for this article, but it does not prove authentication state or version. Separate the planes The console is used to create and administer applications, datasets, and workspace settings. An application API key is intended for calls to a published app and is scoped to that app. The two should not share a browser session, reverse-proxy rule, or credential distribution path. An internet-facing console needs strong administrator authentication and network policy; an application API may need a different route, rate limit, and key rotation process. Review every reachable hostname and path, including the API, console, web front end, worker health endpoint, and sandbox service. A public web UI does not mean the internal services must be public. Put the management plane behind an identity-aware proxy or private network and require a separate approval for changes to workspace-wide configuration. Inventory application keys as identities Each application key should have an owner, environment, upstream app, permitted data sources, issue date, and replacement plan. Store the secret in a secrets manager, not in a repository or a static front-end bundle. Confirm the key cannot be used against a different application or the console. Test the negative case: use a valid key with the wrong app identifier and verify the service rejects the request. Look at the data path after authentication. A workflow can call external tools, read datasets, execute code in a sandbox, or invoke a model provider with a separate credential. The application key's scope is only one part of that chain. An unprivileged caller should not be able to choose arbitrary sandbox code, call an internal metadata service, or reach a credential that belongs to a different workflow. Inspect the deployment evidence Use ZoomEye and internal asset data to find Dify fingerprints, then verify ownership through DNS, cloud inventory, and an authenticated owner. Record the public endpoint, response headers, TLS certificate, and authentication challenge. Do not attempt to bypass a login or test credentials you do not own. For an authorized assessment, confirm whether the console has MFA, whether default accounts remain, whether SSO is enforced, and whether administrative changes are logged. The public count is useful for prioritization. It tells a security team that Dify is a recognizable part of the internet's application layer and that the organization should be able to find its own deployments. It does not tell them that every matching asset is exploitable or that a self-hosted instance has the same configuration as the next one. Make the boundary observable Alert on new internet-facing console hostnames, changes to the public API allow list, and application keys that are used from a new network or with a sudden increase in volume. Keep an audit trail of app creation, key replacement, member invitations, and dataset connections. A console login and an application API call should produce distinguishable events. The practical test is to ask who owns the console, which applications are published, which keys are active, and which sandbox or tool credentials each workflow can reach. If those answers live in different teams with no shared inventory, a public Dify page is a symptom of missing governance as much as a possible configuration issue. References [1] Dify environment variable example [2] Dify repository [3] Dify README [4] ZoomEye count observation for app="Dify"
30 projetos GRÁTIS do GitHub para trabalhar melhor com IA Descubra 30 projetos gratuitos do GitHub para usar IA, criar conteúdo e organizar seu trabalho. Veja ferramentas de vídeo, produtividade, segurança, marketing e servidores, com os links organizados por assunto abaixo. Conheça o Bora Criar com IA: boracriarcomia.com.br CAPÍTULOS 00:00 Apresentação e inteligência artificial 00:35 Segurança 00:47 Vídeo e conteúdo 01:10 Negócios e marketing 01:30 Produtividade 01:46 Servidores e infraestrutura 02:23 Projetos para explorar 02:38 Antes de instalar INTELIGÊNCIA ARTIFICIAL 1. Dify — langgenius/dify 2. Taskosaur — Taskosaur/Taskosaur 3. OpenWork — different-ai/openwork 4. Agent Browser — vercel-labs/agent-browser 5. Emdash — generalaction/emdash SEGURANÇA 6. PasteGuard — sgasser/pasteguard 7. Claude Code Safety Net — kenryu42/claude-code-safety-net VÍDEO E CONTEÚDO 8. OpenReel — Augani/openreel-video 9. BridgeClip — bridge-mind/bridgeclip 10. Recordly — webadderall/Recordly 11. Textream — f/textream 12. FFmpeg Skill — kajisho5/ffmpeg-skill 13. Presenton — presenton/presenton NEGÓCIOS E MARKETING 14. Deskcomm CRM — melgarafael/DeskcommCRM 15. Open SEO — every-app/open-seo 16. Cogsend — deepakness/cogsend PRODUTIVIDADE 17. Handy — cjpais/Handy 18. Kept — ericerkz/kept 19. Excalidraw MCP — excalidraw/excalidraw-mcp 20. ezBookkeeping — mayswind/ezbookkeeping SERVIDORES E INFRAESTRUTURA 21. Dockge — louislam/dockge 22. OpenObserve — openobserve/openobserve 23. LogDeck — AmoabaKelvin/logdeck 24. WebSSH — bifrost0x/webssh 25. Breakscale — xevrion/breakscale 26. SQLit — Maxteabag/sqlit 27. Mailflare — hieunc229/mailflare 28. Open Archiver — LogicLabs-OU/OpenArchiver PROJETOS PARA EXPLORAR 29. Vibecraft — Nearcyan/vibecraft 30. God's Eye View — bilawalsidhu/gods-eye-view Confira licença, requisitos, custos de hospedagem e manutenção de cada projeto antes de instalar. “Gratuito” pode depender de serviços externos. Referência de pauta: Hallen Tech — youtube.com Qual ferramenta você vai testar primeiro? Deixe nos comentários e inscreva-se para conhecer mais recursos de IA. #InteligenciaArtificial #GitHub #OpenSource
Aus deinen Hilfeseiten wird ein KI-Support-Agent — kostenlos Aus deinen Hilfeseiten wird jetzt mit einem kostenlosen GitHub-Repo ein KI-Support-Agent. Es heißt Dify und hat über hundertfünfzigtausend Sterne. Du lädst die Anleitungen deiner Firma hoch, und die KI beantwortet damit die Fragen deiner Kunden. So antwortet sie aus deinen eigenen Texten, aus dem, was du längst geschrieben hast. Und du brauchst keinen Code, du baust das Ganze, indem du Kästchen auf dem Bildschirm verbindest. Du wählst sogar selbst, welches KI-Modell dahinter läuft, und testest alles, bevor ein Kunde es sieht. Die Community-Version läuft kostenlos auf deinem eigenen Server. So wird aus deinem Hilfebereich etwas, mit dem deine Kunden wirklich reden können. Der Link steht im angepinnten Kommentar. Die Links: Dify auf GitHub: langgenius/dify Dify: dify.ai Wissensdatenbank: dify.ai Workflow-Editor: dify.ai Mehr davon: ai2roi.de Abonnieren: youtube.com #dify #kiagent #kundensupport #opensource #kitools [en-US] Turn your help pages into an AI support agent — for free Your help pages can now be transformed into an AI support agent with a free GitHub repository. It's called Dify and has over 150,000 stars. You upload your company's manuals, and the AI uses them to answer your customers' questions. It answers questions based on your own text, on what you've already written. And you don't need any code; you build it all by connecting boxes on the screen. You even choose which AI model runs behind it and test everything before a customer sees it. The community version runs for free on your own server. This turns your help section into something your customers can actually interact with. The link is in the pinned comment. ``` The links: Dify on GitHub: langgenius/dify Dify: dify.ai Knowledge Base: dify.ai Workflow Editor: dify.ai More from us: ai2roi.de Subscribe: youtube.com #dify #kiagent #customersupport #opensource #kitools
Dify-இல் chatbot, RAG, agent workflow எல்லாம் ஒரே இடத்தில் கிடைக்கிறது. Docker-இல் இயக்குங்கள். முதலில் எந்த app-ஐ உருவாக்குவீர்கள்? langgenius/dify Instagram-லும் பின்தொடருங்கள்: instagram.com