Skip to Content
DocumentationPlatform Mode

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

ModePackagesUse case
Minimal@guidekit/core, @guidekit/react, @guidekit/serverChat widget with DOM scan + tools
Platform+ @guidekit/intelligence, @guidekit/knowledge, @guidekit/pluginsProduction 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

  1. scan — DOM page model
  2. enrichSemanticScannerSemanticPageModel
  3. retrieve — BM25/TF-IDF knowledge search plus optional server site search
  4. context — System prompt with semantic sections + RAG
  5. cognize — Optional cognitive planning when cognitive={true} (Tier C experimental)
  6. llm — Proxy-backed streaming (includes tool execution)
  7. validate — Hallucination guard confidence (advisory only in 1.0)
  8. render — Store + events

Plugin hooks

Plugins registered via @guidekit/plugins can implement lifecycle hooks that the v2 pipeline invokes:

HookWhen it runs
beforeScan / afterScanAround DOM page model capture
beforeEnrich / afterEnrichAround semantic enrichment (Platform Mode)
beforeRetrieve / afterRetrieveAround knowledge retrieval
beforeLLMCall / afterLLMCallBefore and after each LLM round
onToolCallWhen a tool is about to execute
onErrorOn 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 / removeKnowledgeDocument on the core instance (or React context) for runtime updates.
  • Large corpora should live server-side; pass a curated subset via knowledge.documents at init time.
  • Use siteKnowledge.endpoint for full-site context. The server route validates the GuideKit JWT, site:read permission, 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.

Last updated on