How we consolidated 3 projects into a single AI-readable knowledge base
The Problem
Three projects. Each with its own AGENTS.md, STATUS.md, and scattered context. Information was duplicated, inconsistent, and hard to maintain. When one project's stack changed, we had to remember to update the others.
Worse — onboarding an AI agent to work on a project meant re-reading the same patterns across different files with slightly different phrasing.
The Solution: Open Knowledge Format (OKF)
We designed OKF — a directory-based knowledge system using Markdown files with YAML frontmatter. Every file has structured metadata (type, id, last_updated) followed by human-readable Markdown.
AI-Knowledge-Base/
├── agents/ ← Agent profiles (stack, commands, patterns, triggers)
│ ├── AGENTS.md ← Registry index
│ ├── project-a-agent.md
│ ├── project-b-agent.md
│ └── project-c-agent.md
├── memory/ ← User profile + cross-project comparison
│ ├── user-profile.md
│ └── projects-summary.md
├── tasks/ ← Shared triggers & workflows
│ └── overview.md
└── blog/ ← Posts about the system itself
└── this-file.md
Step 1: Consolidate
We read AGENTS.md and STATUS.md from all three projects and extracted their essence into dedicated agent profile files under AI-Knowledge-Base/agents/. Each profile captures:
- Stack & tooling (frameworks, databases, deployment)
- Directory structure with responsibilities
- Key patterns (auth, theming, state management)
- Project-specific triggers (
update .md,cleanup) - Environment variables (without exposing values)
Step 2: Thin the Projects
Each project's AGENTS.md was reduced to ~5 lines — just a reference to the central KB:
<span class="hljs-section"># Project Name</span>
<span class="hljs-section">## KB</span>
<span class="hljs-bullet">-</span> <span class="hljs-code">`~/AI-Knowledge-Base/agents/project-x-agent.md`</span> — full context
<span class="hljs-bullet">-</span> <span class="hljs-code">`~/AI-Knowledge-Base/memory/user-profile.md`</span> — preferences
All operational context now lives in one place. When an AI opens a project, it reads the thin file, follows the link, and gets everything it needs.
Step 3: Standardize Triggers
We normalized two core triggers across all projects:
| Trigger | Action |
|---|---|
update .md |
Re-read STATUS.md → update from latest state → sync back to KB |
cleanup |
Scan unused → health check → present findings → update STATUS.md + KB |
Each project's tooling is respected:
- Project A (React + Vite) runs
tsc --noEmit+vitest+eslint - Project B (Next.js 14) runs
npm run build(built-in checks) - Project C (Next.js 16 + Drizzle) runs
npm run lint+tsc --noEmit
Step 4: Auto-Sync to Shared Storage
Since the platform's filesystem doesn't support symlinks, we built a lightweight watcher daemon using inotifywait. It monitors the KB directory and syncs changes to a shared folder automatically. Starts on boot via platform init scripts.
Results
- Single source of truth — one
update .mdnow updates STATUS.md AND the central KB - Consistent AI behavior — every agent reads the same user-profile, same rules
- Ultra-thin project files — AGENTS.md is now 5–9 lines per project
- Cross-project visibility —
memory/projects-summary.mdcompares all 3 side-by-side - Auto-synced — changes propagate to shared storage automatically
Lessons
- YAML frontmatter is worth it — it makes metadata machine-parseable while keeping files human-readable
- Centralization demands discipline — when you update a project, remember to sync the KB
- Thin AGENTS.md forces you to keep KB clean — if the KB is messy, the thin file loses its value
รวมความรู้ 3 โปรเจกต์เป็น knowledge base เดียวที่ AI อ่านได้
ปัญหา
สามโปรเจกต์ แต่ละอันมี AGENTS.md, STATUS.md, และ context กระจายของตัวเอง ข้อมูลซ้ำซ้อน, ไม่ consistent, และ maintain ยาก เมื่อ stack ของโปรเจกต์หนึ่งเปลี่ยน ต้องจำว่าต้องอัปเดตที่อื่นด้วย
แย่กว่านั้น — onboarding AI agent ให้ทำงานกับโปรเจกต์หมายถึงการอ่าน pattern เดิมๆ ข้ามหลายไฟล์ที่มีการเขียนต่างกันเล็กน้อย
ทางออก: Open Knowledge Format (OKF)
เราออกแบบ OKF — ระบบ knowledge แบบ directory-based ใช้ Markdown files พร้อม YAML frontmatter ทุกไฟล์มี structured metadata (type, id, last_updated) ตามด้วย Markdown ที่มนุษย์อ่านได้
AI-Knowledge-Base/
├── agents/ ← Agent profiles (stack, commands, patterns, triggers)
│ ├── AGENTS.md ← Registry index
│ ├── project-a-agent.md
│ ├── project-b-agent.md
│ └── project-c-agent.md
├── memory/ ← User profile + cross-project comparison
│ ├── user-profile.md
│ └── projects-summary.md
├── tasks/ ← Shared triggers & workflows
│ └── overview.md
└── blog/ ← Posts about the system itself
└── this-file.md
ขั้นที่ 1: รวมศูนย์
อ่าน AGENTS.md และ STATUS.md จากทั้งสามโปรเจกต์ แล้วสกัด essence ใส่ไฟล์ agent profile โดยเฉพาะภายใต้ AI-Knowledge-Base/agents/ แต่ละ profile จับ:
- Stack & tooling (frameworks, databases, deployment)
- Directory structure พร้อมหน้าที่
- Key patterns (auth, theming, state management)
- Project-specific triggers (
update .md,cleanup) - Environment variables (ไม่เปิดเผยค่า)
ขั้นที่ 2: ทำให้โปรเจกต์บางลง
AGENTS.md ของแต่ละโปรเจกต์ถูกลดเหลือ ~5 บรรทัด — แค่ reference ไปยัง central KB:
<span class="hljs-section"># Project Name</span>
<span class="hljs-section">## KB</span>
<span class="hljs-bullet">-</span> <span class="hljs-code">`~/AI-Knowledge-Base/agents/project-x-agent.md`</span> — full context
<span class="hljs-bullet">-</span> <span class="hljs-code">`~/AI-Knowledge-Base/memory/user-profile.md`</span> — preferences
operational context ทั้งหมดอยู่ที่เดียว เมื่อ AI เปิดโปรเจกต์ มันอ่าน thin file, ตามลิงก์, และได้ทุกอย่างที่ต้องการ
ขั้นที่ 3: ทำให้ Triggers มาตรฐานเดียวกัน
normalize triggers หลักสองตัวข้ามทุกโปรเจกต์:
| Trigger | Action |
|---|---|
update .md |
อ่าน STATUS.md ซ้ำ → อัปเดตจากสถานะล่าสุด → sync กลับไป KB |
cleanup |
สแกนของที่ไม่ได้ใช้ → health check → เสนอผล → อัปเดต STATUS.md + KB |
tooling ของแต่ละโปรเจกต์ถูกรักษาไว้:
- Project A (React + Vite) รัน
tsc --noEmit+vitest+eslint - Project B (Next.js 14) รัน
npm run build(built-in checks) - Project C (Next.js 16 + Drizzle) รัน
npm run lint+tsc --noEmit
ขั้นที่ 4: Auto-Sync ไปยัง Shared Storage
เพราะ filesystem ของ platform ไม่ support symlinks, เราสร้าง watcher daemon น้ำหนักเบาด้วย inotifywait มัน monitor KB directory และ sync การเปลี่ยนแปลงไปยัง shared folder อัตโนมัติ เริ่มตอน boot ผ่าน platform init scripts
ผลลัพธ์
- Single source of truth —
update .mdเดียวตอนนี้อัปเดตทั้ง STATUS.md และ central KB - Consistent AI behavior — agent ทุกตัวอ่าน user-profile และ rules ชุดเดียวกัน
- Ultra-thin project files — AGENTS.md ตอนนี้ 5–9 บรรทัดต่อโปรเจกต์
- Cross-project visibility —
memory/projects-summary.mdเปรียบเทียบทั้งสามโปรเจกต์ side-by-side - Auto-synced — การเปลี่ยนแปลงกระจายไปยัง shared storage อัตโนมัติ
บทเรียน
- YAML frontmatter คุ้มค่า — ทำให้ metadata machine-parseable ในขณะที่ไฟล์ยังอ่านได้โดยมนุษย์
- Centralization ต้องมีวินัย — เมื่ออัปเดตโปรเจกต์ อย่าลืม sync KB
- Thin AGENTS.md บังคับให้ KB สะอาด — ถ้า KB รก thin file ก็ไร้ค่า