# Financial Media RAG Agent & Evaluation (AIMI 106 artifact 106-A1)
# Financial Media RAG Agent & Evaluation（AIMI 106 作品 106-A1）

> Use your learner code, not your real name. Index only the course's simulated documents (Report A and Report B) or public documents you are entitled to use, in a service your organisation has authorised. Never upload company secrets, client personal data, unpublished material or other restricted data. Nothing in this evaluation is investment advice.
> 請使用學員代碼，不要填寫真實姓名。只把課程提供的模擬文件（報告 A、報告 B）或你有權使用的公開文件放入組織已授權的服務。切勿上傳公司機密、客戶個資、未公開資料或其他受限資料。本評估內容不構成投資建議。

Prototype track / 實作方式: [ ] No-code tool / No-Code 工具 [ ] Code / 程式（both tracks use the same rubric / 兩軌評分標準相同）

## Part 1. Artifact fields / 作品欄位

| # | Field / 欄位 | Your answer / 你的內容 |
|---|---|---|
| 1 | Use case / 使用情境: who asks what, and what a wrong answer would cost / 誰要問什麼問題？答錯的後果是什麼？ | |
| 2 | Document sources / 文件來源: at least two lawful documents with source, date, version and page/section identifiers / 至少 2 份合法可用文件：來源、日期、版本與頁碼／段落識別 | |
| 3 | Chunking and metadata / Chunking 與 Metadata: how documents are chunked and which metadata is kept (document, version, page, section, date) / 切分方式與保留的 Metadata | |
| 4 | Retrieval flow / 檢索流程: query, retrieval (keyword, embedding or hybrid), multi-step comparison, answer composition, abstention rule / 查詢、檢索、（多步驟）比對、答案組成與拒答規則 | |
| 5 | Baseline / 基準比較: LLM-only or keyword-retrieval results on the same ten questions / LLM-only 或關鍵字檢索在相同 10 題的結果 | |
| 6 | Evaluation results / 評估結果: hit@k, citation accuracy, groundedness and abstention on ten questions, with sample limits (Part 3) / 10 題的 hit@k、引用正確、忠實度與拒答結果，並附樣本限制 | |
| 7 | Citation check / 引用核查: each citation checked against its document and page/section (Part 4) / 逐筆核對引用的文件與頁碼／段落 | |
| 8 | Abstention tests / 拒答測試: responses to at least two no-evidence questions, and the verdict / 至少 2 題無證據題目的回應與判定 | |
| 9 | Failure log / Failure Log: retrieval or answer failures, causes and fixes (Part 5) / 檢索或答案失敗的案例、原因與改善 | |
| 10 | Risks and governance / 風險與治理: data rights, upload restrictions, prompt injection, human review and the accountable owner / 資料授權、上傳限制、提示注入、人工審核與負責人 | |

## Part 2. Rubric (L2, human review) / Rubric（L2，人工審查）

| Domain / 面向 | Points / 配分 | Fields assessed / 對應欄位 |
|---|---|---|
| Knowledge architecture / 知識架構 | 25 | 1 Use case, 2 Document sources, 3 Chunking and metadata, 4 Retrieval flow |
| Retrieval quality / 檢索品質 | 25 | 5 Baseline, 6 Evaluation results |
| Answers and citations / 答案及引用 | 30 | 7 Citation check, 8 Abstention tests, 6 Evaluation results |
| Risk and failure analysis / 風險／失敗分析 | 20 | 9 Failure log, 10 Risks and governance |
| **Total / 總分** | **100** | Pass: **80/100 or more and no Critical Fail** / 通過：**80/100 以上且無 Critical Fail** |

## Critical Fail checklist / Critical Fail 檢核
Any one of these fails the artifact regardless of score. / 任一項成立即不通過，與分數無關。
- [ ] No document, source or page number is fabricated: every citation exists in the retrieved chunk metadata / 沒有捏造文件、來源或頁碼：每個引用都存在於實際檢索到的 Chunk Metadata
- [ ] Information that was not retrieved is never presented as certain fact / 沒有把未檢索到的資訊當作確定事實
- [ ] No restricted data was uploaded to an unauthorised service / 沒有將受限資料上傳至未授權服務

## Part 3. Metric worksheet / 指標工作表

Record one row per question from `AIMI106_QA_Evaluation_Set.csv`. Run the same ten questions through your RAG prototype and through the baseline.
每題一列，題目來自 `AIMI106_QA_Evaluation_Set.csv`。RAG 原型與基準都要跑同樣 10 題。

| test_id | Answerable? / 可回答？ | Relevant chunk in top k? (hit) / 前 k 名命中？ | Citations given / 引用數 | Citations correct / 正確引用數 | Claims / 主張數 | Claims supported / 有支持的主張數 | Abstained? / 拒答？ | Expected? / 符合預期？ | Baseline result / 基準結果 |
|---|---|---|---|---|---|---|---|---|---|
| T01 | | | | | | | | | |
| T02 | | | | | | | | | |
| T03 | | | | | | | | | |
| T04 | | | | | | | | | |
| T05 | | | | | | | | | |
| T06 | | | | | | | | | |
| T07 | | | | | | | | | |
| T08 | | | | | | | | | |
| T09 | | | | | | | | | |
| T10 | | | | | | | | | |

k used / 使用的 k = ____

| Metric / 指標 | Formula / 計算方式 | RAG | Baseline / 基準 |
|---|---|---|---|
| hit@k | answerable questions with a relevant chunk in the top k / answerable questions（只計可回答題目） | __ / __ | __ / __ |
| Citation accuracy / 引用正確率 | correct citations / all citations given | __ / __ | __ / __ |
| Groundedness / 忠實度 | supported claims / all claims in answers | __ / __ | __ / __ |
| Abstention (no-evidence) / 拒答（無證據題） | no-evidence or out-of-scope questions correctly declined / all such questions | __ / __ | __ / __ |
| Over-abstention / 過度拒答 | answerable questions wrongly declined / answerable questions | __ / __ | __ / __ |

> **Small-sample warning / 小樣本警示.** Ten questions give an early indication only. One question changes a rate by ten percentage points or more, so do not report these figures as production accuracy and do not claim a percentage improvement over the baseline as a settled result. Write the counts (for example 6/8), state the confidence limits, and list what a larger test would need.
> 10 題只能作為初步指標；一題就會讓比率變動 10 個百分點以上。不要把結果寫成正式環境準確率，也不要把相對基準的百分比提升當作既定結論。請寫出原始計數（例如 6/8）、說明信心限制，並列出擴大測試需要什麼。

Confidence limits and next test / 信心限制與後續測試：

## Part 4. Citation check log / 引用核查紀錄

| test_id | Cited document, version, page/section / 引用的文件、版本、頁碼／段落 | Opened and found supporting text? / 打開後找到支持文字？ | Version valid? / 版本有效？ | Pass / Fail | Note / 備註 |
|---|---|---|---|---|---|
| | | | | | |
| | | | | | |

## Part 5. Failure log / Failure Log

Classify each failure as retrieval (relevant chunk not found), generation (retrieved but misstated), citation (wrong or fabricated location), abstention (answered without evidence, or declined when evidence existed), version (superseded content used) or injection (retrieved text treated as an instruction).
請將每個失敗歸類為：檢索、生成、引用、拒答、版本或提示注入。

| test_id | Failure type / 類型 | What happened / 發生了什麼 | Likely cause / 可能原因 | Fix and retest result / 改善與重測結果 |
|---|---|---|---|---|
| | | | | |
| | | | | |

## Part 6. Human review sign-off / 人工審核
- Reviewer (learner code) / 審核者（學員代碼）:
- Date / 日期:
- Decision / 判定: [ ] Ready for wider testing / 可擴大測試 [ ] Revise / 修正 [ ] Stop / 停止
- Conditions / 條件:
