Platform Mode
GuideKit Platform Mode wires the optional intelligence, knowledge, and plugins packages into the v2 pipeline — semantic page enrichment, RAG retrieval, plugin hooks, and hallucination validation.
For full-site assistance, Platform Mode now composes three layers:
- Site knowledge: server-backed search across indexed website documents via
/api/guidekit/site-search - Live page model: current route sections, forms, overlays, and interactive elements from the DOM scanner
- Autonomy policy: guided action rules for navigation, safe clicks, and confirmation-required actions
Minimal vs Platform Mode
| Mode | Packages | Use case |
|---|---|---|
| Minimal | @guidekit/core, @guidekit/react, @guidekit/server | Chat widget with DOM scan + tools |
| Platform | + @guidekit/intelligence, @guidekit/knowledge, @guidekit/plugins | Production agent with semantic model, RAG, extensions |
Enable Platform Mode
import { GuideKitProvider } from '@guidekit/react';
import { definePlugin } from '@guidekit/plugins';
const docs = [
{ id: '1', title: 'Billing', content: 'Manage billing in Settings > Billing.', tags: ['billing'] },
];
const myPlugin = definePlugin({
name: 'my-plugin',
version: '1.0.0',
setup: () => {},
});
<GuideKitProvider
tokenEndpoint="/api/guidekit/token"
proxy={{ llm: '/api/guidekit/llm', health: '/api/guidekit/health' }}
llm={{ provider: 'gemini', model: 'gemini-2.5-flash' }}
intelligence={true}
knowledge={{ documents: docs, engine: 'bm25', topK: 5 }}
siteKnowledge={{ endpoint: '/api/guidekit/site-search', topK: 5 }}
plugins={[myPlugin]}
hallucinationGuard
options={{
autonomy: {
level: 'guided',
allowNavigation: true,
allowSafeClicks: true,
requireConfirmationFor: ['submit', 'purchase', 'destructive', 'auth'],
},
}}
>
{children}
</GuideKitProvider>Pipeline stages
- scan — DOM page model
- enrich —
SemanticScanner→SemanticPageModel - retrieve — BM25/TF-IDF knowledge search plus optional server site search
- context — System prompt with semantic sections + RAG
- cognize — Optional cognitive planning when
cognitive={true}(Tier C experimental) - llm — Proxy-backed streaming (includes tool execution)
- validate — Hallucination guard confidence (advisory only in 1.0)
- render — Store + events
Plugin hooks
Plugins registered via @guidekit/plugins can implement lifecycle hooks that the v2 pipeline invokes:
| Hook | When it runs |
|---|---|
beforeScan / afterScan | Around DOM page model capture |
beforeEnrich / afterEnrich | Around semantic enrichment (Platform Mode) |
beforeRetrieve / afterRetrieve | Around knowledge retrieval |
beforeLLMCall / afterLLMCall | Before and after each LLM round |
onToolCall | When a tool is about to execute |
onError | On pipeline or tool errors |
Use getExtraContextSections() on a plugin to inject additional system-prompt sections during the context stage.
Knowledge limits (1.0)
- Documents are held in memory on the client for the session — there is no IndexedDB persistence in 1.0.
- Use
addKnowledgeDocument/removeKnowledgeDocumenton the core instance (or React context) for runtime updates. - Large corpora should live server-side; pass a curated subset via
knowledge.documentsat init time. - Use
siteKnowledge.endpointfor full-site context. The server route validates the GuideKit JWT,site:readpermission, and allowed origins before returning attributed website chunks.
Agent Runtime v1
The built-in agent can search indexed website content with searchSite, navigate same-origin routes, rescan after route changes, and act on current-page elements. Interactive elements are classified as safe, submit, purchase, destructive, auth, or unknown; guided autonomy allows safe clicks and requires confirmation for risky classes by default.
Reference integration
See apps/example-nextjs for the canonical Platform Mode demo with zero client API keys.