Skip to content
/ kdb Public

A local knowledge base in your command line, powered by Ollama

Notifications You must be signed in to change notification settings

Jalalx/kdb

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

47 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

A knowledge database in your command line

kdb is a knowledgebase command line tool that relies on Ollama for embedding and inference. You can use it as is or integrate it with 3rd party tools to make your own Retrieval Augmented Generation (RAG) system.

Dependencies

Building the project

  1. Clone the repository
  2. make build
  3. Your binaries are at bin/ directory
  4. Add them to the PATH environment variable.

Run

Here is the list of available commands

kdb --help

Knowledgebase in your command line

Usage:
  kdb [flags]
  kdb [command]

Available Commands:
  list        Lists the embedded entries.
  query       Search in the embedded entries.
  embed       Stores the given text in the vector database.
  delete      Deletes an entry by given id.
  help        Help about any command

Flags:
  -h, --help      help for kdb
  -v, --version   Show version information

Use "kdb [command] --help" for more information about a command.

How embedding works?

kdb embed "here is some text"

Image

source

How data is retrieved?

kdb query "find something"

Image

source

The output can be piped to ollama to get the result in a proper format. Take a look at the scripts in the scripts/ directory.

ask

You can use your knowledge base by simply running: ask "some question"

learn

A quick way to embed some content for later retrival is using the learn script like this: learn "something"