WooCommerce plugin docs / AI Configuration

AI Configuration

Dedicated guide for the LLM layer. Field-by-field defaults live in AI Provider and Chatbot.

API configuration

  1. WooCommerce → AI Assistant → AI Provider
  2. Choose OpenAI or Gemini
  3. Paste API key or set AIWSA_OPENAI_API_KEY / AIWSA_GEMINI_API_KEY in wp-config.php
  4. Click Test API Key, then save
  5. Pick a model, temperature, max output tokens
  6. Optional: fallback provider, timeout, custom HTTPS base URL, local-host exception

Keys are encrypted at rest (aiwsa_credentials). REST and aiwsaBoot never include them.

Supported providers

ProviderShipped adapterDefault model
OpenAIYesgpt-4o-mini
Google GeminiYesgemini-2.0-flash
AnthropicNo adapter (host allow-listed only)
OpenRouterNo adapter (host allow-listed only)

Model selection

See the model tables in AI Provider.

Temperature and token limits

  • Temperature default 0.2 (0–2)
  • Max output tokens default 1024 (64–32000)
  • Shopper input cap is Maximum message length (default 1000), not this field
  • Daily token budget default 200000 (0 = unlimited) → degrade to catalog search

System instructions / prompts

Composed server-side from:

  • Guardrails (approved tools only; WooCommerce is source of truth)
  • Language instruction
  • Persona, tone, store note, custom instructions
  • Sales-agent rules when enabled
  • Filter aiwsa_prompt_fragments

Shoppers cannot inject a new system prompt via REST.

Language and context

Multilingual. Product context is tool results (IDs, prices, stock, descriptions), not a separate RAG vector store. There is no built-in RAG corpus beyond WooCommerce product fields and your store note.

Product data sent to AI

Typical tool payloads: product id, name, permalink, price HTML/amount, stock status, short attributes, descriptions as stored in WooCommerce (sanitized). Cart lines and owned order summaries when those tools run. Billing addresses are not put in the shopper UI payload.

RAG / source configuration

Not a user-facing RAG settings screen. Semantic candidate IDs are developer filters only (aiwsa_semantic_search_available, aiwsa_semantic_search_ids). Cron names aiwsa_embed_queue / aiwsa_usage_rollup exist in the scheduler list for teardown but are not active handlers in this release.

Fallback, errors, usage, privacy, security

See Fallback, Usage, Privacy & security.

Pipeline (only steps that exist)

Customer Input
    ↓
Language resolve (allow-list) + rate limit
    ↓
Intent detection (rules; optional AI JSON intent for search)
    ↓
Product / search processing (WooCommerce query + rank)
    ↓
AI processing (tool calls, if provider configured)
    ↓
WooCommerce data (re-fetched, never trusted from the model)
    ↓
Response (text + UI payload)
    ↓
Frontend (cards, confirm, cart, checkout URL)

If the provider is missing, the AI processing box is skipped (Catalog_Search_Turn).