Skip to content

Frontend chat agent powered by site content #142

Description

@jeffpaul

What problem does this address?

Add an optional experiment that exposes a frontend chat UI capable of answering visitor questions using the site's own public content (and any extra references the site owner provides). Think “chat with my site” using retrieval-augmented responses, integrated with the existing WP AI Client stack.

This experiment will focus outside traditional editor/admin workflows. Looking initially for a simple, extensible example of how WordPress content can power an AI assistant on the public-facing frontend. A frontend chat agent would help visitors quickly find information, showcase how the Abilities API and WP AI Client can serve public UX, and give developers a reference pattern they can build on.

What is your proposed solution?

  • Floating chat bubble (likely via block for site editor integration) that triggers a small chat panel
  • Site owners pick what content gets indexed (post types, filters, pages only, etc.)
  • Optional custom reference text/FAQ entries
  • Answers generated through WP AI Client using configured provider/model
  • Responses cite or link back to relevant content

Potential items needed to build this out:

  1. Content indexing + embeddings
  • Small indexing pipeline: chunk posts/pages, embed passages, store in DB
  • Incremental updates on post changes
  • Basic “reindex” control in settings
  1. Retrieval ability
  • New Ability that accepts a user query and returns top-k relevant chunks with metadata (title, excerpt, permalink)
  • Reusable by other experiments in the future
  1. Chat orchestration
  • Endpoint for sending messages and returning AI output
  • Prompt assembly that combines visitor question + retrieved passages
  • Temporary conversation ID stored client side
  • Server side controller that routes each turn through WP AI Client
  1. Frontend UI
  • Minimal, accessible block (and/or JS component)
  • Sends messages to endpoint
  • Basic error handling and “reset conversation”

Recommended out of scope for v1

  • Admin-only assistants
  • Multi-channel messaging (WhatsApp, Telegram, etc.)
  • Advanced bot workflows or custom logic builders

Decisions to work through

  • Index only public content in v1 to avoid permissions complexity
  • Use a simple local embeddings table first; make storage pluggable later
  • Ship one UI pattern (floating bubble); blocks or template placement can follow later
  • Analytics can be minimal (count + common questions) or deferred entirely

Questions to consider

  • Should embeddings be stored as JSON or a dedicated vector column?
  • Any requirements for streaming responses now, or is single-shot OK for v1?
  • Should we expose a “developer mode” to override the default prompt?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No fields configured for Enhancement.

    Projects

    Status
    Backlog

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions