• Stars
    star
    148
  • Rank 245,018 (Top 5 %)
  • Language
    C++
  • License
    Apache License 2.0
  • Created 11 months ago
  • Updated 10 days 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
6,666
star
2

attu

The GUI for Milvus
TypeScript
979
star
3

VectorDBBench

A Benchmark Tool for VectorDB
Python
439
star
4

feder

Visualize hnsw, faiss and other anns index
Jupyter Notebook
347
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
237
star
6

phantoscope

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

milvus-backup

Backup and restore tool for Milvus
Go
107
star
8

pyglass

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

milvus-helm

Mustache
45
star
10

MolSearch

An opensource molecule analyze software
JavaScript
40
star
11

milvus-operator

The Kubernetes Operator of Milvus.
Go
33
star
12

BBAnn

Block-based Approximate Nearest Neighbor
C++
30
star
13

awesome-milvus

A curated list of awesome Milvus projects and resources.
26
star
14

cloud-vectordb-examples

Zilliz Cloud examples
Java
26
star
15

vector-index-visualization-tool

visualization tool for vector search index
TypeScript
23
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
19
star
17

vectordb-benchmark

Python
18
star
18

Retriever-for-GPTs

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

kafka-connect-milvus

kafka-connect-milvus sink connector
Java
14
star
20

milvus-migration

Go
12
star
21

starling

C++
10
star
22

terraform-provider-zillizcloud

Go
9
star
23

phantoscope-bootcamp

Bootcamp for Phantoscope
Python
6
star
24

md2md

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

spark-milvus

Java
6
star
26

infini-client

arctern client
TypeScript
4
star
27

zilliz-cloud-typescript-example

TypeScript
3
star
28

milvus-bulkload

Python
1
star
29

codelabs

Zilliz codelabs
JavaScript
1
star
30

arctern-webdocs

1
star
31

milvus_gobench

1
star
32

milvus-gather

Go
1
star