oneie 3.3.4 → 3.3.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,138 @@
1
+ ### Attracting New Customers 🎯
2
+
3
+ **Goal:** Drive qualified traffic by becoming the most helpful padel resource online.
4
+
5
+ 1. **AI-Powered Content Generation for SEO:**
6
+
7
+ - **How it works:** A `marketing_agent` `Thing` is tasked to increase organic traffic. It analyzes `Knowledge` labels like `skill_level:beginner`, `racket_style:control`, and `brand:Bullpadel`. It then automatically generates a `guide` `Thing` titled, "The 2025 Guide: Best Bullpadel Control Rackets for Beginners."
8
+
9
+ - **Powerful Result:** Instead of generic blog posts, Nine Padel creates dozens of hyper-specific articles that rank #1 on Google for long-tail searches. This attracts players who have high purchase intent, establishing the store as an expert before the customer even sees a product.
10
+
11
+ 2. **Smarter Social Media Advertising:**
12
+
13
+ - **How it works:** The system logs a high number of `product_viewed` `Events` on advanced, power-style rackets. The `intelligence_agent` identifies this as a trend. It then instructs the `marketing_agent` to create a targeted ad campaign on social media featuring these specific rackets, aimed at users who match the `audience:advanced-player` profile.
14
+
15
+ - **Powerful Result:** Ad spend is drastically reduced and more effective. Instead of broadly targeting "padel players," Nine Padel targets a specific, validated interest group with the exact products they are already looking at, leading to higher click-through rates and lower acquisition costs.
16
+
17
+
18
+ ---
19
+
20
+ ### Converting Shoppers into Buyers 🛒
21
+
22
+ **Goal:** Create a frictionless, personalized path from browsing to checkout.
23
+
24
+ 1. **The Hyper-Personalized Racket Quiz:**
25
+
26
+ - **How it works:** A customer completes the quiz, which triggers a `quiz_completed` `Event`. This creates a `quiz_result` `Thing` permanently connected to that `customer`. When the customer returns to the site, a `sales_agent` immediately retrieves this `Thing` and customizes the homepage to showcase their top 3 recommended rackets.
27
+
28
+ - **Powerful Result:** The customer feels understood and valued. The store isn't just selling rackets; it's acting as a personal consultant. This builds trust and removes the paradox of choice, making the customer confident enough to click "Add to Cart."
29
+
30
+ 2. **Intelligent Abandoned Cart Recovery:**
31
+
32
+ - **How it works:** A customer adds a racket to their cart but doesn't complete the purchase. This is logged as a `product_added_to_cart` `Event` without a corresponding `order_placed` `Event`. After an hour, a `service_agent` analyzes the abandoned `shopping_cart` `Thing`. It sees a beginner racket and checks the `customer`'s history for `guide_viewed` events. It then sends a highly specific email: "Hi, I'm the Nine Padel assistant. I see you were looking at the Head Evo Sanyo, a great choice for improving control. Did you have any questions before you buy? Just reply to this email."
33
+
34
+ - **Powerful Result:** This replaces a generic, annoying "You forgot something!" email with a helpful, conversational intervention. It addresses potential hesitations, provides value, and has a much higher chance of recovering the sale.
35
+
36
+ 3. **Dynamic Bundling at Checkout:**
37
+
38
+ - **How it works:** When a customer proceeds to checkout, the `sales_agent` analyzes the `product_racket` `Thing` in their cart. It queries all past `order` `Things` to see what other items are most frequently bought with that specific racket. It then generates a one-time offer: "Wait! Players who bought the Nox AT10 also bought these high-performance grips and balls. Add them now for 15% off."
39
+
40
+ - **Powerful Result:** This is an upsell that feels like a helpful suggestion, not a pushy sales tactic. It increases the average order value by leveraging the collective intelligence of the entire customer base.
41
+
42
+
43
+ ---
44
+
45
+ ### Growing Customers for Life 🤝
46
+
47
+ **Goal:** Turn one-time buyers into a loyal community and repeat customers.
48
+
49
+ 1. **Proactive, Personalized Ownership Experience:**
50
+
51
+ - **How it works:** A `customer` is linked via a `Connection` to the specific `product_racket` they purchased. Six months after the `order_shipped` `Event`, the `marketing_agent` automatically sends them an email: "It's been 6 months with your Bullpadel Vertex. To maintain its peak performance, it's time to consider a new grip. Here are the top-rated grips that fit your racket."
52
+
53
+ - **Powerful Result:** The customer relationship doesn't end at the sale. The store becomes a long-term partner in their padel journey, building immense loyalty and creating natural opportunities for repeat purchases of accessories and future upgrades.
54
+
55
+ 2. **Automated Community Building:**
56
+
57
+ - **How it works:** When a customer buys a racket from the "Nox" `brand`, a `Connection` is automatically created making them a `member_of` the "Nox Players Club" `community` `Thing`. This private hub contains exclusive guides, tips from pros who use Nox, and a forum for other Nox owners.
58
+
59
+ - **Powerful Result:** The store builds a powerful moat against competitors. Customers are no longer just buying a product; they are joining an identity and a community. This fosters an emotional connection to the brand and the store, making them the default choice for all future padel needs.
60
+
61
+ # Most Valuable Customers
62
+ ### 1. The Whale 🐋
63
+
64
+ **Who they are:** The customer with the highest Lifetime Value (LTV). They buy expensive rackets and frequently purchase top-tier gear.
65
+
66
+ How the Ontology Finds Them:
67
+
68
+ The intelligence_agent queries all customer Things. For each one, it follows the places Connection to find every order Thing they've ever created. It then sums the total_price property from all their orders to calculate a precise LTV.
69
+
70
+ Actionable Insight:
71
+
72
+ These customers should receive a "white glove" experience. The system can automatically flag them to receive:
73
+
74
+ - A personal thank you email from the founder.
75
+
76
+ - Early access to new, high-end product releases.
77
+
78
+ - An exclusive invitation to a `community` `Thing` called the "Nine Padel Platinum Club."
79
+
80
+
81
+ ---
82
+
83
+ ### 2. The Loyalist 👑
84
+
85
+ **Who they are:** The repeat buyer. They may not have the highest LTV, but their purchase frequency is high. They consistently buy accessories like balls, grips, and apparel.
86
+
87
+ How the Ontology Finds Them:
88
+
89
+ The system analyzes the Events log for each customer. It counts the number of order_placed Events over time. A customer with a high count and a short time between events is identified as a Loyalist, especially if their order Things contain product_accessory Things.
90
+
91
+ Actionable Insight:
92
+
93
+ Loyalists are the foundation of your business. The ontology enables you to automate a loyalty program:
94
+
95
+ - After their third purchase, the system automatically sends them a 15% discount code for their next accessory purchase.
96
+
97
+ - The `marketing_agent` can create a subscription-style offer: "Never run out of grips again. Get a 3-pack delivered every 3 months and save 20%."
98
+
99
+
100
+ ---
101
+
102
+ ### 3. The Evangelist 📣
103
+
104
+ **Who they are:** The brand advocate. They might not be your biggest spenders, but they are your most powerful marketers. They leave positive reviews and drive new traffic to your site.
105
+
106
+ How the Ontology Finds Them:
107
+
108
+ The system finds customers who have multiple writes Connections to customer_review Things, especially those with a 5-star rating. If you implement a referral program, it can also track customers who have the most referred_by Connections, linking them to new customers they brought in.
109
+
110
+ Actionable Insight:
111
+
112
+ Evangelists should be empowered and rewarded for their advocacy.
113
+
114
+ - The system can automatically email them: "We love your reviews! Would you be willing to provide a video testimonial in exchange for a £50 gift card?"
115
+
116
+ - They can be given a unique, shareable discount code. The `intelligence_agent` can track its usage and reward the Evangelist with store credit for every new customer acquired.
117
+
118
+
119
+ ---
120
+
121
+ ### 4. The Profit Driver 💰
122
+
123
+ **Who they are:** The customer who consistently buys high-margin products. They don't wait for sales; they buy full-price items, bundles, and premium accessories.
124
+
125
+ How the Ontology Finds Them:
126
+
127
+ The intelligence_agent analyzes the contents of every order Thing. It filters for orders that contain product Things with the on_sale:false property or are linked to Knowledge labels like category:bundle or type:premium_accessory. It then identifies the customers who most frequently place these types of orders.
128
+
129
+ Actionable Insight:
130
+
131
+ These customers are your most profitable segment. You can maximize their value without offering discounts.
132
+
133
+ - Instead of price reductions, the system can offer them value-added bonuses like free, expedited shipping on their next order.
134
+
135
+ - When a new, high-margin product arrives, they are the first group to be notified.
136
+
137
+
138
+ This isn't just data; it's a dynamic playbook for customer relationship management. The ontology allows you to see the _story_ behind each customer and engage with them in the most intelligent and effective way possible.
@@ -0,0 +1,167 @@
1
+ ## The Six-Dimension Data Structure for Nine Padel
2
+
3
+ This is the blueprint for all your data, from static content files in your Astro project to dynamic data handled by Cloudflare.
4
+
5
+ ### 1. The `Group`: Your Business Core
6
+
7
+ This is the root of everything. It's a single, foundational object that defines the entire application's context.
8
+
9
+ - **The Thing:** A single `group` `Thing` named **"Nine Padel Store"**.
10
+
11
+ - **Implementation:** This can be a simple JSON object in your project's configuration (`src/config.ts`) that holds site-wide metadata like the store name, currency (GBP), and domain.
12
+
13
+
14
+ ### 2. The `People`: Your Users
15
+
16
+ This dimension defines the actors interacting with your site.
17
+
18
+ - **The Things:**
19
+
20
+ - `customer`: Represents any visitor. They start as an **anonymous user** (identified by a session ID) and become a **known customer** upon login or purchase.
21
+
22
+ - `staff`: Represents an administrator who can manage content.
23
+
24
+ - **Implementation:**
25
+
26
+ - **Customers:** Stored in persistent storage. A user's session ID and authentication state are managed via Cloudflare Workers and browser cookies.
27
+
28
+ - **Staff:** Can be a simple list of users in your config for a basic setup, or a table in the database for a multi-user admin panel.
29
+
30
+
31
+ ### 3. The `Things`: Your Content and Commerce Objects
32
+
33
+ These are the "nouns" of your website. In Astro, most of these will live in your `src/content/` directory as content collections.
34
+
35
+ - **The Things:**
36
+
37
+ - `product`: Rackets, bags, shoes, etc. **This is your core collection.**
38
+
39
+ - `guide`: Buying guides, blog posts, and technique articles.
40
+
41
+ - `brand`: Brand-specific pages with their story and associated products.
42
+
43
+ - `review`: User-submitted reviews.
44
+
45
+ - `shopping_cart`: A temporary object holding the items a user intends to buy.
46
+
47
+ - `order`: A permanent record of a completed purchase.
48
+
49
+ - **Implementation:**
50
+
51
+ - **Static Content (`src/content/`):**
52
+
53
+ - `/products/*.md`: Each file is a `product` `Thing`.
54
+
55
+ - `/guides/*.md`: Each file is a `guide` `Thing`.
56
+
57
+ - `/brands/*.md`: Each file is a `brand` `Thing`.
58
+
59
+ - **Dynamic Data (handled by Cloudflare):**
60
+
61
+ - **`shopping_cart`:** A JSON object stored in **Cloudflare KV**, keyed by the user's session ID. It's fast, cheap, and perfect for transient data.
62
+
63
+ - **`order` & `review`:** Records created via API calls to a **Cloudflare Worker**, which then saves them to a **Cloudflare D1** database.
64
+
65
+
66
+ ### 4. The `Connections`: How Everything Relates
67
+
68
+ These relationships bring your content to life, allowing you to build a rich, interconnected site.
69
+
70
+ - **The Relationships:**
71
+
72
+ - `product` **`manufactured_by`** `brand`.
73
+
74
+ - `review` **`is_about`** `product`.
75
+
76
+ - `customer` **`places`** `order`.
77
+
78
+ - `order` **`contains`** `product`.
79
+
80
+ - **Implementation:**
81
+
82
+ - These connections are defined directly within your content files using Astro's content relationships. For example, in a `product`'s frontmatter, you'd have a `brand: 'bullpadel'` slug that links to the corresponding `brand` file.
83
+
84
+
85
+ ### 5. The `Events`: The Story of User Interaction
86
+
87
+ This is the real-time stream of every action taken on your site. It's the fuel for all your analytics and automation.
88
+
89
+ - **The Actions:**
90
+
91
+ - `page_viewed`, `product_viewed`, `filter_applied`, `add_to_cart`, `order_placed`.
92
+
93
+ - **Implementation:**
94
+
95
+ - A lightweight JavaScript snippet on your Astro pages sends these events to a dedicated **Cloudflare Worker endpoint** (e.g., `/api/log-event`).
96
+
97
+ - This worker validates the event and writes it to a table in your **Cloudflare D1** database. This process is incredibly fast and doesn't slow down the user experience.
98
+
99
+
100
+ ### 6. The `Knowledge`: Your Site's Brain (The Frontmatter)
101
+
102
+ This is the metadata that makes your site intelligent and dynamic. In Astro, this is almost entirely handled by the **frontmatter** of your markdown files.
103
+
104
+ - **The Labels:**
105
+
106
+ - For a `product`: `skill_level`, `racket_style`, `player_trait`, `shape`.
107
+
108
+ - For a `guide`: `topic`, `relates_to_skill`.
109
+
110
+ - **Implementation:**
111
+
112
+ - Inside `src/content/products/bullpadel-vertex.md`:
113
+
114
+ YAML
115
+
116
+ ```
117
+ ---
118
+ name: "Bullpadel Vertex 04"
119
+ price: 250
120
+ brand: 'bullpadel' # This creates the Connection
121
+ knowledge:
122
+ skill_level: 'advanced'
123
+ racket_style: 'power'
124
+ shape: 'diamond'
125
+ player_trait: null # Not specifically for elbow pain
126
+ ---
127
+ Product description goes here...
128
+ ```
129
+
130
+
131
+ ---
132
+
133
+ ## The Loops: How Your Website Gets Smarter
134
+
135
+ This is how you turn your static site into a dynamic, self-improving engine.
136
+
137
+ ### The Attract Loop: From Search to Session 🔎
138
+
139
+ 1. **Action:** You create a new `guide` file: `src/content/guides/choosing-a-beginner-racket.md`.
140
+
141
+ 2. **Knowledge:** You fill its frontmatter: `topic: 'equipment_selection'`, `relates_to_skill: 'beginner'`.
142
+
143
+ 3. **Connection:** In the guide, you link to three specific `product` `Things` that have the `skill_level: 'beginner'` `Knowledge` label.
144
+
145
+ 4. **Result:** Astro builds a perfectly optimized static HTML page. A user searching Google finds this expert content. They click the link, landing on your site and logging a `page_viewed` `Event`. The loop completes when they click on a recommended racket, logging a `product_viewed` `Event` and starting their conversion journey.
146
+
147
+
148
+ ### The Convert Loop: From Browser to Buyer 🛒
149
+
150
+ 1. **Action:** A visitor is on your product gallery page. They use the UI to filter by `skill_level: 'intermediate'`.
151
+
152
+ 2. **Event:** A `filter_applied` `Event` is logged to your D1 database.
153
+
154
+ 3. **Knowledge:** Astro's front-end JavaScript instantly filters the displayed products by reading the `knowledge.skill_level` frontmatter from all `product` `Things`.
155
+
156
+ 4. **Result:** The user sees a perfectly curated list, finds the right racket, adds it to their cart (`add_to_cart` event), and completes the checkout via a Cloudflare Worker that creates a permanent `order` `Thing`. The loop completes as their anonymous session is now connected to a `customer` `Thing` with a purchase history.
157
+
158
+
159
+ ### The Grow Loop: From Buyer to Loyalist 👑
160
+
161
+ 1. **Action:** A scheduled Cloudflare Worker runs once a day to analyze the `events` table in your D1 database.
162
+
163
+ 2. **Intelligence:** The worker discovers an **insight**: "75% of customers who buy a `product` with `skill_level: 'advanced'` also view a `guide` with `topic: 'technique'`."
164
+
165
+ 3. **Automation:** The system now has a new rule. When a new `order_placed` `Event` occurs for an advanced racket, it triggers a 7-day countdown. After 7 days, another worker sends a personalized email: "Ready to master your new racket? Here are 3 advanced technique guides our pros recommend."
166
+
167
+ 4. **Result:** The customer is re-engaged with valuable content, pulling them back to the site. This builds immense loyalty and creates opportunities for follow-up purchases of accessories. The loop completes when they return and start a new session.
@@ -0,0 +1,359 @@
1
+ Here is the complete and well-described ontology specification for Nine Padel, designed to transform it from a standard e-commerce store into an intelligent, automated commerce engine.
2
+
3
+ ## Nine Padel - Ontology Specification
4
+
5
+ Version: 1.0.0 (Commerce Engine Architecture)
6
+
7
+ Status: Complete
8
+
9
+ Design Principle: This ontology models the entire customer journey and business operations in six dimensions. It serves as the single source of truth for the website, marketing automation, and external integrations like conversational AI agents.
10
+
11
+ ### The Philosophy: From Store to Engine
12
+
13
+ A standard e-commerce site is a passive collection of products. An **intelligent commerce engine** is a sentient system that understands its customers, anticipates their needs, and proactively guides them on their journey. This ontology provides the structure for that intelligence.
14
+
15
+ Everything at Nine Padel—every product, every customer, every click, every purchase—is modeled within these six fundamental dimensions.
16
+
17
+ ```
18
+ ┌──────────────────────────────────────────────────────────────┐
19
+ │ 1. GROUP │
20
+ │ The business entity: "Nine Padel Store" │
21
+ └──────────────────────────────────────────────────────────────┘
22
+ ↓
23
+ ┌──────────────────────────────────────────────────────────────┐
24
+ │ 2. PEOPLE │
25
+ │ The actors: The store owners, staff, and customers │
26
+ └──────────────────────────────────────────────────────────────┘
27
+ ↓
28
+ ┌──────────────────────────────────────────────────────────────┐
29
+ │ 3. THINGS │
30
+ │ The objects: Rackets, bags, orders, guides, reviews │
31
+ └──────────────────────────────────────────────────────────────┘
32
+ ↓
33
+ ┌──────────────────────────────────────────────────────────────┐
34
+ │ 4. CONNECTIONS │
35
+ │ The relationships: Customer "places" order, Racket │
36
+ │ "manufactured_by" brand │
37
+ └──────────────────────────────────────────────────────────────┘
38
+ ↓
39
+ ┌──────────────────────────────────────────────────────────────┐
40
+ │ 5. EVENTS │
41
+ │ The actions: Product "viewed", Order "placed", Review │
42
+ │ "submitted" │
43
+ └──────────────────────────────────────────────────────────────┘
44
+ ↓
45
+ ┌──────────────────────────────────────────────────────────────┐
46
+ │ 6. KNOWLEDGE │
47
+ │ The meaning: Labels for skill level, playing style, │
48
+ │ customer value, and order status │
49
+ └──────────────────────────────────────────────────────────────┘
50
+ ```
51
+
52
+ ---
53
+
54
+ ## 1. GROUP: The Business Boundary
55
+
56
+ This dimension provides the top-level container for all of Nine Padel's data, ensuring it is treated as a single, cohesive business unit.
57
+
58
+ ### Group Structure
59
+
60
+ TypeScript
61
+
62
+ ```
63
+ {
64
+ _id: Id<'groups'>,
65
+ slug: 'nine-padel-store',
66
+ name: 'Nine Padel Store',
67
+ type: 'business',
68
+ metadata: {
69
+ domain: 'ninepadel.com',
70
+ currency: 'GBP',
71
+ country: 'UK'
72
+ },
73
+ status: 'active',
74
+ createdAt: number
75
+ }
76
+ ```
77
+
78
+ ---
79
+
80
+ ## 2. PEOPLE: The Actors
81
+
82
+ This dimension defines who is interacting with the store and what their role is.
83
+
84
+ ### Person Roles
85
+
86
+ 1. **`store_owner`**: Has full administrative access to manage products, view analytics, and configure the system.
87
+
88
+ 2. **`staff`**: Can manage orders, respond to customer inquiries, and update content.
89
+
90
+ 3. **`customer`**: A user who browses, buys, and interacts with the store's content.
91
+
92
+
93
+ ### Person Structure
94
+
95
+ TypeScript
96
+
97
+ ```
98
+ {
99
+ _id: Id<'people'>,
100
+ email: string,
101
+ role: 'store_owner' | 'staff' | 'customer',
102
+ displayName?: string,
103
+ shippingAddress?: { /* ... */ },
104
+ billingAddress?: { /* ... */ },
105
+ createdAt: number
106
+ }
107
+ ```
108
+
109
+ ---
110
+
111
+ ## 3. THINGS: The Nouns of the Business 🎾
112
+
113
+ This is the largest dimension, representing every tangible and conceptual object in the Nine Padel ecosystem.
114
+
115
+ ### Thing Types (`ThingType`)
116
+
117
+ - **Catalog & Inventory (6 types):**
118
+
119
+ - `product_racket`: A padel racket with detailed specifications.
120
+
121
+ - `product_bag`: A padel bag or backpack.
122
+
123
+ - `product_shoe`: Specialized padel footwear.
124
+
125
+ - `product_apparel`: Shirts, shorts, wristbands, etc.
126
+
127
+ - `product_accessory`: Balls, grips, protectors, etc.
128
+
129
+ - `brand`: The manufacturer of a product (e.g., Head, Babolat, Nox).
130
+
131
+ - **Commerce & Orders (4 types):**
132
+
133
+ - `order`: A record of a completed customer purchase.
134
+
135
+ - `shopping_cart`: A temporary container for a user's session.
136
+
137
+ - `payment`: A record of a financial transaction.
138
+
139
+ - `discount_code`: A promotional code for a discount.
140
+
141
+ - **Content & Engagement (4 types):**
142
+
143
+ - `guide`: An informational article or buying guide.
144
+
145
+ - `customer_review`: A customer's rating and feedback on a product.
146
+
147
+ - `quiz`: The Racket Finder Quiz itself.
148
+
149
+ - `quiz_result`: A personalized racket recommendation for a specific user.
150
+
151
+ - **Marketing & Analytics (3 types):**
152
+
153
+ - `insight`: An AI-generated observation about business performance.
154
+
155
+ - `customer_segment`: A dynamic group of customers (e.g., "High-Value Whales").
156
+
157
+ - `ad_campaign`: A record of a marketing campaign.
158
+
159
+ - **System & Integration (1 type):**
160
+
161
+ - `external_agent`: Represents a connection to an external platform like ChatGPT or Gemini.
162
+
163
+
164
+ ### Properties by Key Thing Type
165
+
166
+ - **`product_racket` Properties:**
167
+
168
+ TypeScript
169
+
170
+ ```
171
+ {
172
+ sku: string,
173
+ brandId: Id<'things'>, // Connection to the 'brand' Thing
174
+ price: number,
175
+ weight: number, // In grams
176
+ shape: 'round' | 'teardrop' | 'diamond',
177
+ balance: 'head-light' | 'even' | 'head-heavy',
178
+ coreMaterial: 'soft_eva' | 'medium_eva' | 'hard_eva',
179
+ surfaceMaterial: 'fiberglass' | 'carbon_fiber_3k' | 'carbon_fiber_12k',
180
+ stockQuantity: number,
181
+ // ... other properties like images, description
182
+ }
183
+ ```
184
+
185
+ - **`order` Properties:**
186
+
187
+ TypeScript
188
+
189
+ ```
190
+ {
191
+ orderNumber: string,
192
+ customerId: Id<'people'>,
193
+ items: [{ productId: Id<'things'>, quantity: number, price: number }],
194
+ subtotal: number,
195
+ shippingCost: number,
196
+ totalAmount: number,
197
+ shippingAddress: { /* ... */ },
198
+ orderDate: number,
199
+ }
200
+ ```
201
+
202
+ - **`customer_segment` Properties:**
203
+
204
+ TypeScript
205
+
206
+ ```
207
+ {
208
+ segmentName: 'Whales' | 'Loyalists' | 'Evangelists',
209
+ description: 'Customers with LTV > £1000',
210
+ criteria: { /* JSON defining the rules for this segment */ },
211
+ memberCount: number,
212
+ }
213
+ ```
214
+
215
+
216
+ ---
217
+
218
+ ## 4. CONNECTIONS: The Relationships
219
+
220
+ This dimension describes how `Things` and `People` relate to each other, forming the business's knowledge graph.
221
+
222
+ ### Connection Types (`ConnectionType`)
223
+
224
+ - **Ownership & Creation (2):** `created_by`, `manufactured_by`
225
+
226
+ - **Commerce (4):** `places` (customer → order), `contains` (order → product), `uses` (order → discount_code), `purchased` (customer → product)
227
+
228
+ - **Engagement (5):** `writes` (customer → review), `is_about` (review → product), `receives` (customer → quiz_result), `viewed` (customer → guide), `targets` (campaign → segment)
229
+
230
+ - **System (1):** `communicates_with` (sales_agent → external_agent)
231
+
232
+
233
+ ### Common Connection Patterns
234
+
235
+ - **A Customer Makes a Purchase:**
236
+
237
+ - `customer` → `places` → `order`
238
+
239
+ - `order` → `contains` → `product_racket`
240
+
241
+ - **A Brand Makes a Product:**
242
+
243
+ - `product_racket` → `manufactured_by` → `brand`
244
+
245
+ - **A Customer Leaves Feedback:**
246
+
247
+ - `customer` → `writes` → `customer_review`
248
+
249
+ - `customer_review` → `is_about` → `product_racket`
250
+
251
+
252
+ ---
253
+
254
+ ## 5. EVENTS: The Actions
255
+
256
+ This dimension is the immutable log of every action that has ever happened, providing a perfect audit trail for analytics and automation.
257
+
258
+ ### Event Types (`EventType`)
259
+
260
+ - **Discovery Events:** `session_started`, `product_viewed`, `guide_viewed`, `quiz_completed`
261
+
262
+ - **Commerce Events:** `product_added_to_cart`, `cart_abandoned`, `order_placed`, `payment_processed`
263
+
264
+ - **Post-Purchase Events:** `order_shipped`, `order_delivered`, `review_submitted`
265
+
266
+ - **System & AI Events:** `insight_generated`, `customer_segment_updated`, `stock_level_low`
267
+
268
+
269
+ ### Event Patterns
270
+
271
+ - **`order_placed` Event:**
272
+
273
+ TypeScript
274
+
275
+ ```
276
+ {
277
+ type: 'order_placed',
278
+ actorId: customerId, // The person who acted
279
+ targetId: orderId, // The thing that was acted upon
280
+ timestamp: Date.now(),
281
+ metadata: {
282
+ totalAmount: 150.00,
283
+ currency: 'GBP',
284
+ itemCount: 2,
285
+ shippingMethod: 'standard_delivery',
286
+ protocol: 'website' // Or 'acp' if from ChatGPT
287
+ }
288
+ }
289
+ ```
290
+
291
+
292
+ ---
293
+
294
+ ## 6. KNOWLEDGE: The Meaning and Intelligence
295
+
296
+ This is the "brain." It provides the labels, tags, and semantic context that power search, personalization, and AI agents.
297
+
298
+ ### Knowledge Types
299
+
300
+ - `label`: A simple, categorical tag.
301
+
302
+ - `chunk`: A piece of text with a vector embedding for semantic search (e.g., a paragraph from a `guide` or a `customer_review`).
303
+
304
+
305
+ ### Key Knowledge Labels
306
+
307
+ - **Product Attributes:** `skill_level:beginner`, `racket_style:control`, `player_trait:elbow_sensitive`.
308
+
309
+ - **Customer Segments:** `customer_archetype:whale`, `customer_archetype:loyalist`, `playing_style:aggressive_baseliner`.
310
+
311
+ - **Operational Statuses:** `order_status:shipped`, `stock_status:in_stock`, `review_status:approved`.
312
+
313
+ - **Content Topics:** `topic:technique`, `topic:equipment_care`, `goal:improve_control`.
314
+
315
+
316
+ ---
317
+
318
+ ## How Features Map to the Ontology
319
+
320
+ ### Feature: The Racket Finder Quiz
321
+
322
+ 1. **Things:** A `quiz` `Thing` (the questions) and a `quiz_result` `Thing` (the recommendation).
323
+
324
+ 2. **Connections:** The `customer` **receives** the `quiz_result`.
325
+
326
+ 3. **Events:** `quiz_completed` is logged when the user submits their answers.
327
+
328
+ 4. **Knowledge:** The quiz maps user answers to **Knowledge** labels (`player_trait:elbow_sensitive`, `playing_style:defensive`) to find the perfectly matching `product_racket`.
329
+
330
+
331
+ ### Feature: Purchase in ChatGPT
332
+
333
+ 1. **Things:** An `external_agent` `Thing` represents the connection. A new `customer` and `order` `Thing` are created.
334
+
335
+ 2. **Connections:** `sales_agent` **communicates_with** `external_agent`.
336
+
337
+ 3. **Events:** An `order_placed` `Event` is logged with `metadata.protocol: 'acp'`.
338
+
339
+ 4. **Knowledge:** The user's chat query ("racket for elbow pain") is used to filter products with the `player_trait:elbow_sensitive` label.
340
+
341
+
342
+ ---
343
+
344
+ ## Summary Statistics
345
+
346
+ - **Dimensions:** 6
347
+
348
+ - **Thing Types:** 18
349
+
350
+ - **Connection Types:** 12
351
+
352
+ - **Event Types:** 13
353
+
354
+ - **Key Knowledge Vocabularies:** 4 (Product, Customer, Operations, Content)
355
+
356
+
357
+ ### For Implementers
358
+
359
+ This ontology is your blueprint. Every new feature, marketing campaign, or analytics dashboard should start with the question: "How does this map to our six dimensions?" By adhering to this structure, you ensure that every piece of data you collect makes the entire system smarter, more automated, and more valuable to the customer.