1. Go to this page and download the library: Download webbycrown/laraknow-ai library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
webbycrown / laraknow-ai example snippets
'route_middleware' => ['web', 'auth'],
'route_name_prefix' => 'my-laraknow',
'rate_limiter_name' => '',
return [
'instructions' => <<<'PROMPT'
You are the AI assistant for this application.
Application Overview:
Describe what this application does.
Assistant Responsibilities:
Describe what users may ask the assistant to help with.
Database Meaning:
- Explain important table meanings and relationships.
- Explain business statuses using real stored values.
- Explain workflow rules, such as when to ask follow-up questions.
Small Talk:
- For greetings, thanks, and casual questions, reply naturally and briefly.
Strict Rules:
- Use only configured tools and allowed tables.
- Do not invent records, counts, statuses, or database values.
- For count/total questions, return only the verified aggregate unless details are requested.
PROMPT,
'auto_analyze_project' => false,
'allowed_tables' => [
'products',
'orders',
'customers',
],
'blocked_columns' => [
'password',
'remember_token',
'token',
'api_token',
],
'blocked_table_columns' => [
'customers' => ['email', 'phone'],
],
'route_prefix' => 'laraknow-ai',
'route_name_prefix' => 'laraknow-ai',
'rate_limiter_name' => 'laraknow-ai',
'rate_limiter_max_attempts' => 30,
'rate_limiter_decay_minutes' => 1,
'route_middleware' => ['web', 'auth'],
'ui' => [
'theme' => 'auto',
'brand' => [
'name' => 'LaraKnow',
'subtitle' => 'Always here to help',
],
],
];
text
GET /laraknow-ai
POST /laraknow-ai/chat
GET /laraknow-ai/conversations
POST /laraknow-ai/conversations
GET /laraknow-ai/conversations/{conversation}/messages
DELETE /laraknow-ai/conversations/{conversation}