Abuja Digital Studio · Est. 2018
Start a Project
Docs
OAssist
Contextual AI assistant layer for WordPress — floating chat interface, page-aware suggestions, shortcode embedding, and a configurable knowledge base backed by your own content.
oassist
Developer documentation

OAssist v1.0.0

Contextual AI assistant layer for WordPress: floating chat interface, page-aware suggestions, shortcode embedding, and a configurable knowledge base backed by your own content. Bring your own API key, zero inference markup, no usage caps.

WordPress plugin BYOK · 4 providers Premium license v1.0.0 · 2026-05-15
01 · Overview

What OAssist does

OAssist drops a contextual AI assistant onto any WordPress site. It indexes your posts, products, and documentation, answers visitor questions inline with the page they are reading, and dispatches tool calls (order lookups, account actions, subscription changes) against WooCommerce. You bring the API key.

Page-aware chat
The widget knows the URL, post type, product, and current user. Every reply is grounded in the visible page, not generic knowledge.
Bring your own key
Use your own OpenAI, Anthropic, Gemini, or Groq API key. Zero inference markup, no SaaS hop, no per-token fees from Orravo.
Vector index
Posts, products, and KB articles are chunked and embedded into oa_documents. Re-indexing is incremental and runs on save.
Tool dispatch
Six built-in tools wrap WooCommerce: order status, recent orders, cancel subscription, reset password, refund, product lookup.
Human escalation
Sensitive intents (refund disputes, account deletion, legal questions) auto-route to the admin inbox and email a transcript.
Budget controls
Daily, weekly, and monthly spend caps per provider. Semantic cache skips repeat queries; rate limiting throttles abuse.
Shortcode embed
Drop [oassist] inside any post to embed the inline chat. Configure mode, theme, and starter prompts via attributes.
Analytics
Token usage, cost per conversation, deflection rate, top intents, and conversion attribution against WooCommerce orders.
OAssist is built for site owners who want an AI support layer without recurring SaaS fees. Activations are unlimited per license; all data stays in your WordPress database.
02 · Installation

Getting installed

Requirements

  • WordPress 6.0 or newer
  • PHP 8.0 or newer
  • An API key from one of: OpenAI, Anthropic (Claude), Google (Gemini), Groq
  • WooCommerce is optional. With it: order, product, and subscription tools become available.
  • At least one Orravo Core install if you want license-managed updates (optional).

From WordPress admin

1
Go to Plugins → Add New → Upload Plugin.
2
Upload oassist.zip, click Install Now, then Activate.
3
Visit OAssist → Setup to walk the 4-step onboarding wizard.

Manual (FTP / SFTP)

1
Extract oassist.zip.
2
Upload the oassist/ folder to /wp-content/plugins/.
3
Activate via Plugins → Installed Plugins.
On activation OAssist creates six custom tables: oa_documents, oa_conversations, oa_messages, oa_tool_calls, oa_budget_log, and oa_escalations. Schema version is tracked in oassist_db_version.
03 · Quick Start

Up and running in minutes

Connect a provider, index your content, drop the widget. Three steps; expect about ten minutes including the first index pass.

1
Open OAssist → Providers. Pick a provider (OpenAI is the default). Paste your API key into the encrypted field. Pick a chat model and an embedding model.
2
Open OAssist → Knowledge. Tick the post types you want indexed (Posts, Pages, Products, KB Articles). Click Rebuild index. The first pass is queued via Action Scheduler.
3
Open OAssist → Widget. Toggle Enable floating widget on. Pick a position (bottom right by default), accent color, and greeting message. Save.
4
Open any front-end page. The widget appears in the corner. Type a question. Watch the live token counter in the admin Budget tab.

Want the chat inline in a single page instead of floating? Use [oassist mode="inline"]. The widget falls back to the floating mode on all other pages.

04 · The Six Engines

The six engines

OAssist is built around six independent subsystems, each in its own PHP class. You can disable individual engines if you don't need them.

Engine map

EngineClassResponsibility
IndexerOA_IndexerChunks posts and products, generates embeddings, writes rows into oa_documents. Subscribes to save_post and woocommerce_update_product.
ConversationOA_ConversationOwns the chat loop. Composes system prompt, retrieves top-k chunks, calls the provider, streams the reply over SSE.
ToolsOA_ToolsRegisters tool schemas, validates LLM-emitted arguments, dispatches to WooCommerce or custom callbacks, returns structured results.
ChannelsOA_ChannelsBridges the conversation engine to the website widget, WhatsApp (Cloud API), inbound email, and SMS (Twilio).
EscalationOA_EscalationSensitive-intent detection, transcript packaging, admin inbox routing, email digest.
BudgetOA_BudgetPer-provider spend tracking, semantic cache (cosine similarity), rate limiter, daily / weekly / monthly caps.

Engine toggles

Each engine is gated by a setting in oassist_engines. The Indexer is required; the others fail open. Disable the Tools engine if you only want a documentation chatbot; disable Channels if you only need the website widget.

PHP// Programmatic toggle
$engines = get_option( 'oassist_engines', [] );
$engines['tools']     = false;       // disable WooCommerce tool dispatch
$engines['channels']  = true;        // enable WhatsApp / email / SMS bridging
$engines['budget']    = true;        // recommended
update_option( 'oassist_engines', $engines );
05 · LLM Providers & BYOK

Providers & BYOK

OAssist talks to four providers out of the box. API keys are stored encrypted in wp_options using SECURE_AUTH_KEY as the salt. They are never sent to Orravo servers.

Supported providers

ProviderChat modelsEmbedding models
OpenAIgpt-4o, gpt-4o-mini, gpt-4-turbotext-embedding-3-small, text-embedding-3-large
Anthropicclaude-opus-4-7, claude-sonnet-4-7, claude-haiku-4-6(falls back to OpenAI embeddings, or to local hash embeddings)
Google Geminigemini-2.5-pro, gemini-2.5-flashtext-embedding-004
Groqllama-3.3-70b-versatile, mixtral-8x7b-32768(falls back to OpenAI embeddings)
Embedding fallback: If the chosen chat provider does not ship an embedding model, set the embedding provider separately under Providers → Embeddings. A local hash-based fallback exists for air-gapped installs but skips semantic retrieval.

Configure a provider

PHP// PHP API
OA_Providers::configure( 'openai', [
    'api_key'         => 'sk-...',
    'chat_model'      => 'gpt-4o-mini',
    'embedding_model' => 'text-embedding-3-small',
    'temperature'     => 0.4,
    'max_tokens'      => 1024,
] );

// Read current config (api_key returned masked: sk-***...XYZ)
$cfg = OA_Providers::get( 'openai' );

Multi-provider routing

Set a primary and a fallback provider under Providers → Routing. If the primary returns a 429 or 5xx, OAssist retries the same prompt on the fallback. Useful when the primary is rate-limited (Groq) and the fallback is a paid tier (OpenAI).

06 · Floating Widget & Shortcode

Widget & shortcode

OAssist ships a launcher bubble that opens into a 400 by 600 panel anchored to a screen corner, plus an inline shortcode for embedding the conversation directly in post content.

Floating widget

wp_footer
Launcher bubble
Auto-injected when the widget is enabled. Sits at the configured corner. Click to expand to a 400x600 panel.
conditional
Page targeting
Show on all pages, only on selected post types, or only when a URL matches a list of glob patterns.
conditional
User targeting
All visitors, logged-in only, logged-out only, or a specific WordPress role.
conditional
Device targeting
All, desktop only, or mobile only. Combined with the page and user targeting; all rules must pass.

Shortcode

HTML[oassist]
[oassist mode="inline" theme="light"]
[oassist mode="inline" greeting="Ask anything about WP-Tuner" starters="Pricing|Refunds|API docs"]
[oassist hide_floating="1"]
AttributeValuesDefault
modefloating, inlinefloating
themeauto, light, darkauto
positionbottom-right, bottom-left, top-right, top-leftbottom-right
greetingany string(from settings)
starterspipe-separated list(from settings)
hide_floating0, 10
knowledgecategory slugs, comma-separated(all indexed)

Setting knowledge="docs,pricing" restricts retrieval to documents tagged with those KB categories. Useful for product-specific embeds (one shortcode per product page, each scoped to its own docs subset).

JS init

JS// Boot OAssist programmatically (e.g. inside a SPA route change)
window.OAssist?.boot({
  mode:     'floating',
  theme:    'dark',
  greeting: 'Hi! Ask me anything about your subscription.',
  context:  { user_id: 142, plan: 'pro' }, // merged into the system prompt
  onOpen:   () => { console.log('widget opened'); },
  onMessage:(m)=> { console.log('message', m); },
});
07 · REST API

REST API

All endpoints live under /wp-json/oassist/v1/. Public chat endpoints accept anonymous requests and rely on a per-session nonce; admin endpoints require manage_options.

Endpoints

MethodPathPurpose
POST/chat/startCreate a conversation, return conversation_id + nonce.
POST/chat/messageSend a user turn, streams an SSE reply.
GET/chat/historyReturn messages for a conversation (requires the session nonce).
POST/chat/feedbackThumbs up / down on a message; logged in oa_messages.feedback.
POST/index/rebuildQueue a full index rebuild (admin only).
POST/index/documentInsert or update a single document (admin only).
GET/budgetDaily / weekly / monthly spend for each provider.
GET/conversationsAdmin inbox listing with status filter.
POST/escalations/{id}/resolveMark an escalation resolved; logs the admin user.

Send a message

cURLcurl -N -X POST https://example.com/wp-json/oassist/v1/chat/message \
  -H 'Content-Type: application/json' \
  -H 'X-OA-Nonce: <session-nonce>' \
  -d '{
    "conversation_id": "c_2u9pE...",
    "message": "Where is my order #1043?",
    "page_url": "https://example.com/my-account/",
    "context": { "user_id": 142 }
  }'

The response is a Server-Sent Events stream. Each event is either a delta (token chunk), a tool_call (engine dispatched a WooCommerce tool), a tool_result (tool returned), an escalation (sensitive intent detected), or a terminal done event with usage and cost.

Register a custom tool

PHPadd_action( 'oassist_register_tools', function( OA_Tools $tools ) {
    $tools->register([
        'name'        => 'check_inventory',
        'description' => 'Return stock quantity for a product SKU.',
        'parameters'  => [
            'type' => 'object',
            'properties' => [
                'sku' => [ 'type' => 'string', 'description' => 'Product SKU' ],
            ],
            'required' => [ 'sku' ],
        ],
        'callback' => function( array $args ): array {
            $product = wc_get_product( wc_get_product_id_by_sku( $args['sku'] ) );
            if ( ! $product ) {
                return [ 'ok' => false, 'error' => 'unknown_sku' ];
            }
            return [
                'ok'    => true,
                'stock' => (int) $product->get_stock_quantity(),
            ];
        },
    ]);
} );
08 · FAQ

Frequently asked questions

Do I have to pay Orravo for AI usage?
No. OAssist is BYOK (Bring Your Own Key). You pay your chosen provider (OpenAI, Anthropic, Google, or Groq) directly. Orravo charges only for the plugin license; there is no per-token markup, no SaaS hop, and no usage cap from Orravo.
Where are conversations stored?
In your WordPress database: oa_conversations stores the metadata, oa_messages stores each turn (user, assistant, tool, system), and oa_tool_calls stores tool dispatch details. Nothing is sent to Orravo servers.
How accurate are the answers?
OAssist grounds every reply in retrieved documents from your own content. If the retrieval pass returns no relevant chunks (score below the configured threshold), the assistant says "I don't have that info" instead of guessing. You can raise or lower the threshold under Knowledge → Retrieval.
What gets indexed?
By default: Posts, Pages, and Products. Tick additional post types under Knowledge → Sources. Custom post types and the OKnowledgebase plugin are supported. You can also paste FAQ content directly into the Knowledge → Snippets tab.
How does the semantic cache work?
When a new question is received, OAssist embeds it and compares the embedding to recent questions (cosine similarity). If a match above the configured threshold (default 0.94) is found and the cached answer is fresher than the cache TTL, the cached answer is returned with zero tokens spent. Disable per-conversation by passing cache:false to /chat/message.
Can I use OAssist without WooCommerce?
Yes. WooCommerce only unlocks the order, product, and subscription tools. Without it, OAssist runs as a pure documentation and content assistant.
How is escalation triggered?
The Escalation engine watches every reply for sensitive intents (refund disputes, account deletion, legal questions, threats) and triggers when either a regex pattern matches or the LLM itself returns a need_human tool call. Triggered conversations are moved to the admin inbox and emailed as a transcript.
What is the difference between OAssist and a generic chatbot plugin?
OAssist is page-aware (current URL, post type, and user passed into the prompt), tool-aware (dispatches WooCommerce actions), grounded (vector retrieval over your content), and BYOK (no SaaS markup). It is built to replace tickets, not to add a generic toy.
How do I uninstall and clean up?
Deleting the plugin runs uninstall.php, which drops the six custom tables and removes plugin options. Encrypted API keys are deleted with the options. Deactivating alone leaves the data in place.
09 · Changelog

What's changed

v1.0.0 2026-05-15
  • NewSix engines: Indexer, Conversation, Tools, Channels, Escalation, Budget
  • NewFour providers: OpenAI, Anthropic, Google Gemini, Groq
  • NewMulti-provider routing with automatic fallback on 429 / 5xx
  • NewBYOK: encrypted API key storage, no Orravo round-trip
  • NewVector indexing of Posts, Pages, Products, and OKnowledgebase articles
  • NewSemantic cache with configurable similarity threshold and TTL
  • NewSix WooCommerce tools: order status, recent orders, cancel subscription, reset password, refund, product lookup
  • NewCustom tool registration via oassist_register_tools
  • NewSensitive-intent escalation with admin inbox + email digest
  • NewDaily / weekly / monthly spend caps per provider
  • NewFloating widget with page, user, device targeting
  • New[oassist] shortcode with inline mode and knowledge scoping
  • NewSSE streaming chat endpoint at /wp-json/oassist/v1/chat/message
  • NewWhatsApp Cloud API, inbound email, and Twilio SMS channels
  • NewAnalytics dashboard: tokens, cost, deflection rate, top intents
  • NewSix custom DB tables with uninstall.php cleanup
✦ Need help?

Got a question about OAssist?

Reach out directly. Kenneth replies within 24 hours.