Skip to main content

Insightful Search - TrueNAS - Setup

Work In Progress!
#

Not all of the guides have been written. Some of the links (especially the docker specific ones) don’t have pages yet.

Looking for the Docker Version? Click here - Coming Soon

Already have everything setup? Click here to learn how to use it.

Table of Contents
#

What Is This?
#

Insightful Search is a self-hosted service that can be used to search for snippets of your own documents by the meaning of the search term.

For example: If you use this with your journal, you might search for something like “personal growth”. The results will include excerpts from your journal pages that reference personal growth and anything related to it. Even if you didn’t specifically write the words “personal growth” it should be able to recognize it. That works by using a specific type of database that can (kinda) encode the meaning of the data it stores.

I have personally found this to be very helpful for personal reflection, and growth. I want to share it in case anyone else finds it useful.

The database it uses is called chromadb, which uses an AI embedding model. This database and the AI models used in it must be run locally on YOUR hardware. That way everything remains private, and your personal data never leaves your control.

Since this is all self-hosted there are some drawbacks.
#

The hardware you need to run it. It requires a semi-recent graphics card capable of running AI models. Other than that it doesn’t necessarily need a dedicated pc (Even though I personally have a separate home server for this kind of thing, it’s not required).

It also requires a few other self-hostable services to be set up on either the same PC, or another one on your network. These other services are: - Ollama (For running the AI models) - RocketChat (For interacting with the whole thing) - Node-RED (The software that lets RocketChat communicate with this server) - Chromadb (The database)

Perequisites:
#

All of the above apps / services must be set up for Insightful Search to work. If you haven’t done that yet, I have guides for those as well. I recommend installing them in the following order:

TrueNAS:
#

If you have a TrueNAS server set up, all of this is a bit easier, but I will have intructions on how to do this with just docker compose here - Coming Soon

In the TrueNAS web interface, go to the Apps tab. From there click on “Discover Apps” in the top corner, then click “Custom App”. You will be presented with a new menu. Enter the following values, if I don’t specifically mention a value / field, leave it as the default.

Custom App Menu
#

  • Application Name: insightful-search
  • Repository: reloorian/insightful-search
  • Tag: latest
  • Hostname: insightful-search
  • Timezone: Your Timezone

Environment Variables
#

This part is a bit annoying, but it’s important! Click the Add button for each value (There should be 7 total)

  • Name: CHUNK_SIZE
    • Value: 150
  • Name: CHUNK_OVERLAP
    • Value: 20
  • Name: OLLAMA_SERVER
    • Value: http://IP_FOR_OLLAMA:PORT
    • Note: IP_FOR_OLLAMA should be the local IP of the system running Ollama on your network. If that is also this TrueNAS system, use the same IP and make sure the port is correct. Ollama’s default port is 11434
  • Name: EMBEDDING_MODEL
    • Value: hf.co/mradermacher/bge-large-en-v1.5-i1-GGUF:i1-Q4_K_M
    • Note: This can be changed, but the one I chose here is open source, and works well for me. If you don’t know how to find another one that will work, don’t change this.
  • Name: CHROMA_SERVER
    • Value: IP_FOR_CHROMA_DB
    • Note: Similar to OLLAMA_SERVER, this should be the local IP for your ChromaDB instance. Do not include http:// or https:// and do not include the PORT (that’s next)
  • Name: CHROMA_PORT
    • Value: 8000
    • Note: If using TrueNAS for ChromaDB, use the Host Port you chose when setting that up. The default port for ChromaDB is 8000
  • Name: PORT
    • Value: 8123
    • Note: This is the port Insightful Search will run on. If using TrueNAS, this will be the Container Port, we will set the Host Port later.

Optional Environment Variable
#

  • Name: IGNORE_FOR_PROCESSING
    • Value: A comma separated list of files and folders to completely ignore
    • Note: This must be formatted as follows:
      • To ignore a specific file add: ****/FILE_NAME.FILE_EXTENSION
        • Examples: **/Index.md or **/SuperSecretFile.txt
      • To ignore a whole folder / directory and its contents: /DIRECTORY_NAME/
        • Example: /DontLookInThisFolder/
      • To ignore a specific type of file: */.FILE_EXTENSION
        • Example: */.txt ignores all .txt files
      • To ignore all files whose name contains a specific word: **/WORD_TO_IGNORE
        • Example: **/sync-error will ignore any file with sync-error in the name
    • Full Example: /Index.md,/Tags/,/Templates/,/.obsidian/,/.stfolder/,/.stversions/,/.trash/,**/.sync
    • Note: Do not add spaces unless the pattern you’re ignoring includes them. It should be pattern1,pattern2,etc…

Continuing With The Custom App Menu
#

  • Restart Policy: Unless Stopped
  • Custom User: Checked
    • User ID: 568
    • Group ID: 568
  • Port:
    • Click the Add button
    • Bind Mode: Publish port on the host for external access
    • Host Port: 30000
      • Note: This will be the port you use to communicate with the app. It can be any open port.
    • Container Port: 8123
      • Note: This should match the PORT Environment variable from above. The default for this app is 8123.
    • Protocol: TCP
    • Click Add next to Host IPs
      • Note: After clicking Add the default value should be fine.

Storage Configuration
#

This part is VERY important. This will tell Insightful Search where to find your documents.

Click Add next to Storage and enter the following:

  • Type: Host Path
  • Read Only: Checked (Not technically necessary since Insightful Search never modifies your files)
  • Mount Path: /app/documents/COLLECTION_NAME
    • Note: COLLECTION_NAME technically can be anything. You will need to remember and use this name when interacting with the app later.
  • Host Path: Either type the path to the dataset containing your documents, or use the dropdown menu to find it.

You will need to add another Storage / Mount Point for each collection you have or want. You don’t need to do it all now, they can be added later, the same way I just explained.

Install
#

Click Install all the way at the bottom

Finishing
#

If you have all the perequisites installed, the final step is to configure Node-RED and RocketChat to work with all this: