Build a Private AI Knowledge Base with Webman AI, Redis‑Stack, and Ollama
This guide walks you through setting up a private AI knowledge base using Webman AI 5.4.0, deploying Redis‑Stack, installing the illuminate/redis component, adding Ollama with DeepSeek and other embedding models, configuring Redis, importing training data, running the training process, and configuring role prompts for accurate AI responses.
Overview
Webman AI 5.4.0 introduces support for arbitrary embedding models, allowing seamless integration with local open‑source models such as DeepSeek to create a private AI knowledge base that operates without external network connections.
Training Module Deployment Steps
Step 1: Install Redis‑Stack Server
Note: A standard redis‑server does not support the required features; you must use redis‑stack.
docker pull docker.ms.run/redis/redis-stack
mkdir /home/data/redis -p
docker run --name redis-stack -v /home/data/redis:/data -p 6380:6379 -d redis/redis-stackStep 2: Install illuminate/redis Component for Webman
Note: For Webman v2 run the command in the Webman root directory.
composer require -W webman/redis illuminate/eventsNote: For Webman v1 run the command in the Webman root directory.
composer require -W illuminate/redis illuminate/eventsStep 3: Configure Redis
Create plugin/ai/config/redis.php with the following content:
<?php
return [
'default' => [
'host' => '127.0.0.1',
'password' => null,
'port' => 6380,
'database' => 0,
],
];Install Ollama and Add DeepSeek and Other Models
Install Ollama and pull the required models:
ollama pull nomic-embed-text
ollama pull deepseek-r1:14bTip: nomic-embed-text is a vector model required for training. Besides deepseek-r1:14b , you can also choose models such as deepseek-coder-v2:latest or qwen2.5:14b .
Step 4: Restart Webman
Linux: php start.php restart -d Windows:
ctl c # stop webman
php windows.php startTraining Process
Add Training Dataset
Upload your training files (supported formats: .txt and .md, each file ≤ 9 KB; compressed archives are also accepted with the same size limit per file).
Tip: If you see "Class 'Redis' not found", install the PHP Redis extension.
Import Data
Tip: Training data has no fixed format; prepend each entry with a concise title or question to improve results.
Start Training
When the vector field of a record contains a value, the entry has been successfully trained and its vector is stored in Redis‑Stack for fast retrieval.
Set Role Prompt
In the role configuration, select the training set and save (frontend users need to refresh the page for the role to take effect). The AI will then answer queries using the trained data.
Test Results
With the role prompt such as "Webman is a high‑performance PHP framework; you are a Webman assistant. Answer based on the Webman documentation, and if the question is unrelated, reply that no corresponding answer was found," the AI provides accurate, documentation‑based responses.
Signed-in readers can open the original source through BestHub's protected redirect.
This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactand we will review it promptly.
Open Source Tech Hub
Sharing cutting-edge internet technologies and practical AI resources.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.
