Building Self-Hosted AI Search on a VPS
This article covers the overall setup when you run your own system that lets AI search your documents and site content, and when to choose that over leaving search to an external service.

Ren

Procura
Overall setup
- Split the content of your site and documents into pieces for searching, and store them
- Receive the user's question and find the relevant pieces
- Have the AI generate an answer based on the pieces it found

Ren

Procura
Keeping up with updates
A site's content keeps being updated, so you need a mechanism to update the search data to match. Reflecting each update by hand isn't realistic, so build in from the start a mechanism that regularly rebuilds the search data automatically.
- Update the search data automatically whenever the content is updated
- Record the run results so you notice when an update fails
- Delete the previous data when you rebuild, so old pieces don't stay behind
Mind what is publicly searchable

Wilson

Procura

Ren

Procura
How to respond when nothing is found
If no piece relevant to the user's question is found and you force the AI to produce an answer, it may output groundless content that sounds plausible. When search results are thin, it damages users' trust less to honestly answer "No relevant information was found" than to present wrong information. Keep in mind that in some situations, saying you can't answer is safer than giving an answer.
- If relevant pieces are scarce, don't force the AI to generate an answer
- Prepare in advance a response that says "nothing was found"
- If some category has many questions with no results, suspect that the documents themselves are lacking

Procura

Ren
This article is translated from the Japanese original. If the two differ, the Japanese version is the one we keep up to date.