檔案RAG服務(Beta)
檔案RAG (Retrieval-Enhanced Generation)服務提供相關Adobe Commerce和App Builder檔案中的AI支援語意搜尋功能。
此RAG提供IDE介面來詢問有關Adobe Commerce的問題,並可提供開發應用程式和其他移轉工作的最佳實務建議。
RAG服務是Commerce擴充性工具 MCP (模型內容通訊協定)伺服器的一部分,該伺服器與Cursor和其他與MCP相容的AI助理整合。
可用檔案
下表說明RAG服務目前索引的檔案,以及可用來觸發搜尋關聯索引的關鍵字。 隨著我們開發RAG服務,隨附的檔案內容將會持續擴展。
如需每個索引中所包含檔案的詳細資訊,請參閱擷取的來源清單。
安全性與隱私權
- IMS驗證 — 所有API呼叫都使用Adobe IMS OAuth2 Token。
- 沒有資料儲存體 - MCP伺服器未儲存任何認證或資料。
- 本機執行 — 所有工具都在您的電腦上本機執行。
- 安全通訊 — 檔案搜尋使用HTTPS搭配權杖驗證。
生產端點受Azure前門保護,包括下列保護:
- 具有Microsoft預設規則集2.1和機器人管理員規則集1.0的Web應用程式防火牆(WAF)
- 封鎖美國禁運地區(古巴、伊朗、朝鮮、敘利亞、克里米亞、盧甘斯克、頓涅茨克)的地理
- 邊緣的DDoS保護
- API管理後端已鎖定為僅接受來自前門的流量
針對不同的安全性需求,您可以使用自訂端點。 如需詳細資訊,請參閱自訂前門端點。
先決條件
安裝之前,請確定您擁有:
-
Node.js 18+ (建議使用LTS)
-
Cursor IDE (建議)或其他與MCP相容的IDE
note note NOTE 雖然支援其他MCP相容的IDE,但為獲得最佳體驗,建議使用Cursor。 如果您使用其他IDE,則需要修改檔案中的提示和其他步驟,才能使用您選取的IDE。
安裝
-
全域安裝Adobe I/O CLI:
code language-bash npm install -g @adobe/aio-cli -
使用Adobe IMS進行驗證:
code language-bash aio auth login -
複製Commerce擴充功能工具存放庫,並導覽至目錄:
code language-bash git clone https://github.com/adobe-commerce/commerce-extensibility-tools.git cd commerce-extensibility-tools -
安裝相依性:
code language-bash npm install -
在您的Commerce專案目錄中建立或更新
.cursor/mcp.json(非全域)以包含commerce-extensibility-toolsMCP伺服器:code language-json { "mcpServers": { "commerce-extensibility-tools": { "command": "node", "args": [ "/<your-project-directory>/commerce-extensibility-tools/index.js" ], "env": { "NODE_ENV": "production" } } } }請確定您將
<your-project-directory>取代為您複製存放庫的實際路徑。note note NOTE 在Windows上,如果您在提供專案目錄的路徑時遇到問題,請參閱路徑問題疑難排解。 -
重新啟動Cursor IDE以載入MCP伺服器。
-
詢問AI助理以驗證安裝:
code language-shell-session Can you show me the available Adobe Commerce tools?
使用情況
安裝之後,您可以自動呼叫索引🔗或明確。 您也可以使用/search-commerce-docs命令。
自動選取索引(建議)
若詢問您Commerce專案的自然語言問題,此工具會自動搜尋適當的檔案索引並提供相關資訊:
下列提示會自動選取commerce-storefront-docs索引:
"How do I use Edge Delivery Services drop-ins for product listing?"
下列提示會自動選取commerce-extensibility-docs索引:
"How do I create a webhook in Adobe Commerce?"
下列提示會自動選取commerce-core-docs索引:
"How to configure product catalog settings?"
下列提示會自動選取app-builder-docs索引:
"What are App Builder runtime action best practices?"
明確選取索引
或者,您可以指定要在提示中使用的索引。
Search commerce-storefront-docs for authentication drop-in
Using app-builder-docs, how do I deploy runtime actions?
命令式搜尋
如果您要確保使用RAG服務,可以手動叫用/search-commerce-docs Cursor命令以搜尋包含提示字元的檔案:
/search-commerce-docs "How do I subscribe to Commerce events?"
自訂前門端點
依預設,檔案搜尋會使用具有WAF保護的生產Azure Front Door端點。 為了測試或開發目的,您可以使用FRONT_DOOR_URL環境變數覆寫此專案。
若要使用自訂端點,請將其新增至您的Cursor MCP設定:
{
"mcpServers": {
"commerce-extensibility-tools": {
"command": "node",
"args": ["/<your-project-directory>/commerce-extensibility-tools/index.js"],
"env": {
"NODE_ENV": "production",
"FRONT_DOOR_URL": "https://<custom-endpoint>.azurefd.net"
}
}
}
}
FRONT_DOOR_URL變數。疑難排解
以下小節提供使用檔案RAG服務時可能遇到的常見問題的疑難排解提示。
驗證錯誤
檔案搜尋工具需要Adobe IMS驗證。 如果您遇到驗證錯誤,請使用下列步驟來疑難排解並解決問題。
-
確認您已登入:
code language-bash aio where -
確認您可以看到您的IMS權杖:
code language-bash aio auth login --bare -
如果驗證錯誤持續存在,請嘗試登出並重新登入:
code language-bash aio auth logout aio auth login
MCP伺服器未載入
如果MCP伺服器未連線,或您的代理程式指出無法連線到RAG,請使用下列步驟進行疑難排解並解決問題。
-
使用Cmd 、 (macOS)或Ctrl 、 (Windows和Linux)開啟游標設定。
-
搜尋「MCP」並確認已列出並啟用
commerce-extensibility-tools。 -
檢查MCP設定面板中的錯誤訊息。
-
確認您的專案中有
mcp.json檔案:code language-bash cat .cursor/mcp.json -
驗證路徑正確且絕對:
code language-bash ls -la /<your-project-directory>/commerce-extensibility-tools/index.js
找不到工具
-
結束游標並重新開啟。
-
使用Cmd+Shift+P (macOS)或Ctrl+Shift+P (Windows/Linux)並搜尋「開發人員:開啟記錄檔資料夾」,在Cursor的開發者主控台中檢查MCP伺服器記錄。
-
確認安裝:
code language-bash cd commerce-extensibility-tools npm install node index.js伺服器應該會在沒有錯誤的情況下啟動。
路徑問題(Windows)
在Windows上,使用正斜線/或逸出的反斜線\\:
{
"args": ["C:/Users/yourname/projects/commerce-extensibility-tools/index.js"]
}
{
"args": ["C:\\Users\\yourname\\projects\\commerce-extensibility-tools\\index.js"]
}