Project
MasteryOS: An AI Platform for Experts, With Assistants, Assessments and Voice
MasteryOS is MasteryMade's AI platform for experts: each gets a site with assistants that answer from their own material, guided assessments, voice chat, plans and credits. I am the largest contributor to its Next.js frontend and worked on two side tools, MetaMCP and KeyVault.

MasteryOS is the newer platform of MasteryMade, a company that builds AI systems for creators, coaches and thought leaders. It turns what an expert knows, their frameworks, videos, guides and way of speaking, into a product their followers use every day: AI assistants that answer from the expert's own material, guided assessments that end in a written profile, voice conversations, a resource library, a practice journal and small AI tools.
One installation serves many experts. Each one gets a site on their own domain, with their own look, plans, prompts and assistants. MasteryOS grew out of MasteryMade's older Laravel platform and is a Next.js website on top of a Python API.
Several developers work on it. I am the largest contributor to the Next.js frontend, which I have worked on since mid-2025. This write-up explains how it works, what I built, and two side projects: MetaMCP and KeyVault.
What I worked on
- Chat: the expert chat, message versions, file uploads with duplicate checks, live progress during long answers, and the credit prompt when a plan runs out.
- Voice: spoken conversations with an assistant, from streamed audio to LiveKit rooms.
- Assessments: the step-by-step engine behind the Insights section and the profiles it writes.
- Admin panel: assistants, prompts, resources with an AI Resource Agent, plans, models, email templates and each expert's site settings.
- Teams and money: company accounts with seats and invites, paid places when sign-ups are capped, and the Stripe checkout flows.
- Safety and tests: httpOnly sessions behind a same-origin proxy, one-time tickets for live connections, safe display of AI output, Playwright tests and a guarded AI helper for failing tests.
- Side projects: the MetaMCP landing page and work on the KeyVault widget.
How MasteryOS works
Experts
An expert (an "influencer" in the code) is a brand on the platform: a domain, one of two layouts, colours, a sign-up page, onboarding questions, plans priced in their own currency and a menu of their own. Their AI assistants have instructions and knowledge files, so they answer from the expert's material instead of the open internet. A smaller version of the admin panel lets an expert manage their own resources, assistants, prompts and categories.
Followers
A follower signs up on the expert's site, which knows its expert from the domain. After a short onboarding questionnaire, which the AI summarises in the background, a follower can:
- chat with the expert's assistants, by text or by voice
- take assessments and read their profiles
- watch videos and read guides, and attach a file from the library to a chat
- keep notes from chats and a practice journal with categories, tags and search
- run small AI tools, such as turning a YouTube link into a summary and action plan as a PDF
- share a conversation through a link, and earn credits by inviting friends with a referral code
Companies
A company can buy a plan for its team: its admin buys seats and invites people by email. Seat changes are charged pro rata, and the count can never drop below the seats in use. An activity page shows each member's messages, runs and usage, but never what they wrote. Warnings start seven days before a plan ends, and a failed payment gets a grace period.
The admin team
The admin panel has more than 30 sections. Besides experts, users, assistants and plans, it covers:
- AI models, from OpenAI directly or through OpenRouter, with switches for files, pictures and reasoning
- token usage and cost by user, model and provider
- credit packs, credits per referral, and sign-up limits per expert with a waiting list to approve
- email templates with an "Edit with AI" box
- page templates for the public tools, built in the GrapesJS page builder
- a Bridge that imports an expert's ready-made "clone" (frameworks, voice, resources, offers) as one bundle, with a preview first
On the resource screens, the AI Resource Agent I built lets an admin create a resource by chatting instead of filling in every field. It asks for one field at a time, in order, and anything it generates can be attached straight to the right field.
The expert's assistant
In the chat, the heart of the product, answers stream in live over a WebSocket. Editing an earlier message creates a new version of the answer, with arrows to move between versions, and a conversation can be forked into a new one. During a long answer, the chat shows what the assistant is doing instead of a frozen "Thinking" line.
I added a check that compares each new file with the files already in the conversation and in the resource library, and offers "Use existing" or "Upload new copy", so one document is not processed twice. Pictures are checked by their real content. Large knowledge files go up in chunks with a progress bar, and they are only offered for models that can read files.
Other developers added downloadable documents, slides and tables, and a "side chat" for questions outside the expert's topic. Users can also connect Google (mail, calendar, Drive, Docs and more), GitHub, Jira, Outlook, Notion and their own MCP servers, so the assistant works with their real data. I worked on that connections page, including plain messages when an account is disconnected or a permission still waits for approval.
Assessments that write a profile
I built the engine behind the Insights section, the Prompt Harness. The AI writes the multiple-choice questions for each run, and the user answers one per screen, going back and forward, and skipping where that is allowed. Each answer is saved as it is given, so nothing is lost if the tab closes.
At the end, the AI writes a profile: trait bars with percentages, short chapters and concrete "moves" to try. A user can generate a new version, download it as PDF or HTML, and after two or more assessments merge them into one combined profile. I also built the plain landing pages that lead into it, such as the Conviction Score page.
Voice conversations
The first voice version streamed the microphone as 16-bit audio over a WebSocket and played the reply back in small chunks. Firefox does not let a page choose the sample rate, so the code resamples the audio itself, and playback schedules chunks ahead so the voice does not stutter.
I later moved voice to WebRTC and then to LiveKit, where the browser joins a room with an AI agent on the server, and the page merges the speech-to-text pieces into one bubble per turn. Voice has its own allowance in each plan, with the same credit prompt as the text chat. After a minute of silence the call asks "Still there?", and after 90 seconds it ends, so nobody pays for an open microphone.
Plans, credits and seats
Each plan gives a usage allowance that renews on a cycle. When it runs out mid-conversation, a popup shows when it renews and offers three ways on: continue with credits, buy credits, or upgrade, through Stripe's hosted checkout. Before the user leaves for Stripe, the chat saves the message that could not be sent, and after payment it sends it again in the same conversation, so the user carries on exactly where they stopped.
An expert can also cap how many people join; a newcomer then waits on a list or pays for a place, and the page they return to from Stripe confirms the payment, retrying while Stripe catches up.
Keeping sessions safe
I moved the session out of browser storage into httpOnly cookies, which page scripts cannot read. Every API call now goes through a same-origin proxy in Next.js: the browser holds only a reference, and the proxy adds the real token on the server.
Each WebSocket first asks for a one-time ticket, good for one handshake and 60 seconds. AI-written HTML and SVG drawings are cleaned with DOMPurify before they appear, and AI-made HTML pages open only in sandboxed frames that cannot reach the user's session. The admin panel does not trust cookie names either: it asks the API whose session it really is.
Tests, and an AI helper for failing tests
The frontend has 33 Playwright end-to-end test files, mostly for the admin panel, and 46 unit test files. A secret scan runs on every pull request.
On top of the admin test runner I built an AI Bug-Fix Agent with Claude. When a test fails, it reads the failure and the code around it and proposes a change that a person accepts or rejects. It is fenced in on purpose:
- it runs only on a developer's machine or the test server, never on the live site
- it removes keys, tokens and email addresses before anything is sent
- it shows the expected cost and asks first above a budget
- it warns when a change would "fix" a test by weakening its checks
The API behind it
The API is a Python FastAPI service, built mainly by other developers; in its early weeks I built the browser chat page used to test assistants against it. Its first version shows the AI pipeline. Each assistant was an OpenAI assistant with file search over a vector store of its own. Each conversation had a thread, replies streamed, and the first message gave the chat its title. The history was saved with embeddings of question, answer and reasoning, written in the background after the reply, so nobody waited for them. A model could be switched mid-conversation, but only to a compatible one.
MetaMCP and KeyVault
MetaMCP is a Model Context Protocol server that gives any chat app real actions through one HTTP API: save a conversation to Google Docs or Notion, list and read saved documents, and scrape a web page with Apify. Its six tool endpoints include a public manifest that any AI client can read. A request carries one Bearer token and nothing else about the user; the server finds out who that is and whether they have connected the platform. If not, the answer is a link to connect it, not an error. I built its landing page in Next.js and Tailwind, with an animated request diagram and code samples.
KeyVault is where those keys live: a floating API-key vault that drops into any website as an npm package, in React, Next.js or plain HTML. It mounts inside a Shadow DOM, so its styles never clash with the page around it. People sign in, then add, search, edit and copy their keys; MasteryOS loads it on its admin pages. I also wrote the plan for server-to-server access: a key and secret pair, the secret stored only as a hash and shown once, never accepted from a browser, and read-only by default.
What I took from this project
An AI product depends on small details more than on the model. A chat that loses a message at the payment screen, a voice call that stutters in one browser, a status that says "Connected" after the connection dropped: each decides whether people trust the product. In a shared codebase, I also learned to make every fix explain itself, with its ticket, its reason and a test.
Tools used
| Area | Tools |
|---|---|
| Frontend | Next.js, React, TypeScript, Tailwind CSS, Radix UI |
| AI | OpenAI, OpenRouter, Claude for the test helper |
| Voice | Web Audio, WebRTC, LiveKit |
| API | Python, FastAPI, SQLAlchemy, MySQL, Supabase |
| Payments | Stripe hosted checkout |
| Editors | CKEditor, GrapesJS |
| Integrations | Google, GitHub, Jira, Outlook, Notion, Apify, MCP |
| Quality | Playwright, gitleaks |
Do you have an AI product that needs a careful frontend and features people can trust? Tell me about it.

Comments
No ratings yet
Log in to comment
Only members can comment and rate posts. It is free and takes a minute.
No comments yet. Be the first to share your thoughts.