Skip to content

About

Basic vector database plugin that works wth KoboldAI. Adds documents, images, and audio files.

Topics

Resources

Stars

4 stars

Watchers

2 watching

Forks

Latest commit

 

History

138 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 

Repository files navigation

KoboldCpp Vector Database

Let the AI you run in KoboldCpp search your own documents, and the KoboldCpp wiki, while you chat.

Kobold Lite answering a question from a database of the user's recipe files

This program plugs into KoboldCpp through MCP (Model Context Protocol), KoboldCpp's way of letting a model use outside tools. Once it's connected, you can ask the AI in Kobold Lite to:

  • search a vector database of your files and answer from the passages it finds, naming the files they came from;
  • create a new database from files and folders on your computer;
  • list your databases, and check on or stop a database that's being created.

It comes with kobold_wiki, a ready-made database of the entire official KoboldCpp wiki, so you can ask KoboldCpp questions as soon as it's set up.

Contents

What you need

  • Windows 10 or 11.
  • Python 3.11, 3.12, 3.13 or 3.14 (the standard version, not the free-threaded one). When you install it, tick Add python.exe to PATH.
  • Git.
  • Microsoft C++ Build Tools with the Desktop development with C++ workload.
  • KoboldCpp 1.106 or newer (this guide uses 1.123), and a GGUF model that can use tools. This guide uses Qwen3.5 4B.
  • About 12 GB of free disk space: roughly 7 GB for the program's libraries, 1.2 GB for the embedding model that searches the wiki, and room for the installer's downloads.
  • An NVIDIA graphics card is recommended. Without one the program still works, but creating databases is slower.

Part 1: Install the program

Step 1: Download the program

Download the latest release from the Releases page (under Assets, choose Source code (zip)) and unzip it to a short folder path that uses only English letters and numbers, for example C:\VectorDB-Plugin-for-KoboldAI. Inside, you'll find a src folder.

Step 2: Open a command prompt in the src folder

Open the src folder in File Explorer, click the address bar, type cmd and press Enter. A command prompt opens in that folder.

Step 3: Create and activate a virtual environment

Type these two commands, pressing Enter after each:

python -m venv .
.\Scripts\activate

The prompt now starts with (src).

Step 4: Run the installer

python setup_windows.py

The installer first asks four questions. Click Yes on each one. (The second one describes your graphics card, so its wording may differ.)

The installer's four questions, with Yes highlighted on each

It then installs everything the program needs, which can take a while since most of it is downloaded. At the end it downloads Yuan-embedding-2.0-en, the embedding model that searches the KoboldCpp wiki database, and saves a file called mcp.json in the folder you unzipped (next to src). The last lines look like this:

Saved C:\VectorDB-Plugin-for-KoboldAI\mcp.json
Load it in KoboldCpp's launcher: open the Loaded Files tab and choose this file as the MCP JSON file.

mcp.json tells KoboldCpp how to start this program. You'll pick it in KoboldCpp's launcher in Step 7.

Part 2: Start KoboldCpp with the program

Step 5: Download KoboldCpp and a model

From the KoboldCpp releases page, download koboldcpp.exe if you have an NVIDIA graphics card, koboldcpp-nocuda.exe if you don't, or koboldcpp-oldpc.exe for an older computer.

You also need a model in GGUF format. This guide uses Qwen3.5-4B-Q4_K_M.gguf (2.7 GB) from unsloth/Qwen3.5-4B-GGUF (open Files and versions and click the download arrow next to the file).

Step 6: Choose your model

Double-click koboldcpp.exe. In the launcher's Quick Launch tab, click Browse next to GGUF Text Model and pick the model file.

KoboldCpp launcher, Quick Launch tab, with the GGUF Text Model field and its Browse button highlighted

Step 7: Load mcp.json

  1. Click Loaded Files in the list on the left.
  2. Click Browse next to MCP JSON and pick the mcp.json file from Step 4.

KoboldCpp launcher, Loaded Files tab, with Loaded Files and the MCP JSON field highlighted

Step 8: Launch

Click Launch. KoboldCpp loads the model, starts this program in the background and opens Kobold Lite, its chat page, in your browser at http://localhost:5001.

The launcher doesn't remember your choices. To keep them, click Save Config (blue) before Launch and save the .kcpps file. Next time, click Load Config, pick that file and click Launch.

KoboldCpp launcher with Launch highlighted in yellow and the optional Save Config button highlighted in blue

Part 3: Turn on tool calling in Kobold Lite

Step 9: Pick a look (first time only)

The first time Kobold Lite opens, it asks you to pick a UI style. Any style works; this guide uses Classic UI. Click Set UI.

Kobold Lite welcome dialog with the Set UI button highlighted

Step 10: Open Settings

Click Settings in the menu bar at the top.

Kobold Lite main page with Settings highlighted in the menu bar

Step 11: Open the Tools tab

Kobold Lite Settings dialog with the Tools tab highlighted

Step 12: Enable tool calling

  1. Tick Enable Toolcalling. The program's tools, whose names start with vectordb_, appear in the list below. Leave Include KoboldCpp MCP Bridge ticked.
  2. Click OK.
  3. Optional, in blue: tick Automatically Execute Tools before you click OK if you trust this program. The AI then runs its searches without asking you to approve each one.

Kobold Lite remembers these settings in your browser, so you only do this once.

Kobold Lite Tools settings with Enable Toolcalling and OK highlighted in yellow and Automatically Execute Tools highlighted in blue

Part 4: Ask questions

Step 13: Ask about KoboldCpp

Type a question in the box at the bottom and press Enter. Naming the database helps the AI pick it, for example:

Search the kobold_wiki database: how do I set up MCP tool calling in KoboldCpp?

Step 14: Approve the search

Unless you ticked Automatically Execute Tools, each tool call waits for you. Click Approve to let it run. Inspect shows exactly what the AI wants to search for first.

A tool call request in the chat with the Approve button highlighted

The AI then answers from the passages it found:

Kobold Lite showing the tool call, its results and the answer based on the kobold_wiki database

One question can need more than one approval. After each result, KoboldCpp asks the AI whether it needs another tool call before it answers.

Step 15: Make a database of your own files

Ask the AI to create one, giving it a name and the full path of a folder or file:

Create a vector database called recipes from the files in D:\Recipes

Approve its calls. The database is built in the background, and the AI can check on it for you. A few files take under a minute; large folders can take much longer, and you can keep chatting meanwhile. The AI chooses an embedding model that suits the language of your files; see Embedding models.

Kobold Lite showing the AI creating the recipes database and reporting that it's ready

Then ask about your files:

Search my recipes: how long do I bake the banana bread, and at what temperature?

Kobold Lite answering from the banana_bread.txt file in the recipes database

The program reads PDF, Word, text, Markdown, HTML, e-mail, spreadsheet, RTF and image files. Images are described by a small vision model, which is downloaded the first time a database includes images.

Next time

  1. Start koboldcpp.exe, click Load Config and pick the file you saved in Step 8 (or repeat Steps 6 and 7).
  2. Click Launch.
  3. Ask away. Kobold Lite still has tool calling turned on.

Tips

  • Choose a capable model. Small models sometimes pick the wrong tool or repeat a search. If the AI repeats exactly the same search within three minutes, the program tells it to use the passages it already has.
  • Ask for more passages. A search returns 5 passages by default. Ask for a number, such as "search kobold_wiki and give me 10 passages about context shifting", and you'll get up to 20.
  • Scanned PDFs have no text to search. Mention that your PDFs are scans and the AI can make them searchable first; it saves a searchable copy named NAME_OCR.pdf next to each one.
  • The first search is slower, about 10 seconds, because the embedding model has to load. Later searches are quick.
  • Deleting a database is only possible from the command line, so the AI can never delete one.

Embedding models

Each database is built with one embedding model, which turns text into the numbers a search compares. When the AI creates a database, it picks a model for the language of your files using the rankings below. You can also name one yourself, for example "Create a database called notes from C:\Notes using geevec". A model is downloaded the first time a database uses it.

Scores are retrieval benchmark results; higher is better.

English documents

Rank Model English retrieval Legal retrieval (RTEB) Download size Dimensions
1 Yuan-embedding-2.0-en 70.69 — 1,192 MB 1,024
2 Jasper-Token-Compression-600M 66.19 43.93 1,215 MB 2,048

Other languages, or a mix of languages

Rank Model Multilingual retrieval English retrieval Download size Dimensions
1 geevec-embeddings-1.0-lite 70.91 62.23 732 MB 4,096
2 harrier-oss-v1-0.6b 70.75 — 1,190 MB 1,024

The kobold_wiki database uses Yuan-embedding-2.0-en, which the installer downloads. python cli.py models shows the same rankings and which models you've downloaded.

The command line

Everything the AI can do, and more, is also available from a command prompt. Open one in the src folder, activate the virtual environment with .\Scripts\activate, then run a command:

Command What it does
python cli.py databases List your databases
python cli.py create NAME FOLDER --model yuan Create a database from a folder
python cli.py search NAME "your question" Search a database
python cli.py files NAME List the files in a database
python cli.py delete NAME Delete a database
python cli.py status Show the progress of a database being created
python cli.py models List the embedding models and what each is best for
python cli.py settings Show or change settings, such as the number of passages per search
python cli.py wiki Check whether the KoboldCpp wiki database is current
python cli.py mcp-config Save mcp.json again, for example after moving the program's folder

Run python cli.py --help, or python cli.py COMMAND --help for one command, to see every option.

Keeping the KoboldCpp wiki database current

Each release of this program comes with the KoboldCpp wiki as it was when the release was made. To check for changes since then:

python cli.py wiki

To download the current wiki and rebuild the database when it has changed:

python cli.py wiki update

Troubleshooting

  • Kobold Lite's Tools tab says "No tools were found from any reachable server." KoboldCpp was started without mcp.json. Close KoboldCpp and repeat Steps 6 to 8, making sure the MCP JSON field shows the file.
  • KoboldCpp's window shows MCP Init Error or MCP Setup Error. KoboldCpp couldn't start the program, usually because the program's folder was moved or renamed after mcp.json was saved. Run python cli.py mcp-config in the activated src folder and pick the new mcp.json in the launcher.
  • A search says the embedding model isn't downloaded. Run the python cli.py download command it shows.
  • The AI answers without searching. Name the database in your question, as in the examples above.
  • The AI asks for approval many times. That's KoboldCpp asking it after every result whether another tool call is needed. Tick Automatically Execute Tools (Step 12) if you trust this program.

About

Basic vector database plugin that works wth KoboldAI. Adds documents, images, and audio files.

Topics

Resources

Stars

4 stars

Watchers

2 watching

Forks

Releases

Packages

Used by

Contributors

Languages