Command line (bash, curl)

Upload a document

Open a Bash console in the folder where you have cloned the Kernel Memory repository.

Inside the repository, you will find a tools folder containing a few scripts, such as and These scripts can be used to send requests to the web service. Alternatively, you can use curl to send requests. The syntax is straightforward, and the web service responds with JSON.

Run the following commands:

cd tools
./ -f -i doc01 -s


curl -F 'file1=@""' -F 'documentId="doc01"'

You should see a confirmation message:

{"index":"","documentId":"doc01","message":"Document upload completed, ingestion pipeline started"}


cd tools
./ -q "Can I use KM from command line?" -s


curl -d'{"question":"Can I use KM from command line?"}' -H 'Content-Type: application/json'

The script will show the JSON returned by the web service, and among other details you should see the answer:

Yes, you can use Kernel Memory (KM) from the command line. There are several scripts provided, such as,, and, that allow you to interact with KM from the command line. These scripts provide functionality for uploading files, asking questions about your documents, and searching your indexed documents, respectively. Additionally, there is a script called that starts Qdrant, which is used to store and search vectors in KM.