Memory Vault ที่ดีไม่ใช่แค่เก็บ note เยอะ แต่ต้องเปลี่ยน raw experience ให้กลายเป็น reusable project knowledge ผ่าน workflow ที่มีวินัย
| Workflow | หน้าที่ |
|---|
| Ingest | เอา raw notes, issue, meeting, PR, incident เข้าระบบ |
| Distill | ให้ AI สรุปเป็น wiki note ที่อ่านง่าย |
| Link | เชื่อม note ที่เกี่ยวข้อง |
| Query | ให้ agent อ่านเฉพาะ context ที่เกี่ยวข้อง |
| Lint | ตรวจ note ซ้ำ, orphan note, decision ที่ขัดกัน |
| Log | บันทึกว่า agent ทำอะไรกับ vault |
แนวคิด LLM Wiki layer ในบทความนี้ได้รับแรงบันดาลใจจาก gist ของ Andrej Karpathy เรื่องการใช้ LLM ช่วยดูแล persistent wiki แต่ workflow 6 ขั้นต่อไปนี้เป็น operational design ที่ผมจัดโครงขึ้นเพื่อใช้กับ AI coding agent และทีมพัฒนาโดยเฉพาะ ไม่ใช่ specification ตายตัวของ Karpathy คุณควรใช้เป็น starting point แล้วปรับตาม workflow, risk profile และ tooling ของทีม
ตัวอย่าง End-to-End Workflow
สมมติทีมเจอ incident: checkout ช้าและ payment timeout ระหว่าง traffic สูง
1. Ingest
เอาข้อมูลดิบเข้ามาก่อน เช่น Slack thread, incident note, PR description, log excerpt และคำอธิบายจาก developer ที่แก้ปัญหาในวันนั้น ข้อมูลพวกนี้ยังไม่ต้องเรียบร้อย แต่ต้องไม่หาย
2. Distill
ให้ agent สกัดเป็น wiki note ที่มี structure เดียวกันทุกครั้ง เช่น Problem, Root Cause, Decision, Future Rule, Related Notes และ Status จุดนี้คือการเปลี่ยน raw memory ให้เป็น project knowledge
3. Link
เชื่อม note ใหม่เข้ากับ API Gateway Timeout Policy, Billing Service, Payment API, Retry Policy และ architecture decision ที่เกี่ยวข้อง การ link ไม่ใช่แค่เพื่อ graph สวย แต่เพื่อให้ session ถัดไปอ่านบริบทต่อเนื่องได้
4. Query
ครั้งต่อไปที่ agent ถูกสั่งให้แก้ payment timeout มันไม่ควรอ่านทั้ง vault แต่ควรเริ่มจาก MOC แล้ว query เฉพาะ note ที่เกี่ยวกับ payment, timeout, retry และ billing-service
5. Lint
ให้ agent ตรวจว่า note ใหม่ซ้ำกับ note เก่าหรือไม่ มี decision ไหนขัดกันหรือไม่ มี note ไหนไม่มี backlink หรือไม่มี status หรือไม่
6. Log
ทุกการสร้างหรือแก้ note ต้องลง session log เพื่อให้ทีมย้อนดูได้ว่า agent ทำอะไร ใช้ context อะไร และมี follow-up อะไรเหลืออยู่
ตัวอย่าง: จาก Debug Log เป็น Wiki Note
Raw note จากการแก้ปัญหา:
2026-05-20
Payment API timeout ตอนเรียก billing-service
สาเหตุคือ retry 3 ชั้น: frontend retry, API gateway retry, service retry
แก้โดยปิด retry ที่ frontend และย้าย timeout control ไปที่ gateway
Distilled wiki note ที่ agent อ่านซ้ำได้:
---
title: Payment API Timeout Caused by Layered Retry
type: debug-lesson
component: payment-api
status: resolved
tags: [payment, timeout, retry]
related: [[API Gateway Timeout Policy]], [[Billing Service]]
---
## Problem
Payment API เกิด timeout เมื่อเรียก billing-service
## Root Cause
มี retry ซ้อนกัน 3 ชั้น: frontend retry, API gateway retry, service retry
## Decision
ปิด retry ที่ frontend และให้ gateway เป็นจุดควบคุม timeout หลัก
## Future Rule
ห้ามเพิ่ม retry layer ใหม่โดยไม่ตรวจ retry policy ทั้ง flow ก่อน
ตัวอย่าง: Session Log ที่ดี
---
date: 2026-05-20
agent: Claude Code
type: session-log
scope: payment-api
tags: [session-log, payment-api]
---
## Task
Refactor payment timeout handling
## Files touched
- payment-api/src/client/billing.ts
- docs/04_Architecture_Decisions/API Gateway Timeout Policy.md
## Context used
- [[Payment API Timeout Caused by Layered Retry]]
- [[Billing Service]]
- [[API Gateway Timeout Policy]]
## Changes made
- Removed frontend retry
- Centralized timeout handling at gateway
- Updated debug lesson note
## Follow-up
Review retry behavior in refund flow
ความแตกต่างระหว่าง raw note กับ distilled wiki note อยู่ที่ structure ที่ agent อ่านแล้วได้ context ครบในครั้งเดียว ไม่ต้อง infer จาก free text
Obsidian ช่วยตรงนี้ได้เพราะ vault คือ folder ของ Markdown plain text ที่แก้ด้วย editor หรือ file manager อื่นได้4 ส่วน Properties/YAML ทำหน้าที่เป็น structured metadata ให้ note ค้นหา กรอง และใช้กับ plugin ต่อได้5 Dataview ก็ทำงานบน metadata ใน Markdown เช่น YAML frontmatter และ inline fields ไม่ใช่การอ่านทุกอย่างใน vault แบบวิเศษ6
LLM Wiki ไม่ใช่การเก็บ note ให้เยอะขึ้น แต่คือการทำให้ raw experience กลายเป็น reusable project knowledge