Download the PHP package widewebpro/craft-ai-assistant without Composer

On this page you can find all versions of the php package widewebpro/craft-ai-assistant. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package craft-ai-assistant

AI Assistant for Craft CMS

A Craft CMS 5 plugin that adds an AI-powered chat widget to your website. Install it, configure from the admin panel — and you're live. No frontend code required.

Supports OpenAI and Anthropic as AI providers, with a built-in knowledge base (RAG), tool calling, streaming responses, and full customization from the control panel.


Features


Requirements


Installation

Then install from the Craft control panel under Settings → Plugins, or run:


Setup

After installation, the plugin appears in the control panel sidebar. Click it to access the Dashboard, Conversations, and Settings.

All configuration is done under Settings, which contains six tabs:

General

Setting Description
Enable Widget Toggle the chat widget on/off across your site
AI Provider OpenAI or Anthropic
API Key Your provider's API key
Model GPT-5.1, GPT-5 Mini, GPT-5 Nano, GPT-4.1, GPT-4.1 Mini, GPT-4o, Claude Sonnet 5, Claude Sonnet 4.6, Claude Haiku 4.5
Embedding Model Model used for knowledge base embeddings (OpenAI)
Max Tokens Maximum tokens per response (100–8192)
Temperature Randomness (0 = deterministic, 2 = creative)
Agent Name Display name in the widget header
Agent Persona System prompt defining the agent's behavior and tone
Business Info Name, description, contact, hours — retrievable by the AI via tools

Appearance

Customize the widget look and feel with a live preview:

Knowledge Base

Upload documents to build your AI's information sources:

The AI agent does not inject entire files into prompts. It performs semantic search and retrieves only the most relevant chunks per question.

Pages

Control where the widget appears using URL glob patterns:

Restrictions

Control the agent's behavior boundaries:

Escalation

Configure how the agent hands off conversations to humans:

Setting Description
Enable/Disable Turn the escalation tool on or off entirely
Sensitivity Low — only when user explicitly demands a human. Medium (default) — when user clearly asks for help. High — also when user seems frustrated or agent fails repeatedly.
Escalation Message Shown to the user before the contact form appears
Confirmation Message Shown after the user submits the contact form
Contact Form Fields Fully customizable via an editable table — define label, handle, type (text, email, phone, textarea, select, checkbox), required flag, placeholder, and options
Submission Actions Route form data to external services via webhooks — configure endpoint URL, HTTP method, format (JSON/form), and custom headers
Field Mapping Map form field handles to external field names. Supports dot notation for nested payloads (e.g. email → properties.email)

When escalation triggers, the chat widget displays an inline contact form built from your field definitions. Submitted data is saved to the conversation metadata, visible in the admin panel, and optionally forwarded to configured webhook endpoints.


How It Works

Message Classification

Every incoming message is classified into one of four categories:

  1. Greeting — "hello", "hi", "thanks" → friendly conversational response, no tools called
  2. Question — anything that needs information → tools are called to gather context
  3. Off-topic — restricted or disallowed subject → returns the configured fallback message
  4. Escalation request — user asks for a human → triggers the escalation flow (sensitivity-dependent)

Two-Step AI Pipeline

For questions (category 2):

  1. Tool Selection — The AI decides which tools to call (search knowledge base, get page context, etc.) without answering directly.
  2. Answer Generation — Tool results are injected as context. The AI generates a grounded answer based on retrieved data.

This prevents hallucination by ensuring the agent always retrieves information before responding.

Built-in Tools

Tool What it does
search_knowledge_base Semantic search across uploaded files
get_page_context Extracts content from the page the user is currently on
get_business_info Returns business information from settings
list_knowledge_topics Lists available knowledge base files
escalate Marks the conversation for human review and shows a contact form

Knowledge Base (RAG)

  1. Files are uploaded and text is extracted (PDF, DOCX, TXT, MD)
  2. Text is split into overlapping chunks
  3. Each chunk is embedded via OpenAI's embedding API
  4. At query time, the question is embedded and matched via cosine similarity
  5. If no embedding match, MySQL FULLTEXT search is used as fallback

Escalation Flow

  1. User asks to speak with a human (sensitivity determines threshold)
  2. AI calls the escalate tool
  3. Conversation status is set to escalated in the database
  4. Chat widget shows an inline contact form built from the admin-defined fields
  5. User submits their details → saved to conversation metadata
  6. Enabled webhook actions fire — form data is mapped and sent to configured endpoints (CRMs, helpdesks, Zapier, etc.)
  7. Confirmation message displayed
  8. Admin can view escalated conversations, contact details, and webhook results in the CP

Chat Widget


Admin Panel

Dashboard — Quick stats: total conversations, messages, escalated conversations, knowledge base files, and recent activity.

Conversations — Full history of all user conversations. Filter by status (active, escalated). Click into any conversation to read the complete thread and view escalation contact details.


License

MIT — see LICENSE.


Built by Wideweb


All versions of craft-ai-assistant with dependencies

PHP Build Version
Package Version
Requires php Version ^8.2
craftcms/cms Version ^5.0
guzzlehttp/guzzle Version ^7.0
smalot/pdfparser Version ^2.0
phpoffice/phpword Version ^1.1
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package widewebpro/craft-ai-assistant contains the following files

Loading the files please wait ...