These options are available with the WPBot Pro Professional and Master Licenses
Manage Knowledge Base Sources
Manage entire files or spreadsheets instead of individual rows.
Source Name / URL
Type
Documents
Actions
prefix . 'rag_documents';
$sources = $wpdb->get_results("SELECT source_url, source_type, COUNT(*) as count, MAX(title) as display_name FROM {$table} GROUP BY source_url, source_type ORDER BY count DESC"); // phpcs:ignore WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.DirectDatabaseQuery.NoCaching, PluginCheck.Security.DirectDB.UnescapedDBParameter
if ($sources) {
foreach ($sources as $source) {
$display_url = $source->source_url ?: "Manual Upload";
?>
display_name); ?>
source_type); ?>
count); ?> chunks
No sources found.
';
}
?>
Database Utilities
Upgrade your database to the new **High-Speed Binary Format**. This makes similarity searches significantly faster (10x+ speed improvement).
Knowledge Base
prefix . 'rag_documents';
// Handle Table Creation
if (isset($_POST['rag_create_table']) && check_admin_referer('rag_create_table_nonce')) {
$charset = $wpdb->get_charset_collate();
$sql_rag_documents = "CREATE TABLE $table_rag_documents (
id BIGINT UNSIGNED AUTO_INCREMENT PRIMARY KEY,
doc_id VARCHAR(100) DEFAULT NULL,
title VARCHAR(255) NOT NULL,
content LONGTEXT NOT NULL,
embedding LONGTEXT NOT NULL,
source_type VARCHAR(20) DEFAULT 'post',
source_url VARCHAR(255) DEFAULT NULL,
file_url TEXT DEFAULT NULL,
metadata LONGTEXT DEFAULT NULL,
status VARCHAR(50) DEFAULT 'complete',
created_at DATETIME DEFAULT CURRENT_TIMESTAMP
) $charset;";
require_once ABSPATH . 'wp-admin/includes/upgrade.php';
dbDelta($sql_rag_documents);
echo '
Database table created successfully.
';
}
// Check if table exists
$table_exists = $wpdb->get_var($wpdb->prepare("SHOW TABLES LIKE %s", $wpdb->esc_like($table_rag_documents))) === $table_rag_documents; // phpcs:ignore WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.DirectDatabaseQuery.NoCaching
if (!$table_exists) {
?>
Knowledge Base Database
The table does not exist. Please create it to start using the Knowledge Base.