Skip to main content

GNES is Generic Neural Elastic Search, a cloud-native semantic search system based on deep neural network.

Project description

GNES Generic Neural Elastic Search, logo made by Han Xiao

travis ci status PyPI Documentation Status PyPI - License

HighlightsOverviewInstallGetting StartedUsageTutorialsFAQ

What is it

GNES [jee-nes] is Generic Neural Elastic Search, a cloud-native semantic search system based on deep neural network.

Leveraging the cloud infrastructure, GNES enables large-scale index and semantic search for text-to-text, image-to-image, video-to-video and possibly any-to-any content form.


  • :cloud: Cloud-native: GNES is all-in-microservice: encoder, indexer, preprocessor and router are all running statelessly and independently in their own containers. They communicate via versioned APIs and collaborate under the orchestration of Docker Swarm/Kubernetes etc. Scaling, load-balancing, automated recovering, they come off-the-shelf in GNES.
  • :hatching_chick: Easy-to-use on every level: How long would it take to deploy a change that involves just changing the encoder from BERT to ELMO or switching a layer in VGG? In GNES, this is just one line change in a YAML file. We abstract the encoding and indexing logic from the code to a YAML config, so that you can combine or stack encoders and indexers without even touching the codebase.
  • :rocket: State-of-the-art: Taking advantage of fast-evolving AI/ML/NLP/CV communities, we learn from best-of-breed deep learning models and plug them into GNES, making sure you always enjoy the state-of-the-art performance.
  • :nut_and_bolt: Generic and compatible: Searching for texts, image or even short-videos? Using Python/C/Java/Go/HTTP as the client? Doesn't matter which content form you have or which language do you use, GNES can handle them all.
  • :100: Best practice: We love to learn the best practice from the community, helping our GNES to achieve the next level of availability, resiliency, performance, and durability. If you have any ideas or suggestions, feel free to contribute.


component overview

Getting Started

As a cloud-native application, GNES requires an orchestration engine to coordinate all micro-services. Currently, we support Kubernetes, Docker Swarm and a built-in solution. Click on one of the icons below to get started.

orchestration selection

▶️ I want to use GNES with Kubernetes. ▶️ I want to use GNES with Docker Swarm. ▶️ I want to use GNES on a single machine.

Using GNES with Docker Swarm

The easiest and the recommended way to use GNES is via Docker, which uses containers to create virtual environments that isolate a GNES installation from the rest of the system. You don't need to worry about dependencies, they are self-contained in the GNES docker image. Moreover, GNES relies on the Docker Swarm for managing, scaling and conducting orchestration tasks over multiple micro-services.

1. Prerequisites

2. Start GNES with the wizard

If you are new to GNES, it is recommended to use the wizard to config and start GNES.

bash <(curl -s

At the last step, the wizard will generate a random name for the service, say my-gnes-0531. Keep that name in mind. If you miss that name, you can always use docker stack ls to checkout the name of your service.

How do I know if GNES is running succesfully? (click to expand...)

To tell whether the service is running successfully or not, you can use docker stack ps my-gnes-0531. It should give you results as follows:

ID                  NAME                         IMAGE                                           NODE                DESIRED STATE       CURRENT STATE                ERROR               PORTS
zku2zm9deli9        my-gnes-0531_encoder.1   VM-0-3-ubuntu       Running             Running about an hour ago
yc09pst6s7yt        my-gnes-0531_grpc_serve.1   VM-0-3-ubuntu       Running             Running about an hour ago

Note, the running status under CURRENT STATE suggests everything is fine.

How can I terminate GNES? (click to expand...)

To stop a running GNES service, you can use docker stack rm my-gnes-0531.

Using GNES with Kubernetes


Using GNES with Built-In Orchestration



First thing to know, GNES has three independent runtimes: train, index and search. This differs from the classic machine learning system which has two runtimes i.e. train and inference; also differs from the classic search system that has two runtimes i.e. index and search. Depending on the runtime of GNES, the microservices may be composed, work and communicate with others in different ways. In other word, the runtime determines which service doing what logic at when. In the sequel, we will demonstrate how to use GNES under different runtimes.

Note, to switch between runtimee you need to shutdown the current runtime and start a new GNES.

Train mode: training encoders and indexers

Index mode: adding new documents

Query mode: searching relevant documents of a given query

:book: Documentation

The official documentation of GNES is hosted on It is automatically built, updated and archived on every new release.

Building the documentation from scratch

To build the documentation by yourself, you need to first install sphinx.

git clone && cd gnes




Thanks for your interest in contributing! There are many ways to get involved; start with our contributor guidelines and then check these open issues for specific tasks.

For contributors looking to get deeper into the API we suggest cloning the repository and checking out the unit tests for examples of how to call methods.

Release Notes


Citing GNES

  title={GNES: Generic Neural Elastic Search},
  author={Xiao, Han and Yan, Jianfeng and Wang, Feng and Fu, Jie},


Apache License 2.0

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for gnes, version 0.0.8
Filename, size File type Python version Upload date Hashes
Filename, size gnes-0.0.8-cp36-cp36m-macosx_10_13_x86_64.whl (186.3 kB) File type Wheel Python version cp36 Upload date Hashes View hashes
Filename, size gnes-0.0.8.tar.gz (70.0 kB) File type Source Python version None Upload date Hashes View hashes

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN SignalFx SignalFx Supporter DigiCert DigiCert EV certificate StatusPage StatusPage Status page