AI Core Web Vitals Performance Chatbot
Ask our AI performance engineer any question about LCP, INP, CLS, TTFB, edge caching architectures, and WordPress speed engineering.
๐ Hello! I am your AI Core Web Vitals & Web Performance Engineer. Ask me anything about optimizing LCP, INP, CLS, TTFB, edge caching, or WordPress speed engineering.
Technical Deep-Dive: Getting the Most from the CWV Chatbot
๐ On this page
- 1. How the AI-vs-fallback routing actually works
- 2. Why the assistant is scoped only to performance topics
- 3. What conversation context the AI model sees
- 4. Writing effective performance questions
- 5. When to trust generated code snippets โ and when to verify
- 6. Privacy: what does and doesn't leave your browser
1. How the AI-vs-fallback routing actually works
Every message you send first attempts a real call to a Gemini 2.0 Flash model on the backend. If that call succeeds and returns usable text, you get a genuine AI-generated answer tailored to your exact question, labeled "AI-Generated" in the chat. If the backend has no AI provider configured, or the live API call fails or times out, the tool automatically substitutes one of a small number of pre-written template answers matched by simple keyword detection (checking whether your question mentions "LCP," "INP," "CLS," or defaulting to a general summary), labeled "Template Fallback." This routing happens transparently on every single message โ a conversation can freely mix both types depending on backend availability at the moment each message is sent.
2. Why the assistant is scoped only to performance topics
The AI model is instructed via a system prompt to only answer questions about website speed, Core Web Vitals, caching, WordPress architecture, and related web performance topics, and to decline and redirect for anything else (general knowledge, unrelated coding help, casual conversation). This scoping exists both to keep the tool focused and useful for its intended purpose and as a basic safeguard against the tool being repurposed as a general-purpose chatbot, which is not what it is designed or resourced to be.
3. What conversation context the AI model sees
When the AI model path is used, your current message is sent along with the last 4 messages of conversation history, giving the model enough context to handle natural follow-up questions ("what about for images specifically?") without you needing to repeat earlier context. History is not sent at all when the fallback template path activates, since template selection only depends on keywords in your current message. No conversation data is persisted anywhere โ it exists only in your browser's memory for the current page session and is lost on refresh.
4. Writing effective performance questions
Specific questions produce more useful answers than vague ones โ "why is my LCP 4.2 seconds on mobile with a hero background image" gives the AI model concrete details to reason about, while "why is my site slow" forces it to guess at generalities. Mentioning your actual stack (WordPress + a specific page builder or caching plugin) when relevant helps the model tailor code snippets to your real environment rather than generic WordPress defaults. The starter chips above the input box are good examples of the level of specificity that tends to produce actionable answers.
5. When to trust generated code snippets โ and when to verify
Code snippets from the AI-Generated path are produced by a language model responding to your specific question โ genuinely useful as a starting point, but like any AI-generated code, they should be reviewed and tested before deploying to a production site, particularly for anything touching .htaccess rewrite rules, functions.php hooks, or server configuration, where a syntax error can take a site offline. Template Fallback code snippets are pre-written, human-authored examples covering common cases, which makes them more predictable but also more generic โ they may need adaptation to your specific theme or plugin setup.
6. Privacy: what does and doesn't leave your browser
Your typed messages and recent conversation history (when the AI path is used) are sent to the backend server and, in turn, to the Gemini API to generate a response โ this is necessary for the AI model to function. Nothing is saved to a database, logged for training purposes, or associated with your account. Once you navigate away from the page or refresh, the entire conversation is gone, since it exists only in browser component state for the duration of the page view.
Frequently Asked Questions
What is the AI Core Web Vitals Chatbot?
An interactive assistant for LCP, INP, CLS, TTFB, and WordPress speed questions. When a Gemini AI provider is configured and available, questions are answered by a real Gemini 2.0 Flash model constrained to website-performance topics; otherwise the tool falls back to a small set of pre-written template answers. Every reply in the chat is labeled with its actual source (AI-Generated vs Template Fallback) so this is never ambiguous.
Does this chatbot store my conversation logs or website data?
No. All chat sessions are completely ephemeral in browser memory. Conversations are never saved to databases or used to train public AI models.
Can the chatbot write code snippets for WordPress?
When answering via the real AI model, yes โ it can generate functions.php hooks, .htaccess rewrite rules, Nginx fastcgi caching configs, and HTML preloading tags tailored to your specific question. The template fallback responses include some pre-written code examples for common LCP/INP/CLS fixes, but they are generic and not tailored to your specific question.
Why would the chatbot ever use a template instead of the real AI model?
The AI model call requires a configured Gemini API key on the backend; if that key is not set, or the live API call fails or times out, the tool automatically falls back to pre-written template answers rather than showing an error, so you still get useful guidance for the most common Core Web Vitals questions (LCP, INP, CLS). The visible "Template Fallback" label on each affected message makes this switch fully transparent rather than silent.
