TL;DR: ทำ RAG บน 3GPP Telecommunication Specification สำเร็จโดยใช้ Gemini 3.1 Pro Preview + ฟีเจอร์ gemini_analyze_pdf เป็น secret weapon วาด 5G architecture diagram แบบ Mermaid ได้ทันที และตอบคำถาม VoLTE call setup time ได้พร้อม reference จาก spec จริง ๆ
1) ปัญหาจริงของชาวเทลคอม: 3GPP Specs ไม่ใช่เอกสารธรรมดา
3GPP Technical Specifications (TS) คือมาตรฐานโทรคมนาคมที่รวมรายละเอียดทุกอย่างของระบบ 4G/5G ตั้งแต่ architecture, procedures, security จนถึง interfaces ระหว่าง network functions
ลักษณะที่ทำให้อ่านยาก:
- เอกสารแต่ละเล่มยาวเป็นร้อยถึงพันหน้า
- ใช้ศัพท์เฉพาะทางสูง (AMF, SMF, UPF, N1, N2, N3 interfaces ฯลฯ)
- เอกสารโยงกันข้ามเล่ม เช่น TS 23.501 อ้างอิง TS 23.502 และ TS 33.501 พร้อมกัน
- หาคำตอบเรื่องเดียวต้องเปิดหลายเล่มเทียบ
2) แนวคิด: RAG + Gemini PDF Feature
การทำ RAG (Retrieval-Augmented Generation) บน 3GPP TS ด้วย Gemini 3.1 Pro Preview ใช้ประโยชน์จาก 2 ส่วนหลัก:
- Context window ขนาดใหญ่ ของ Gemini 3.1 Pro Preview ทำให้โหลด spec ทั้งเล่มหรือหลาย section พร้อมกันได้
- gemini_analyze_pdf: ไม่ได้แค่ OCR text ออกมา แต่ทำความเข้าใจ structure ของ PDF เช่น table, diagram reference, section numbering และ cross-reference ระหว่างเอกสาร จึงสามารถตอบพร้อมระบุ section ที่มาได้อย่างแม่นยำ
3) Discord Bot: 3GPP TS God Mother
เพื่อให้ใช้งานสะดวก จึงสร้างเป็น Discord bot ชื่อ “3GPP TS God Mother”
Commands
/find [topic]— ค้นหา specs ตาม topic/load [spec]— โหลด specification เฉพาะเข้าระบบ/list— แสดง specs ที่โหลดแล้ว/clear— รีเซ็ต context
Popular Specs ที่รองรับ
- TS 23.501 — 5G System Architecture
- TS 23.502 — 5G System Procedures
- TS 38.300 — NR Overall Description
- TS 33.501 — 5G Security
4) Mermaid Diagram: Secret Weapon #2
นอกจากตอบคำถามแบบ text แล้ว บอทยังสามารถ generate Mermaid diagram ได้ในคำถามเดียว
ตัวอย่าง: ถามว่า “Show me a diagram of the 5G system architecture” บอทวาด 5G system architecture แบบ Reference Point Representation ออกมาได้ทันที ครอบคลุม NF ทั้งหมด:
- UE → RAN (Uu interface)
- AMF, SMF, UPF (Control/User plane)
- UDM, AUSF, PCF (Policy/Auth/Data)
- อ้างอิง: TS 23.501, Section 4.2.3

5) ผลลัพธ์การทดสอบจริง
Test 1: 5G System Architecture
คำถาม: “Show me a diagram of the 5G system architecture”
ผล: วาด Mermaid diagram ครบถ้วน พร้อม reference TS 23.501 Section 4.2.3
Test 2: VoLTE Call Setup Time
คำถาม: “What is average call setup time in VoLTE?”
ผล: ตอบว่า VoLTE-to-VoLTE ใช้เวลา 1.5 – 2.5 วินาที เร็วกว่า CSFB (Circuit Switched Fallback) ที่ใช้เวลา 4-8 วินาที เนื่องจากใช้ SIP signaling ผ่าน IMS บน IP packet data network


6) ข้อสังเกต/ข้อควรระวัง (ในเชิง Engineering)
- Gemini 3.1 Pro Preview ตอบได้ดีมากเมื่อ spec ถูก load เข้าระบบก่อน หากถามโดยไม่ load บอทจะระบุว่าคำตอบมาจาก general knowledge แล้วแนะนำให้ /find หรือ /load เสริม
- Context window มีขีดจำกัด การโหลด spec หลายเล่มพร้อมกันควรคัดเฉพาะที่เกี่ยวข้องกับงาน
- Mermaid diagram สร้างจาก text ที่ Gemini extract ออกมา ความถูกต้องขึ้นกับคุณภาพของ PDF source
References
- 3GPP TS 23.501 — System Architecture for the 5G System
- 3GPP TS 23.502 — Procedures for the 5G System
- Gemini API: https://ai.google.dev/gemini-api/docs
- Mermaid diagram syntax: https://mermaid.js.org/