First commit

This commit is contained in:
Saufi
2026-05-18 08:56:23 +08:00
commit fd3d3a4d2b
147 changed files with 22099 additions and 0 deletions

65
config/knowledgebase.php Normal file
View File

@@ -0,0 +1,65 @@
<?php
// config/knowledgebase.php
// Konfigurasi umum untuk sistem knowledge base
return [
/*
|--------------------------------------------------------------------------
| Upload Configuration
|--------------------------------------------------------------------------
*/
'upload' => [
'max_file_size' => (int) env('KB_MAX_FILE_SIZE', 20480), // KB (20MB)
'allowed_mimes' => ['pdf'],
'storage_disk' => env('KB_STORAGE_DISK', 'local'),
'storage_path' => 'documents', // dalam storage/app/documents/
],
/*
|--------------------------------------------------------------------------
| Chunking Configuration
|--------------------------------------------------------------------------
*/
'chunking' => [
'max_words' => (int) env('KB_CHUNK_MAX_WORDS', 500),
// Max patah perkataan per chunk
'overlap_words' => (int) env('KB_CHUNK_OVERLAP_WORDS', 75),
// Overlap antara chunk berturutan
'min_words' => (int) env('KB_CHUNK_MIN_WORDS', 30),
// Chunk dengan < min_words akan digabung atau dibuang
],
/*
|--------------------------------------------------------------------------
| RAG Configuration
|--------------------------------------------------------------------------
*/
'rag' => [
'max_context_chunks' => (int) env('KB_RAG_MAX_CHUNKS', 5),
// Max chunk yang dimasukkan dalam context untuk model
'max_context_words' => (int) env('KB_RAG_MAX_CONTEXT_WORDS', 2000),
// Jika terlalu banyak words, potong context
],
/*
|--------------------------------------------------------------------------
| Rate Limiting
|--------------------------------------------------------------------------
*/
'rate_limit' => [
'chatbot_per_minute' => (int) env('KB_CHAT_RATE_LIMIT', 20),
// Request chatbot per minit per IP
],
/*
|--------------------------------------------------------------------------
| Queue Configuration
|--------------------------------------------------------------------------
*/
'queue' => [
'ingestion' => env('KB_QUEUE_INGESTION', 'default'),
'embedding' => env('KB_QUEUE_EMBEDDING', 'default'),
'chat_log' => env('KB_QUEUE_CHAT_LOG', 'default'),
],
];