🐈

Difyの外部ナレッジベース連携APIでrokadocを利用する。

に公開

rokadocがDifyの外部ナレッジベース連携APIに一部対応した模様。
(rokadocのapi使用制限には注意。)
rokadocに関しては下記。
https://rokadoc.ntt.com/

現状

  • scoreの設定は無効にされる。
  • topkの設定は有効。

https://github.com/langgenius/dify/blob/main/README_JA.md

Difyのgitを取得

git clone https://github.com/langgenius/dify.git

docker(docker compose)環境で立ち上げる。

cd dify
cd docker
cp .env.example .env

コンポースを実行

docker compose up -d

以下のように処理が開始されるので待つ。

docker compose up -d
[+] Running 42/26
 ⠹ api Pulling                                                                                         83.3s 
 ⠹ weaviate 4 layers [⠀⠀⠀⠀]      0B/0B      Pulling                                                    83.3s 
 ✔ sandbox 10 layers [⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿]      0B/0B      Pulled                                               73.3s 
 ⠹ web 12 layers [⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀]      0B/0B      Pulling                                                83.3s 
 ✔ ssrf_proxy 3 layers [⣿⣿⣿]      0B/0B      Pulled                                                    14.4s 
 ⠹ redis 6 layers [⠀⠀⠀⠀⠀⠀]      0B/0B      Pulling                                                     83.3s 
 ✔ db 11 layers [⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿]      0B/0B      Pulled                                                   75.9s 
 ⠹ plugin_daemon 5 layers [⠀⠀⠀⠀⠀]      0B/0B      Pulling                                              83.3s 
 ⠹ nginx 7 layers [⣿⣤⣿⣿⠀⠀⠀] 20.92MB/40.75MB Pulling                                                    83.3s 
 ⠹ worker 13 layers [⣿⣿⣿⣿⣿⣿⣿⣿⣶⣿⣿⣿⣿] 353.5MB/407.8MB Pulling                                            83.3s 

完了したら
ブラウザで下記にアクセス

http://localhost/install

外部ナレッジベース連携APIを設定する。

設定できたら保存ボタンを押す。

ナレッジベースの作成

外部ナレッジベースと連携を選択。

  • 外部ナレッジベースID は現状対応していないので任意の値。

動作検証

  • 事前にrokadoc側のサイトで、ファイルをアップロードしておく。

rokadocのナレッジから検索できることを確認する。

Discussion