• Stars
    star
    172
  • Rank 221,201 (Top 5 %)
  • Language
    C++
  • License
    Apache License 2.0
  • Created over 1 year ago
  • Updated about 2 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Knowhere is an open-source vector search engine, integrating FAISS, HNSW, etc.

Knowhere Logo

This document will help you to build the Knowhere repository from source code and to run unit tests. Please file an issue if there's a problem.

Introduction

Knowhere is written in C++. It is an independent project that act as Milvus's internal core.

Building Knowhere Within Milvus

If you wish to only use Knowhere within Milvus without changing any of the Knowhere source code, we suggest that you move to the Milvus main project and build Milvus directly, where Knowhere is then built implicitly during Milvus build.

System Requirements

All Linux distributions are available for Knowhere development. However, a majority of our contributor worked with Ubuntu or CentOS systems, with a small portion of Mac (both x86_64 and Apple Silicon) contributors. If you would like Knowhere to build and run on other distributions, you are more than welcome to file an issue and contribute!

Here's a list of verified OS types where Knowhere can successfully build and run:

  • Ubuntu 20.04 x86_64
  • Ubuntu 20.04 Aarch64
  • MacOS (x86_64)
  • MacOS (Apple Silicon)

Building Knowhere From Source Code

Install Dependencies

$ sudo apt install build-essential libopenblas-dev libaio-dev python3-dev python3-pip
$ pip3 install conan==1.61.0 --user
$ export PATH=$PATH:$HOME/.local/bin

Build From Source Code

  • Ubuntu 20.04
$ mkdir build && cd build
#add conan remote
$ conan remote add default-conan-local https://milvus01.jfrog.io/artifactory/api/conan/default-conan-local
#DEBUG CPU
$ conan install .. --build=missing -o with_ut=True -s compiler.libcxx=libstdc++11 -s build_type=Debug
#RELEASE CPU
$ conan install .. --build=missing -o with_ut=True -s compiler.libcxx=libstdc++11 -s build_type=Release
#DEBUG GPU
$ conan install .. --build=missing -o with_ut=True -o with_raft=True -s compiler.libcxx=libstdc++11 -s build_type=Debug
#RELEASE GPU
$ conan install .. --build=missing -o with_ut=True -o with_raft=True -s compiler.libcxx=libstdc++11 -s build_type=Release
#DISKANN SUPPORT
$ conan install .. --build=missing -o with_ut=True -o with_diskann=True -s compiler.libcxx=libstdc++11 -s build_type=Debug/Release
#build with conan
$ conan build ..
#verbose
export VERBOSE=1
  • MacOS
#RELEASE CPU
conan install .. --build=missing -o with_ut=True -s compiler.libcxx=libc++ -s build_type=Release
#DEBUG CPU
conan install .. --build=missing -o with_ut=True -s compiler.libcxx=libc++ -s build_type=Debug

Running Unit Tests

# in build directories
#Debug
$ ./Debug/tests/ut/knowhere_tests
#Release
$ ./Release/tests/ut/knowhere_tests

Clean up

$ git clean -fxd

GEN PYTHON WHEEL(NEED REALSE BUILD)

install dependency:

sudo apt install swig python3-dev
pip3 install bfloat16

after build knowhere:

cd python
python3 setup.py bdist_wheel

install knowhere wheel:

pip3 install dist/pyknowhere-0.0.0-cp38-cp38-linux_x86_64.whl

clean

cd python
rm -rf build
rm -rf dist
rm -rf knowhere.egg-info
rm knowhere/knowhere_wrap.cpp
rm knowhere/swigknowhere.py

Contributing

Pre-Commit

Before submitting a pull request, please make sure running pre-commit checks locally to ensure the code is ready for review. Use the following command to install pre-commit checks:

pip3 install pre-commit
pre-commit install --hook-type pre-commit --hook-type pre-push

# If clang-format and clang-tidy not already installed:
# linux
apt install clang-format clang-tidy
# mac
brew install llvm
ln -s "$(brew --prefix llvm)/bin/clang-format" "/usr/local/bin/clang-format"
ln -s "$(brew --prefix llvm)/bin/clang-tidy" "/usr/local/bin/clang-tidy"

More Repositories

1

GPTCache

Semantic cache for LLMs. Fully integrated with LangChain and llama_index.
Python
7,164
star
2

attu

The GUI for Milvus
TypeScript
1,246
star
3

VectorDBBench

A Benchmark Tool for VectorDB
Python
523
star
4

feder

Visualize hnsw, faiss and other anns index
Jupyter Notebook
380
star
5

akcio

Akcio is a demonstration project for Retrieval Augmented Generation (RAG). It leverages the power of LLM to generate responses and uses vector databases to fetch relevant documents to enhance the quality and relevance of the output.
Python
249
star
6

phantoscope

Open Source, Cloud Native, RESTful Search Engine Powered by Neural Networks
Python
140
star
7

milvus-backup

Backup and restore tool for Milvus
Go
124
star
8

pyglass

Graph Library for Approximate Similarity Search
C++
85
star
9

milvus-helm

Mustache
56
star
10

milvus-operator

The Kubernetes Operator of Milvus.
Go
47
star
11

MolSearch

An opensource molecule analyze software
JavaScript
43
star
12

starling

C++
35
star
13

BBAnn

Block-based Approximate Nearest Neighbor
C++
31
star
14

awesome-milvus

A curated list of awesome Milvus projects and resources.
27
star
15

cloud-vectordb-examples

Zilliz Cloud examples
Java
27
star
16

milvus-cdc

Milvus-CDC is a change data capture tool for Milvus. It can capture the changes of upstream Milvus collections and sink them to downstream Milvus.
Go
24
star
17

vector-index-visualization-tool

visualization tool for vector search index
TypeScript
22
star
18

milvus-migration

Go
18
star
19

vectordb-benchmark

Python
18
star
20

kafka-connect-milvus

kafka-connect-milvus sink connector
Java
17
star
21

Retriever-for-GPTs

An external retriever for GPTs implemented with Zilliz Cloud Pipelines, a more flexible and economic alternative to default GPTs knowledge base.
16
star
22

terraform-provider-zillizcloud

Go
12
star
23

spark-milvus

Java
7
star
24

phantoscope-bootcamp

Bootcamp for Phantoscope
Python
6
star
25

md2md

tool for generating markdown file, support fragment, variables
JavaScript
6
star
26

zilliz-cloud-typescript-example

TypeScript
6
star
27

infini-client

arctern client
TypeScript
4
star
28

milvus-bulkload

Python
1
star
29

arctern-webdocs

1
star
30

codelabs

Zilliz codelabs
JavaScript
1
star
31

zdoc-demos

Jupyter Notebook
1
star
32

milvus_gobench

1
star
33

milvus-gather

Go
1
star