Download the PHP package excelle-insights/ai-assistant without Composer
On this page you can find all versions of the php package excelle-insights/ai-assistant. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package ai-assistant
Excelle Insights — AI Assistant Package
Standalone Composer package: one trainable AI core for WhatsApp auto-reply,
in-app user guidance, diagnosis support and business analysis — same install
pattern as excelle-insights/whatsapp, working with any LLM provider
(OpenAI, OpenRouter, Ollama, Together, vLLM…), not just OpenAI.
Name history: folder/repo are now
ai-assistant; own tables areai_assistant_*. The composer nameexcelle-insights/ai-assistantand the PHP namespaceExcelleInsights\AiAssistant\…are kept until hosts migrate (then they becomeexcelle-insights/ai-assistant/…\AiAssistant\…).
No edits to vendor/excelle-insights/whatsapp required.
Full step-by-step guides live in docs/ (install, connect,
knowledge, WhatsApp channel, one-AI router, config, troubleshooting, LLM
providers + table rename).
Features
- Hooks after
WhatsappService::processWebhookPayload()— no vendor edit. - One AI for all channels: WhatsApp reply, knowledge-based user guide, vehicle-diagnosis support, business analysis (host routes per intent).
- Any LLM via
Contracts\LlmClientInterface+Support\LlmFactory(LLM_PROVIDER=openai|openrouter|together|ollama|vllm|lmstudio|custom). - Trainable per
company_id: FAQs, services, pricing, How-To guides viaai_assistant_knowledge(embeddings + keyword search) and self-learningai_assistant_training. No company model? SetAI_ASSISTANT_TENANT_ID=0and pass0everywhere —company_idis only a scoping key, seedocs/02-connect-application.md. - Own tables (
AI_ASSISTANT_TABLE_PREFIX, defaultai_assistant; legacyAI_WHATSAPP_TABLE_PREFIXstill honoured) +SystemContextProviderInterfaceto pull host data without FK tangles. Rename migration included. - Async queue
ai_assistant_queue+whatsapp_conversations/whatsapp_messagesbridge.
Requirements
- PHP >= 8.1, PDO MySQL,
ext-json - For the WhatsApp channel: host app with
excelle-insights/whatsapptables (whatsapp_business_profiles,whatsapp_messages,whatsapp_conversations,whatsapp_credentials,whatsapp_access_tokens). Other channels need no WhatsApp tables. -
Host
.envLLM (OpenAI default; alternatives indocs/08-llm-providers-and-rename.md): -
Host
.envauto-reply + tables: - Migrations need
DB_HOST/DB_NAME/DB_USER/DB_PASSWORDin host.env(runtime PDO is injected by the host, or built fromDB_DSNby the facade).
Installation
1. Require via Composer
Or for local dev add to host composer.json:
2. Run package migrations (own phinx.php, like whatsapp package)
Creates (prefix from TablePrefix::get(), default ai_assistant):
{prefix}_knowledge(company_id,category,title,content,embedding,source,status){prefix}_sessions(conversation_id,company_id,history_json,expires_at){prefix}_queue(conversation_id,wa_message_id,status,payload,attempts,error){prefix}_training(company_id,question,answer){prefix}_schema(learned field descriptions){prefix}_reference(lookup summaries: services + prices, counts)
Upgrading from ai_whatsapp_*? Migration 20260922000000 renames old → new,
data preserved — see docs/08-llm-providers-and-rename.md §3.
No company_id column added to vendor whatsapp_* tables.
3. Hook inbound (host adds 2 lines, no vendor edit)
In api/whatsapp/callback.php and api/src/Controllers/WhatsappController.php::webhookProcess() after WhatsappService::processWebhookPayload($payload):
$results is the array returned by processWebhookPayload (['type'=>'message', 'wa_message_id'=>..., 'conversation_id'=>...]).
4. Provide system context (host implements interface)
Pass to manager (any LlmClientInterface accepted — use LlmFactory::make()
for env-driven provider selection):
If you don't provide openAI, the package builds one via LlmFactory::make()
reading LLM_* (fallback OPENAI_*) from host .env.
Any app works here: any PDO, any SystemContextProviderInterface
implementation, any LlmClientInterface (LlmFactory::make() or your own) —
ExcelleCore\* above is just the MaintainA example.
4b. Receive booking requests (host implements interface)
When a customer asks to book ("I want to book…", "nataka miadi…"), the
package detects the intent, extracts the service + preferred date from the
conversation, and hands a Support\BookingIntent to the host. The package
never writes app tables — the host persists it however its domain requires
(booking row, ticket, CRM lead).
Register it where you hook inbound (constructor or setter — both work):
Notes:
- The handler runs after the reply is sent and the session is stored, so it can't delay or break the customer-facing flow; host exceptions are caught and logged by the package.
- Extraction uses the LLM when configured, with a keyword fallback when not
(
BookingIntentExtractoris also usable standalone). - Disable per deployment with
AI_ASSISTANT_BOOKING_HOOK=false. - Timezone for relative dates ("Friday", "tomorrow"):
AI_ASSISTANT_TIMEZONE(fallbackAPP_TIMEZONE, thenUTC).
5. Train
Or via service:
File import: POST https://host/api/integrations/whatsapp/ai-knowledge/import
(CSV; see docs/03-knowledge-training.md).
Configuration
config/ai-assistant.php (publish to host config/ if needed):
How It Works
- Inbound
POST /api/integrations/whatsapp/webhook(router flattened{field,value}) →WhatsappService::processWebhookPayload()insertswhatsapp_messagesdirection=inbound+whatsapp_conversations+events. - Hook calls
AiAssistantService::onInboundMessages()for each newwa_message_id. - Context via
SystemContextProvider+ Knowledge viaKnowledgeService::search($companyId, $messageBody, 5). - Prompt built and sent via the configured LLM (
LlmClientInterface::chat(), default model fromLlmFactory::defaultModel()). - Reply via
WhatsappApi::sendTextMessage($from, $reply)ifisSessionActive()else enqueue towhatsapp_queuewith template.
Same core answers guide/diagnosis/analysis requests — the host routes per
intent (see docs/05-one-ai-router.md).
Pushing Changes
(Cutting over to composer name excelle-insights/ai-assistant happens as a
separate versioned step once hosts are ready.)
References
- Step-by-step:
docs/(esp.08-llm-providers-and-rename.md) - Black-box proposal:
BLACKBOX_DECOUPLING_PROPOSAL.md - Host AI:
api/src/Controllers/AiController.phpcallAI(), host.envOPENAI_*/LLM_* - WhatsApp vendor:
api/vendor/excelle-insights/whatsapp/src/Facade/WhatsAppManager.php,WHATSAPP_MIGRATION_NOTES.md(host docs)
All versions of ai-assistant with dependencies
ext-json Version *
ext-pdo Version *
guzzlehttp/guzzle Version ^7.0
vlucas/phpdotenv Version ^5.7