name: knowledge-base description: Read & add to the COMPANY knowledge base (shared vault of the company's own docs — SOPs, policies, product/pricing facts, playbooks). Trigger when the user asks something that should be answered from the company's internal knowledge, asks "what's in the company KB / kho tri thức", or asks to save a GENERAL company fact/note into the company knowledge. Company-level & shared (≠ per-user notes). Tier-gated (Pro+). KHÔNG dùng skill này cho Business Model Canvas / BMC / khung khởi nghiệp / các ô của canvas (khách hàng, giá trị, doanh thu, kênh, đối tác, chi phí, nguồn lực, hoạt động, quan hệ khách) — đó là việc của skill startup-kit, ngay cả khi user nói "lưu/cập nhật".
Shared, company-level vault of plain markdown at company_kb/ (obsidian-wiki "digital brain"
pattern). Distinct from per-user state (users/<id>/): this is the WHOLE TEAM's knowledge.
The deterministic guard lib/kb.py enforces admin-only writes + path safety. You only read it
and relay messages.
company_kb/_index.md FIRST (the map of topics → page), and company_kb/notes.md
if it exists (admin's manual quick-captures — live & readable)..md. To locate by keyword instead:
python3 lib/kb.py search "<keyword>" → JSON hits:[{path,title}] (covers notes.md too);
open the top hit's path.lib/kb.py status → empty:true): tell the user the KB exists but is empty and how
to fill it (relay status message). Do NOT invent company facts to fill the gap.⛔ Defer first: nếu nội dung thuộc Business Model Canvas / khung khởi nghiệp (khách hàng, giá trị, doanh thu, kênh, đối tác, chi phí, nguồn lực, hoạt động, quan hệ khách — hoặc user nhắc "BMC"/"business model canvas"/"startup kit") → KHÔNG capture ở đây. Đó là ô có cấu trúc, phải lưu qua skill startup-kit (
startup_kit.py save <fw> <block>) để dashboard + canvas cập nhật. KB chỉ nhận tri thức CHUNG không gắn khung (SOP, chính sách, giá, playbook…).
CHỦ ĐỘNG ghi — KHÔNG cần user gọi "ghi nhớ": khi admin/CEO nêu một fact công ty đáng nhớ lâu dài
trong lúc trò chuyện (quyết định, giá, thông tin khách, SOP, chính sách, bài học, số liệu chốt) → tự
capture rồi báo ngắn một dòng "📝 đã lưu vào kho: …". Vẫn xử lý câu rõ ràng ("ghi vào kho tri thức: …").
- Bỏ qua điều vụn vặt, riêng tư cá nhân (per-user), câu hỏi/đùa, hay thuộc BMC (defer startup-kit). Phân vân giá trị thấp → KHÔNG ghi.
- CHỈ admin/CEO: python3 lib/kb.py capture "<note>" → relay message (admin_only→relay; ok→báo đã lưu). Vào notes.md, đọc lại được ngay.
- 🚫 Ở đây chỉ append notes.md — KHÔNG sửa _index.md/trang, KHÔNG cross-link. Gộp ghi chú thô thành
trang Brain có cấu trúc = skill kb-ingest (admin gõ "nạp kiến thức").
python3 lib/kb.py status → {pages, inbox, empty, message}. Use the message to tell the
user what the KB is and that it starts empty (the customer sets up their own structure).