Context Engineering Foundation

Make Notion
AI-Readable

A structural overhaul so agents can resolve vague commands like "📌🤖 Shoot พี่กบ" autonomously — without asking 10 questions first.

6
Databases Audited
6
Critical Gaps
4
Build Phases
~2h
Total Build Time
The Problem

Why AI Can't Figure Things Out

When you write "📌🤖 Shoot พี่กบ", the AI needs to: identify the client, find their content plan, pull latest meeting notes, and invoke the right skill. Right now, it can't do any of that.

Gap 1: No Entity Resolution

พี่กบ = G&O = Green & Organic — but the Lead DB only says "🟡 G&O พี่กบ". AI can't match a calendar event to a client without aliases.

📌🤖 Shoot กบ → AI searches Lead DB for "กบ" → 0 results (Name is "🟡 G&O พี่กบ")

Gap 2: Zero Cross-DB Relations

Lead DB, Content DB, and Tasks DB are isolated silos. Even if AI finds the client, it can't traverse to their content plan or meeting notes.

Found lead "G&O พี่กบ" → but no link to Content DB entries → no link to Tasks DB meeting notes

Gap 3: Meeting Notes Buried

"คุยงาน 4.3.26" contains notes for 8+ clients in a single page. AI can't extract "latest meeting about พี่กบ" without reading entire multi-client pages.

คุยงาน 4.3.26 → พี่ทอมมี่ + พี่ป๊อป + พี่กบ + พี่ต๋าว + พี่ซุ้ง + LivingStyle + แพร + SJC — all in one page

Gap 4: No Domain Vocabulary

AI doesn't know "Shoot" = filming, not weapons. No system maps Content Clinic terminology to skills and databases.

"Shoot" → should trigger shooting-plan skill + Content DB lookup. Currently: AI asks "what do you mean?"

Gap 5: No Intent Router

AI doesn't know which databases to search, or in what order, for different types of calendar commands.

"Make LA Trip Plan" → should search Lead DB for LA-related projects → find P Tommy → gather flight details from meeting notes

Gap 6: Content Plans Scattered

Shooting plans, content plans, and templates exist as loose pages — not linked to clients, not consistently named.

6+ shooting plan pages with dates in titles, no relation to Lead DB entries, mixed with templates

Four-Layer Context Stack

Each layer solves a different problem. Together, they enable agents to resolve any vague command autonomously.

Layer 4: Agent Skills — "What can I do?"
🤖 Calendar Worker
📋 Shooting Plan
📝 Proposal Generator
📊 Content Report
🔍 Client Lookup (NEW)
Layer 3: Context Router — "Where do I look?"
Intent → Skill Mapping
Domain Vocabulary
Search Priority Rules
Layer 2: Entity Resolution — "Who is this about?"
Lead DB Aliases
Fuzzy Name Matching
Client → Content Links
Client → Task Links
Layer 1: Clean Notion Data — "What do I have?"
💾 Lead DB (restructured)
💾 Content DB
💾 Tasks DB
📘 Knowledge DB
🔬 AI Use Case
How It Works After

Two Scenarios, Solved

Here's exactly how the AI resolves vague commands after the foundation is built.

📌🤖 Shoot พี่กบ
1

Parse intent: "Shoot" → Domain vocab maps to filming / content production

2

Resolve entity: Search Lead DB for "พี่กบ" (checks Name + Aliases field) → finds 🟡 G&O พี่กบ (aliases: กบ, G&O, Green Organic)

3

Gather context: Follow relations → latest meeting notes show "CEO Branding ส่วนตัวต่อ จนถึงเดือน 6, 60 ชิ้น, 3 Pillars: A=CEO certs, B=Podcast, C=Trend" + action items (นัดถ่าย, เขียนสรุปส่งกลุ่ม)

4

Route to skill: "Shoot" + client context → invoke shooting-plan skill with client data pre-loaded

5

Execute: Generate shooting plan for พี่กบ's CEO Branding phase, using the 3-pillar strategy from meeting notes

📌🤖 Make LA Trip Plan
1

Parse intent: "Make plan" + "LA Trip" → travel/logistics planning

2

Resolve entity: Search Lead DB + Tasks DB for "LA" → finds P Tommy entry with LA trip details from meeting notes (EVA Air, Pasadena address, dates Mar 12-18)

3

Gather context: Pull payment details, flight info, accommodation address, outstanding payments from meeting notes

4

Execute: Generate comprehensive trip plan with flight details, daily schedule, shooting locations, budget reconciliation

4 Phases, ~2 Hours Total

Each phase is self-contained. I can execute Phase 1-2 hands-off. Phases 3-4 need your quick review at the end.

Phase 1 ~35 min
Phase 2 ~30 min
Phase 3 ~30 min
Phase 4 ~25 min

Phase 1: Notion Schema Restructure

~35 min · Hands-off
1

Lead DB: Add 4 properties from PRD

Add Contract End (date), Last Contact (date), Source (select), Payment Type (select) — exactly as planned in the PRD.

update_data_source × 4 calls

2

Lead DB: Add "Aliases" text property

Free text field for alternative names: "กบ, G&O, Green Organic, กรีนออแกนิค". This is how the AI resolves entities.

update_data_source — ADD COLUMN "Aliases" RICH_TEXT

3

Lead DB: Rename Priority → Action

Split the overloaded Priority field: rename to Action, clean up options to sales-stage only.

update_data_source — RENAME + ALTER

4

Lead DB: Migrate payment data

For each lead with payment-type Priority values (⭐️Buffet, 🏦Monthly, 💵เงินสด), move to new Payment Type field.

update-page × ~15 leads

5

Backfill Aliases for key clients

Fill Aliases for the ~20 most active clients (Paid + Closing status). E.g., P Tommy → "ทอมมี่, Tommy, พี่ทอมมี่"

update-page × ~20 leads

6

Backfill Contract End dates

Extract dates from Note field for known contracts (per PRD table: พี่ป๊อป → 2026-08-31, BSG → 2026-03-31, etc.)

update-page × ~10 leads

Phase 2: Cross-DB Relations + Entity Links

~30 min · Hands-off
1

Add Relation: Lead DB → Content DB

Two-way relation so each lead links to their content entries, and each content entry links back to the client.

update_data_source — ADD COLUMN "Content" RELATION('content_ds_id', DUAL)

2

Add Relation: Lead DB → Tasks DB

Two-way relation for meeting notes, tasks, and action items linked to specific clients.

update_data_source — ADD COLUMN "Tasks" RELATION('tasks_ds_id', DUAL)

3

Link existing content to clients

For active clients (Paid status), find their content entries in Content DB and link them via the new relation.

update-page × estimated 30-40 links

4

Link meeting notes / tasks to clients

For recent task pages that reference specific clients, add the relation link back to Lead DB.

update-page × estimated 15-20 links

Phase 3: Context Router Skill

~30 min · Hands-off
1

Create "context-router" skill

A new Cowork skill that contains: domain vocabulary map, intent-to-skill routing table, entity resolution logic, and database search priority rules.

skill-creator → SKILL.md with full routing logic

2

Domain vocabulary map

Shoot/ถ่าย → filming/content production → shooting-plan skill. Deal/ดีล → sales proposal → proposal-generator. ปิด → close deal → Lead DB update. Report/รีพอร์ต → content-clinic-report skill. Plan/แผน → context-dependent (content plan vs trip plan vs daily plan).

3

Search priority rules

For client-related tasks: 1) Search Lead DB (Name + Aliases) → 2) Follow Relations to Content DB → 3) Follow Relations to Tasks DB → 4) Search recent meeting notes. For non-client tasks: 1) Tasks DB → 2) AI Use Case DB → 3) Knowledge DB.

4

Client Lookup sub-routine

A reusable function: given a name fragment → search Lead DB → return client page URL + status + latest meeting notes + content plan links + contract dates. This becomes the "context packet" that any skill can use.

Phase 4: Calendar Worker v2 Prompt

~25 min · Needs Review
1

Write Calendar Worker system prompt v2

Updated prompt that: reads context-router skill first, uses entity resolution to find clients, gathers context before acting, routes to appropriate skills.

Prompt Library → Notion

2

Test with "📌🤖 Shoot พี่กบ" scenario

Dry-run the full pipeline: parse → resolve → gather → route → execute. Verify each layer works.

3

Test with "📌🤖 Make LA Trip Plan" scenario

Verify cross-entity resolution (P Tommy + LA) and context gathering from meeting notes.

4

Save to Prompt Library + AI Use Case

Log the Context Engineering Foundation as a new AI Use Case, and save the Calendar Worker v2 prompt to Prompt Library.

Before & After

What Changes

❌ Before

🔴 "Shoot พี่กบ" → AI asks 5 questions before starting
🔴 Client info scattered across 3+ databases, unlinked
🔴 Meeting notes buried in multi-client task pages
🔴 Priority field overloaded with 12 meanings
🔴 No contract expiry tracking
🔴 AI doesn't know Content Clinic vocabulary
🔴 Content plans not linked to clients

✅ After

🟢 "Shoot พี่กบ" → AI finds client, pulls context, generates plan
🟢 Lead DB → Content DB → Tasks DB all linked via relations
🟢 Client entities resolved via Aliases (กบ = G&O = Green Organic)
🟢 Clean Action field for sales stage + separate Payment Type
🟢 Contract End dates visible + filterable
🟢 Context Router skill maps vocabulary → skills
🟢 Content entries linked to specific clients

What I Need From You

I can execute Phase 1-3 fully hands-off. Here's the small list of things only you can provide.

Before Phase 2

Quick review of aliases

I'll fill aliases based on what I can infer from Notion data. You do a 2-min scan to catch any I missed or got wrong.

Before Phase 2

Rosme's Notion User ID

Need this to migrate "Rosme" Priority entries to the Person field. I'll look this up from your workspace.

After Phase 4

Test the 2 scenarios

Try "📌🤖 Shoot พี่กบ" and "📌🤖 Make LA Trip Plan" in a real Calendar Worker session to validate the full pipeline.

Ready to Build?
Say "go" and I'll start Phase 1 immediately.
Content Clinic × Cowork · March 12, 2026