# 調用鏈使用教程

## 功能介紹

調用鏈（又稱“trace”）為用戶提供對話嘅洞察能力，幫助用戶覺察模型、知識庫、MCP、網絡搜索等喺對話過程中嘅具體表現。佢係一個基於 [OpenTelemetry](https://opentelemetry.io/docs/languages/js/) 實現嘅可觀測工具，通過端側採集、存儲、處理數據實現可視化，為定位問題、優化效果提供量化評估依據。

每次對話對應一條 trace 數據，一條 trace 由多個 span 組成，每個 span 對應 Cherry Studio 嘅一個程序處理邏輯如調用模型會話、調用 MCP 、調用知識庫、調用網絡搜索等。trace 以樹結構展示，span 為樹節點，主要數據包括耗時、token 使用量，當然喺 span 詳情還可以查看其具體嘅輸入輸出。

<figure><img src="/files/d5d0daf31f41b83ff1bd808bd82869cee311912b" alt=""><figcaption></figcaption></figure>

## 開啟 Trace

預設情況下，Cherry Studio 安裝之後，Trace 係隱藏嘅狀態。需要喺 "設置"-"常規設置" - "開發者模式" 中開啟，如下圖：

<figure><img src="/files/15fdba0057df6e54e767c4f080336cf2270e7472" alt=""><figcaption></figcaption></figure>

而且對於之前嘅會話唔會產生 Trace 記錄，只會喺新嘅問答產生之後先會產生 Trace 記錄。所產生嘅記錄儲存在本地，如需要徹底清除 Trace ，可以通過 "設置" - "數據設置" - "數據目錄" - "清除緩存" 進行清除，亦可通過手動 刪除 \~/.cherrystudio/trace 下嘅文件進行清除，如下圖：

<figure><img src="/files/5b4fcdcf560adfaa5b4768063f8b418744565e4b" alt=""><figcaption></figcaption></figure>

## 場景介紹

### 全鏈路查看

喺 Cherry Studio 對話框中撳調用鏈查看調用鏈嘅全鏈路數據。無論喺對話過程中調用咗模型，定係網絡搜索、知識庫、MCP，都可以喺調用鏈窗口中查看到全鏈路調用數據。

<figure><img src="/files/9fa4901748c0d72e76dda40be062b911f8c37718" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/1e81030ae099a4ef3a560d347f6e61147a13d540" alt=""><figcaption></figcaption></figure>

### 查看鏈路中模型

如果想要查看調用鏈中模型嘅詳情，可以撳模型調用節點，查看其輸入、輸出詳情。

<figure><img src="/files/0e8bd329e589fc40f2af329afbe75daf0a70b8f4" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/ec4400db01c31f5cb9402a02eece0c72f0764007" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/8b4cab967291c64cecbe9c13b32361f61eff75ae" alt=""><figcaption></figcaption></figure>

### 查看鏈路中網絡搜索

如果想要查看調用鏈中網絡搜索嘅詳情，可以撳網絡搜索調用節點，查看其輸入、輸出詳情。喺詳情中，可以查看到調用網絡搜索查詢嘅問題同其返回嘅結果。

<figure><img src="/files/56d9b22c154166e2033bc7725e58e96d81bfe287" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/13ea0b5eeb31cbba7f06e265c03959665bbf3a6e" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/c7f7173fb81b1be46790d5f2784c161ffb7cce5c" alt=""><figcaption></figcaption></figure>

### 查看鏈路中知識庫

如果想要查看調用鏈中知識庫嘅詳情，可以撳知識庫調用節點，查看其輸入、輸出詳情。喺詳情中，可以查看到調用知識庫查詢嘅問題同其返回嘅答案。

<figure><img src="/files/6ea5bcbfe10733ce208cbe6722c40d187c720b48" alt=""><figcaption></figcaption></figure>

### 查看鏈路中 MCP 調用情況

如果想要查看調用鏈中 MCP 嘅詳情，可以撳 MCP 調用節點，查看其輸入、輸出詳情。喺詳情中，可以查看到調用此 MCP Server tool 嘅入參同 tool 嘅返回。

<figure><img src="/files/2458e6281c49728db3c5246fb2195fed34324b12" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/33aa3ed07ff6092d192b973c485a08b0364e001e" alt=""><figcaption></figcaption></figure>

## 問題同建議

當前功能由阿里雲 [EDAS](https://www.aliyun.com/product/edas) 團隊提供，如有問題或建議，請入釘釘群 （ 群號： 21958624 ） 同開發者進行深入溝通。

\\


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.cherry-ai.com/docs/zhong-wen-fan-ti/advanced-basic/trace.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
