Skip to main content

Client library for the NNext Neural search engine

Project description

NNext Python Client

About

The NNext Python Client.

NNext is a

  • ⚡ blazingly fast
  • 🔍 nearest-neighbors vector search engine

Installation | Quick Start | Documentation

Installation

To install the pynnext client, activate a virtual environment, and install via pip:

Supported Python Versions

Python >= 3.7, < 3.11

Mac/Linux

pip install virtualenv
virtualenv <your-env>
source <your-env>/bin/activate
<your-env>/bin/pip install nnext

Windows

pip install virtualenv
virtualenv <your-env>
<your-env>\Scripts\activate
<your-env>\Scripts\pip.exe install nnext

Quick Start

In order start interacting with NNext, you need to obtain a client here https://console.nnext.ai/.

Here's a quick example showcasing how you can create an index, insert vectors/documents and search among them via NNext.

Let's begin by installing the Connecting to NNext.

SELECT images.uid,
       images.name,
       images.vector < - > 'VECTOR(0.19, 0.81, 0.75, 0.11)'::vector AS dist
FROM nnext-public-data.images.laion
ORDER BY
    dist
    LIMIT 100
import nnext

nnclient = nnext.NNextClient(api_key="NNEXT_API_KEY")

# Perform a query.
QUERY = """
        SELECT images.uid, images.name,
          images.vector <-> 'VECTOR(0.19, 0.81, 0.75, 0.11)'::vector AS dist
        FROM nnext-public-data.images.laion
        ORDER BY
            dist
        LIMIT 100;
    """
query_job = nnclient.query(QUERY)  # API request
rows = query_job.result()  # Waits for query to finish

for row in rows:
    print(row.name)

Documentation

More documentation is available here here https://nnext.ai/docs.:

Project details


Download files

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

Source Distribution

nnext-0.0.43.tar.gz (48.8 kB view hashes)

Uploaded Source

Built Distribution

nnext-0.0.43-py3-none-any.whl (60.5 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page