@rubytech/create-maxy 1.0.0

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.
Files changed (181) hide show
  1. package/dist/index.js +428 -0
  2. package/package.json +31 -0
  3. package/payload/maxy/.env.example +12 -0
  4. package/payload/maxy/app/admin/components/ActivityTimeline.tsx +348 -0
  5. package/payload/maxy/app/admin/components/MarkdownMessage.tsx +40 -0
  6. package/payload/maxy/app/api/admin/chat/route.ts +72 -0
  7. package/payload/maxy/app/api/admin/logs/route.ts +40 -0
  8. package/payload/maxy/app/api/admin/session/route.ts +74 -0
  9. package/payload/maxy/app/api/chat/route.ts +72 -0
  10. package/payload/maxy/app/api/health/route.ts +26 -0
  11. package/payload/maxy/app/api/onboarding/claude-auth/route.ts +216 -0
  12. package/payload/maxy/app/api/onboarding/set-pin/route.ts +44 -0
  13. package/payload/maxy/app/api/session/route.ts +51 -0
  14. package/payload/maxy/app/api/telegram/webhook/route.ts +107 -0
  15. package/payload/maxy/app/apple-icon.png +0 -0
  16. package/payload/maxy/app/bot/page.tsx +373 -0
  17. package/payload/maxy/app/favicon.ico +0 -0
  18. package/payload/maxy/app/globals.css +1681 -0
  19. package/payload/maxy/app/layout.tsx +58 -0
  20. package/payload/maxy/app/lib/claude-agent.ts +503 -0
  21. package/payload/maxy/app/og/layout.tsx +15 -0
  22. package/payload/maxy/app/og/page.tsx +252 -0
  23. package/payload/maxy/app/page.tsx +594 -0
  24. package/payload/maxy/app/privacy/page.tsx +72 -0
  25. package/payload/maxy/app/public/page.tsx +266 -0
  26. package/payload/maxy/next.config.mjs +26 -0
  27. package/payload/maxy/package-lock.json +2198 -0
  28. package/payload/maxy/package.json +25 -0
  29. package/payload/maxy/proxy.ts +41 -0
  30. package/payload/maxy/public/brand/claude.png +0 -0
  31. package/payload/maxy/public/brand/maxy-black.png +0 -0
  32. package/payload/maxy/public/brand/maxy.png +0 -0
  33. package/payload/maxy/public/favicon.ico +0 -0
  34. package/payload/maxy/public/og-landscape.png +0 -0
  35. package/payload/maxy/public/og-portrait.png +0 -0
  36. package/payload/maxy/public/og-square.png +0 -0
  37. package/payload/maxy/public/pi-5.jpg +0 -0
  38. package/payload/maxy/public/robots.txt +5 -0
  39. package/payload/maxy/tsconfig.json +41 -0
  40. package/payload/maxy/tsconfig.tsbuildinfo +1 -0
  41. package/payload/maxy/ui.md +28 -0
  42. package/payload/platform/config/cloudflared.yml +17 -0
  43. package/payload/platform/knowledge/maxy.md +161 -0
  44. package/payload/platform/neo4j/schema.cypher +108 -0
  45. package/payload/platform/package-lock.json +1835 -0
  46. package/payload/platform/package.json +17 -0
  47. package/payload/platform/plugins/admin/PLUGIN.md +24 -0
  48. package/payload/platform/plugins/admin/hooks/pre-tool-use.sh +56 -0
  49. package/payload/platform/plugins/admin/hooks/session-start.sh +20 -0
  50. package/payload/platform/plugins/admin/mcp/dist/index.d.ts +2 -0
  51. package/payload/platform/plugins/admin/mcp/dist/index.d.ts.map +1 -0
  52. package/payload/platform/plugins/admin/mcp/dist/index.js +149 -0
  53. package/payload/platform/plugins/admin/mcp/dist/index.js.map +1 -0
  54. package/payload/platform/plugins/admin/mcp/package.json +18 -0
  55. package/payload/platform/plugins/anthropic/PLUGIN.md +30 -0
  56. package/payload/platform/plugins/anthropic/references/setup-guide.md +146 -0
  57. package/payload/platform/plugins/business-assistant/PLUGIN.md +46 -0
  58. package/payload/platform/plugins/business-assistant/references/crm.md +112 -0
  59. package/payload/platform/plugins/business-assistant/references/document-management.md +96 -0
  60. package/payload/platform/plugins/business-assistant/references/escalation.md +126 -0
  61. package/payload/platform/plugins/business-assistant/references/invoicing.md +163 -0
  62. package/payload/platform/plugins/business-assistant/references/quoting.md +56 -0
  63. package/payload/platform/plugins/business-assistant/references/scheduling.md +127 -0
  64. package/payload/platform/plugins/cloudflare/PLUGIN.md +31 -0
  65. package/payload/platform/plugins/cloudflare/mcp/dist/index.d.ts +2 -0
  66. package/payload/platform/plugins/cloudflare/mcp/dist/index.d.ts.map +1 -0
  67. package/payload/platform/plugins/cloudflare/mcp/dist/index.js +174 -0
  68. package/payload/platform/plugins/cloudflare/mcp/dist/index.js.map +1 -0
  69. package/payload/platform/plugins/cloudflare/mcp/dist/lib/cloudflared.d.ts +45 -0
  70. package/payload/platform/plugins/cloudflare/mcp/dist/lib/cloudflared.d.ts.map +1 -0
  71. package/payload/platform/plugins/cloudflare/mcp/dist/lib/cloudflared.js +256 -0
  72. package/payload/platform/plugins/cloudflare/mcp/dist/lib/cloudflared.js.map +1 -0
  73. package/payload/platform/plugins/cloudflare/mcp/package.json +18 -0
  74. package/payload/platform/plugins/cloudflare/references/setup-guide.md +110 -0
  75. package/payload/platform/plugins/contacts/PLUGIN.md +18 -0
  76. package/payload/platform/plugins/contacts/mcp/dist/index.d.ts +2 -0
  77. package/payload/platform/plugins/contacts/mcp/dist/index.d.ts.map +1 -0
  78. package/payload/platform/plugins/contacts/mcp/dist/index.js +182 -0
  79. package/payload/platform/plugins/contacts/mcp/dist/index.js.map +1 -0
  80. package/payload/platform/plugins/contacts/mcp/dist/lib/neo4j.d.ts +5 -0
  81. package/payload/platform/plugins/contacts/mcp/dist/lib/neo4j.d.ts.map +1 -0
  82. package/payload/platform/plugins/contacts/mcp/dist/lib/neo4j.js +34 -0
  83. package/payload/platform/plugins/contacts/mcp/dist/lib/neo4j.js.map +1 -0
  84. package/payload/platform/plugins/contacts/mcp/dist/tools/contact-create.d.ts +19 -0
  85. package/payload/platform/plugins/contacts/mcp/dist/tools/contact-create.d.ts.map +1 -0
  86. package/payload/platform/plugins/contacts/mcp/dist/tools/contact-create.js +68 -0
  87. package/payload/platform/plugins/contacts/mcp/dist/tools/contact-create.js.map +1 -0
  88. package/payload/platform/plugins/contacts/mcp/dist/tools/contact-list.d.ts +22 -0
  89. package/payload/platform/plugins/contacts/mcp/dist/tools/contact-list.d.ts.map +1 -0
  90. package/payload/platform/plugins/contacts/mcp/dist/tools/contact-list.js +46 -0
  91. package/payload/platform/plugins/contacts/mcp/dist/tools/contact-list.js.map +1 -0
  92. package/payload/platform/plugins/contacts/mcp/dist/tools/contact-lookup.d.ts +20 -0
  93. package/payload/platform/plugins/contacts/mcp/dist/tools/contact-lookup.d.ts.map +1 -0
  94. package/payload/platform/plugins/contacts/mcp/dist/tools/contact-lookup.js +56 -0
  95. package/payload/platform/plugins/contacts/mcp/dist/tools/contact-lookup.js.map +1 -0
  96. package/payload/platform/plugins/contacts/mcp/dist/tools/contact-update.d.ts +13 -0
  97. package/payload/platform/plugins/contacts/mcp/dist/tools/contact-update.d.ts.map +1 -0
  98. package/payload/platform/plugins/contacts/mcp/dist/tools/contact-update.js +54 -0
  99. package/payload/platform/plugins/contacts/mcp/dist/tools/contact-update.js.map +1 -0
  100. package/payload/platform/plugins/contacts/mcp/package.json +19 -0
  101. package/payload/platform/plugins/documents/PLUGIN.md +12 -0
  102. package/payload/platform/plugins/documents/mcp/dist/index.d.ts +2 -0
  103. package/payload/platform/plugins/documents/mcp/dist/index.d.ts.map +1 -0
  104. package/payload/platform/plugins/documents/mcp/dist/index.js +82 -0
  105. package/payload/platform/plugins/documents/mcp/dist/index.js.map +1 -0
  106. package/payload/platform/plugins/documents/mcp/package.json +20 -0
  107. package/payload/platform/plugins/memory/PLUGIN.md +17 -0
  108. package/payload/platform/plugins/memory/mcp/dist/index.d.ts +2 -0
  109. package/payload/platform/plugins/memory/mcp/dist/index.d.ts.map +1 -0
  110. package/payload/platform/plugins/memory/mcp/dist/index.js +164 -0
  111. package/payload/platform/plugins/memory/mcp/dist/index.js.map +1 -0
  112. package/payload/platform/plugins/memory/mcp/dist/lib/embeddings.d.ts +3 -0
  113. package/payload/platform/plugins/memory/mcp/dist/lib/embeddings.d.ts.map +1 -0
  114. package/payload/platform/plugins/memory/mcp/dist/lib/embeddings.js +29 -0
  115. package/payload/platform/plugins/memory/mcp/dist/lib/embeddings.js.map +1 -0
  116. package/payload/platform/plugins/memory/mcp/dist/lib/neo4j.d.ts +5 -0
  117. package/payload/platform/plugins/memory/mcp/dist/lib/neo4j.d.ts.map +1 -0
  118. package/payload/platform/plugins/memory/mcp/dist/lib/neo4j.js +34 -0
  119. package/payload/platform/plugins/memory/mcp/dist/lib/neo4j.js.map +1 -0
  120. package/payload/platform/plugins/memory/mcp/dist/tools/memory-reindex.d.ts +8 -0
  121. package/payload/platform/plugins/memory/mcp/dist/tools/memory-reindex.d.ts.map +1 -0
  122. package/payload/platform/plugins/memory/mcp/dist/tools/memory-reindex.js +71 -0
  123. package/payload/platform/plugins/memory/mcp/dist/tools/memory-reindex.js.map +1 -0
  124. package/payload/platform/plugins/memory/mcp/dist/tools/memory-search.d.ts +24 -0
  125. package/payload/platform/plugins/memory/mcp/dist/tools/memory-search.d.ts.map +1 -0
  126. package/payload/platform/plugins/memory/mcp/dist/tools/memory-search.js +125 -0
  127. package/payload/platform/plugins/memory/mcp/dist/tools/memory-search.js.map +1 -0
  128. package/payload/platform/plugins/memory/mcp/dist/tools/memory-write.d.ts +18 -0
  129. package/payload/platform/plugins/memory/mcp/dist/tools/memory-write.d.ts.map +1 -0
  130. package/payload/platform/plugins/memory/mcp/dist/tools/memory-write.js +56 -0
  131. package/payload/platform/plugins/memory/mcp/dist/tools/memory-write.js.map +1 -0
  132. package/payload/platform/plugins/memory/mcp/package.json +19 -0
  133. package/payload/platform/plugins/sales/PLUGIN.md +65 -0
  134. package/payload/platform/plugins/sales/references/close-tracking.md +76 -0
  135. package/payload/platform/plugins/sales/references/closing-framework.md +108 -0
  136. package/payload/platform/plugins/sales/references/comparisons.md +99 -0
  137. package/payload/platform/plugins/sales/references/competitive-positioning.md +51 -0
  138. package/payload/platform/plugins/sales/references/faq.md +62 -0
  139. package/payload/platform/plugins/sales/references/objection-handling.md +157 -0
  140. package/payload/platform/plugins/sales/references/pricing.md +71 -0
  141. package/payload/platform/plugins/sales/references/waitlist.md +23 -0
  142. package/payload/platform/plugins/scheduling/PLUGIN.md +12 -0
  143. package/payload/platform/plugins/scheduling/mcp/dist/index.d.ts +2 -0
  144. package/payload/platform/plugins/scheduling/mcp/dist/index.d.ts.map +1 -0
  145. package/payload/platform/plugins/scheduling/mcp/dist/index.js +13 -0
  146. package/payload/platform/plugins/scheduling/mcp/dist/index.js.map +1 -0
  147. package/payload/platform/plugins/scheduling/mcp/package.json +18 -0
  148. package/payload/platform/plugins/telegram/PLUGIN.md +31 -0
  149. package/payload/platform/plugins/telegram/mcp/dist/index.d.ts +2 -0
  150. package/payload/platform/plugins/telegram/mcp/dist/index.d.ts.map +1 -0
  151. package/payload/platform/plugins/telegram/mcp/dist/index.js +101 -0
  152. package/payload/platform/plugins/telegram/mcp/dist/index.js.map +1 -0
  153. package/payload/platform/plugins/telegram/mcp/dist/lib/telegram.d.ts +27 -0
  154. package/payload/platform/plugins/telegram/mcp/dist/lib/telegram.d.ts.map +1 -0
  155. package/payload/platform/plugins/telegram/mcp/dist/lib/telegram.js +41 -0
  156. package/payload/platform/plugins/telegram/mcp/dist/lib/telegram.js.map +1 -0
  157. package/payload/platform/plugins/telegram/mcp/dist/tools/message-history.d.ts +16 -0
  158. package/payload/platform/plugins/telegram/mcp/dist/tools/message-history.d.ts.map +1 -0
  159. package/payload/platform/plugins/telegram/mcp/dist/tools/message-history.js +62 -0
  160. package/payload/platform/plugins/telegram/mcp/dist/tools/message-history.js.map +1 -0
  161. package/payload/platform/plugins/telegram/mcp/dist/tools/message.d.ts +20 -0
  162. package/payload/platform/plugins/telegram/mcp/dist/tools/message.d.ts.map +1 -0
  163. package/payload/platform/plugins/telegram/mcp/dist/tools/message.js +34 -0
  164. package/payload/platform/plugins/telegram/mcp/dist/tools/message.js.map +1 -0
  165. package/payload/platform/plugins/telegram/mcp/package.json +19 -0
  166. package/payload/platform/plugins/telegram/references/setup-guide.md +50 -0
  167. package/payload/platform/plugins/web/PLUGIN.md +12 -0
  168. package/payload/platform/plugins/web/mcp/dist/index.d.ts +2 -0
  169. package/payload/platform/plugins/web/mcp/dist/index.d.ts.map +1 -0
  170. package/payload/platform/plugins/web/mcp/dist/index.js +12 -0
  171. package/payload/platform/plugins/web/mcp/dist/index.js.map +1 -0
  172. package/payload/platform/plugins/web/mcp/package.json +18 -0
  173. package/payload/platform/scripts/seed-neo4j.sh +73 -0
  174. package/payload/platform/scripts/setup.sh +177 -0
  175. package/payload/platform/scripts/start.sh +62 -0
  176. package/payload/platform/templates/account.json +4 -0
  177. package/payload/platform/templates/agents/admin/IDENTITY.md +28 -0
  178. package/payload/platform/templates/agents/admin/SOUL.md +1 -0
  179. package/payload/platform/templates/agents/public/IDENTITY.md +21 -0
  180. package/payload/platform/templates/agents/public/SOUL.md +1 -0
  181. package/payload/platform/tsconfig.base.json +18 -0
@@ -0,0 +1,161 @@
1
+ # Maxy
2
+
3
+ Maxy is a personal AI assistant that lives in your home. It handles the stuff you don't want to think about — bills, appointments, coordination, the endless admin — so you can be present instead of managing.
4
+
5
+ Your data never leaves your house.
6
+
7
+ ---
8
+
9
+ ## What Maxy does for you
10
+
11
+ ### Handles your admin while you're busy
12
+
13
+ You're in a meeting, on a job, or making dinner. A customer messages, an appointment needs confirming, a bill is due. Maxy takes care of it. You don't find out about problems — you find out they've been handled.
14
+
15
+ ### Remembers everything so you don't have to
16
+
17
+ Every customer, every appointment, every conversation, every preference. Maxy builds a complete picture of your life and work over time. "What did we quote the Smiths last time?" — Maxy knows.
18
+
19
+ ### Replaces the apps you dread opening
20
+
21
+ No more switching between calendar, CRM, invoicing, and messaging apps. Tell Maxy what you need. It does the rest. One conversation replaces five dashboards.
22
+
23
+ ### Answers your customers when you can't
24
+
25
+ A customer visits your website or messages your business at 10pm. Maxy responds immediately with accurate information about your services, availability, and pricing. You don't lose the enquiry. You don't lose sleep.
26
+
27
+ ### Keeps your data private
28
+
29
+ Maxy runs on a small device in your home. Your conversations, your customers' details, your bills, your appointments — none of it leaves your house. No cloud. No data centre. No ads. We can't see your data. We don't want to.
30
+
31
+ ### Gets smarter as you use it
32
+
33
+ The more you share with Maxy, the more it can handle for you. It learns your preferences, your pricing, your schedule patterns, your suppliers. After a month, it knows your business better than any software ever could.
34
+
35
+ ---
36
+
37
+ ## How it works
38
+
39
+ 1. **Plug in your Maxy.** A small device that sits next to your router. Power and Wi-Fi — nothing else needed.
40
+ 2. **Open your browser and start talking.** Maxy has its own chat interface on your home network. Open a browser on any device.
41
+ 3. **Tell Maxy about your life.** It learns as you go. The more you share, the more it can handle for you.
42
+ 4. **Connect Telegram for when you're out.** Approve quotes, check your schedule, get notifications — all from your phone.
43
+
44
+ You're fully operational within 15 minutes.
45
+
46
+ ---
47
+
48
+ ## Who Maxy is for
49
+
50
+ ### Solo — for you
51
+
52
+ One person, one assistant. Scheduling, contacts, tasks, notes, reminders, web search, document generation. Everything you need to stay on top of your life without another app to manage.
53
+
54
+ **£20 per month.** Pi device from £125 (one-time). Requires a Claude subscription (£16/month, paid directly to Anthropic).
55
+
56
+ ### Family — for your household
57
+
58
+ Up to 5 people, each with their own private space. Nobody sees anyone else's data. Share what you choose — a family calendar, a shopping list, household tasks. Private by default, shared by choice.
59
+
60
+ **£60 per month.** Pi device from £180 (one-time). Requires Claude Max (£80/month, paid directly to Anthropic).
61
+
62
+ ---
63
+
64
+ ## Skill packs
65
+
66
+ Everyone's life is different. Skill packs let you add exactly the capabilities you need — nothing you don't. £5 each, or all six for £20. One-time purchase, yours forever.
67
+
68
+ - **Home** — coordinates tradespeople, tracks maintenance schedules, manages insurance renewals, keeps your household running without you chasing it.
69
+ - **Finance** — catches subscription renewals before they charge, tracks bills and due dates, flags unusual spending, reminds you about things that need cancelling.
70
+ - **Wellness** — manages medication reminders, books and tracks medical appointments, stores health notes, keeps your family's wellness information in one place.
71
+ - **Professional** — handles work admin: meeting prep, expense tracking, deadline reminders, email triage. Start each day knowing what actually matters.
72
+ - **Family** — coordinates schedules across the household, tracks kids' activities, manages school communications, makes sure nothing falls through the cracks.
73
+ - **Travel** — plans trips, tracks bookings and confirmations, manages itineraries, reminds you about passport renewals, handles the admin side of getting away.
74
+
75
+ ---
76
+
77
+ ## Hardware
78
+
79
+ ### Maxy Pi
80
+
81
+ A compact, silent device that sits next to your router. Everything Maxy can do, in a box the size of a deck of cards. Built on the Raspberry Pi 5.
82
+
83
+ **From £125.**
84
+
85
+ ### Maxy Mini
86
+
87
+ A tabletop companion with a built-in camera, expressive movements, and personality. Everything the Pi does, plus it sees you, reacts, and feels present. Powered by Reachy Mini.
88
+
89
+ **See reachy.com for hardware pricing.**
90
+
91
+ ---
92
+
93
+ ## How Maxy compares
94
+
95
+ ### vs ChatGPT
96
+
97
+ ChatGPT is a conversation partner. Maxy is a business system. ChatGPT doesn't remember your customers, can't answer enquiries on your website, has conversation caps that interrupt your work, and stores your data on someone else's servers. Maxy remembers everything, runs your public-facing communication, has no caps, and keeps your data in your home.
98
+
99
+ ### vs hiring someone for admin
100
+
101
+ An admin person costs £18,000–£25,000 per year. They get ill, take holidays, and resign. They can't work at 3am when a customer enquiry comes in. And they still need software tools to do the job. Maxy costs a fraction, works around the clock, and never forgets.
102
+
103
+ ### vs CRM software (HubSpot, Salesforce)
104
+
105
+ 74% of small businesses switch away from these tools within their first year. The complexity is overwhelming — HubSpot has 11 tabs and countless sub-menus. Onboarding alone costs £1,500–£12,000. Maxy has no menus, no settings pages, no training required. Tell it what you need. It does it.
106
+
107
+ ### vs Calendly
108
+
109
+ Calendly does one thing: scheduling. And the free plan restricts you to one event type. No quoting, no invoicing, no memory, no customer history. Maxy does scheduling, quoting, invoicing, communication, and everything else — through one conversation.
110
+
111
+ ### vs Google Workspace
112
+
113
+ Price hikes, privacy concerns, and a UX that feels 20 years old. Using Google means becoming part of its data collection machine. Maxy is private, modern, and yours.
114
+
115
+ ### vs WhatsApp Business
116
+
117
+ Meta banned AI chatbots on WhatsApp in January 2026. New accounts start with a 250-message daily limit. The rules change without warning. Your business runs on someone else's terms. Maxy runs on yours.
118
+
119
+ ---
120
+
121
+ ## Common questions
122
+
123
+ ### What exactly is Maxy?
124
+
125
+ Maxy is an AI assistant that runs on a small device in your home. You talk to it through a web browser or Telegram. It handles admin tasks — scheduling, customer enquiries, reminders, quotes, invoices — so you don't have to.
126
+
127
+ ### Do I need to be technical?
128
+
129
+ No. You plug in the device, open your browser, and start talking. There's no software to install, no settings to configure, no training to complete. If you can send a text message, you can use Maxy.
130
+
131
+ ### Is my data safe?
132
+
133
+ Your data lives on the device in your home. It never goes to a cloud server, a data centre, or anyone else's computer. We have no access to your data and no interest in having it.
134
+
135
+ ### What do I need besides the device?
136
+
137
+ A Claude subscription from Anthropic (the company that makes the AI). Solo is £16/month, Family is £80/month. You sign up directly with Anthropic — Maxy connects through your subscription.
138
+
139
+ ### Can my family use it too?
140
+
141
+ Yes. The Family plan supports up to 5 people, each with their own completely private space. You share what you choose — a family calendar, a shopping list — and everything else stays private.
142
+
143
+ ### What happens if the device breaks?
144
+
145
+ We monitor device health and reach out proactively if something looks wrong. Replacement devices can be shipped quickly. Your data is on the device, so we recommend periodic backups.
146
+
147
+ ### Can I try it before buying?
148
+
149
+ You're talking to Maxy right now. This conversation is powered by the same system that runs on the device. Ask me anything about what I can do.
150
+
151
+ ### How is this different from just using Claude or ChatGPT directly?
152
+
153
+ Claude and ChatGPT are conversation partners — they help you think and write. Maxy is a system that runs your admin. It remembers your customers, answers your website enquiries, sends your invoices, manages your schedule, and works while you sleep. It's built on Claude's intelligence, but it's a complete assistant — not just a chat window.
154
+
155
+ ### What if I want to cancel?
156
+
157
+ Your data stays on your device. Cancel the subscription, keep the device, keep your data. No lock-in, no export fees, no hostage situation.
158
+
159
+ ### When will Maxy be available?
160
+
161
+ We're building the waitlist now. Leave your name and email and we'll be in touch as soon as your spot opens up.
@@ -0,0 +1,108 @@
1
+ // ============================================================
2
+ // Maxy Phase 0 — Neo4j Graph Schema
3
+ // Schema.org + CDM compliant node types
4
+ // ============================================================
5
+
6
+ // ----------------------------------------------------------
7
+ // Constraints
8
+ // ----------------------------------------------------------
9
+
10
+ // Person.email must be unique (waitlist signups, future users)
11
+ CREATE CONSTRAINT person_email_unique IF NOT EXISTS
12
+ FOR (p:Person) REQUIRE p.email IS UNIQUE;
13
+
14
+ // Service.serviceId must be unique within the Maxy account
15
+ CREATE CONSTRAINT service_id_unique IF NOT EXISTS
16
+ FOR (s:Service) REQUIRE s.serviceId IS UNIQUE;
17
+
18
+ // LocalBusiness.accountId must be unique
19
+ CREATE CONSTRAINT local_business_account_unique IF NOT EXISTS
20
+ FOR (b:LocalBusiness) REQUIRE b.accountId IS UNIQUE;
21
+
22
+ // ----------------------------------------------------------
23
+ // Indexes
24
+ // ----------------------------------------------------------
25
+
26
+ CREATE INDEX faq_category IF NOT EXISTS
27
+ FOR (f:FAQ) ON (f.category);
28
+
29
+ CREATE INDEX feature_category IF NOT EXISTS
30
+ FOR (f:Feature) ON (f.category);
31
+
32
+ CREATE INDEX person_status IF NOT EXISTS
33
+ FOR (p:Person) ON (p.status);
34
+
35
+ CREATE INDEX comparison_competitor IF NOT EXISTS
36
+ FOR (c:Comparison) ON (c.competitor);
37
+
38
+ // ----------------------------------------------------------
39
+ // Vector index — 768 dimensions (nomic-embed-text via Ollama)
40
+ // HNSW algorithm for approximate nearest-neighbour search
41
+ // ----------------------------------------------------------
42
+
43
+ // One vector index per label that participates in semantic search.
44
+ // memory-search queries the index matching the label filter,
45
+ // or queries all indexes when no label filter is given.
46
+
47
+ CREATE VECTOR INDEX faq_embedding IF NOT EXISTS
48
+ FOR (f:FAQ) ON (f.embedding)
49
+ OPTIONS {
50
+ indexConfig: {
51
+ `vector.dimensions`: 768,
52
+ `vector.similarity_function`: 'cosine'
53
+ }
54
+ };
55
+
56
+ CREATE VECTOR INDEX feature_embedding IF NOT EXISTS
57
+ FOR (f:Feature) ON (f.embedding)
58
+ OPTIONS {
59
+ indexConfig: {
60
+ `vector.dimensions`: 768,
61
+ `vector.similarity_function`: 'cosine'
62
+ }
63
+ };
64
+
65
+ CREATE VECTOR INDEX comparison_embedding IF NOT EXISTS
66
+ FOR (c:Comparison) ON (c.embedding)
67
+ OPTIONS {
68
+ indexConfig: {
69
+ `vector.dimensions`: 768,
70
+ `vector.similarity_function`: 'cosine'
71
+ }
72
+ };
73
+
74
+ CREATE VECTOR INDEX service_embedding IF NOT EXISTS
75
+ FOR (s:Service) ON (s.embedding)
76
+ OPTIONS {
77
+ indexConfig: {
78
+ `vector.dimensions`: 768,
79
+ `vector.similarity_function`: 'cosine'
80
+ }
81
+ };
82
+
83
+ CREATE VECTOR INDEX person_embedding IF NOT EXISTS
84
+ FOR (p:Person) ON (p.embedding)
85
+ OPTIONS {
86
+ indexConfig: {
87
+ `vector.dimensions`: 768,
88
+ `vector.similarity_function`: 'cosine'
89
+ }
90
+ };
91
+
92
+ CREATE VECTOR INDEX business_embedding IF NOT EXISTS
93
+ FOR (b:LocalBusiness) ON (b.embedding)
94
+ OPTIONS {
95
+ indexConfig: {
96
+ `vector.dimensions`: 768,
97
+ `vector.similarity_function`: 'cosine'
98
+ }
99
+ };
100
+
101
+ CREATE VECTOR INDEX price_embedding IF NOT EXISTS
102
+ FOR (p:PriceSpecification) ON (p.embedding)
103
+ OPTIONS {
104
+ indexConfig: {
105
+ `vector.dimensions`: 768,
106
+ `vector.similarity_function`: 'cosine'
107
+ }
108
+ };