Skip to main content

PyVGX - Vector Graph Index Python Extensions

Project description

VGX

Distributed engine for plugin-based graph and vector search

Why VGX?

VGX + 1 is WHY
+1 is you

Originally short for Vector Graph indeX, VGX is a high-performance, distributed engine for building custom search and recommendation services using Python plugins. It combines real-time graph traversal, vector similarity, and expressive filtering into a unified platform, backed by a native C-core for speed and scalability. Developers can implement service logic using the PyVGX C-extensions, expose it as HTTP endpoints, and automatically scale across a sharded, replicated back-end. With built-in support for ANN search, dynamic graphs, expression-based filtering, and pluggable infrastructure, VGX makes it easy to develop powerful, low-latency systems for semantic search, recommendation, autocomplete, and more.

About This Project

VGX was originally developed in-house at Rakuten, Inc. between 2014 and 2025 as a versatile platform for live services. Built from the ground up, it focuses on maximizing memory efficiency and hardware utilization while delivering consistent low-latency performance. In 2025, we open-sourced the platform to share its capabilities with the wider community and foster collaboration.

Getting Started

You will need Python 3.9 or higher and one of the supported operating systems:

  • macOS: 14 (Sonoma) or higher
  • Linux: glibc 2.34 or higher (e.g. Ubuntu 22.04+)
  • Windows: 10 or higher

It is usually a good idea to use a virtual environment to keep things isolated:

MacOS / Linux venv setup

python3 -m venv vgxenv
source vgxenv/bin/activate

Windows venv setup

python -m venv vgxenv
call vgxenv\Scripts\activate.bat

Install PyVGX

pip install pyvgx

Hello VGX

Now let's define and expose a service using VGX:

Plugin Code

# hello.py
from pyvgx import *

system.Initialize("hello")

# This function will be exposed as an HTTP endpoint
def Hello(request: PluginRequest, message: str = "nothing"):
    response = PluginResponse()
    response.Append(f"Hi, you said {message}")
    return response

system.AddPlugin(Hello)

system.StartHTTP(9000) # main port=9000, admin port=9001
print("Visit 'http://127.0.0.1:9001' for admin" )

# Until SIGINT
system.RunServer()

Start Service

# Run the service
python hello.py

Send Request

# Send a request
curl http://127.0.0.1:9000/vgx/plugin/Hello?message=hello!

Simple Graph Examples

Example 1: Build relationships and ask a question

from pyvgx import *

# Make some friends
g = Graph( "friends" )
g.Connect( "Alice", "knows", "Bob" )
g.Connect( "Alice", "knows", "Charlie" )
g.Connect( "Alice", "knows", "Diane" )
g.Connect( "Charlie", "likes", "coffee" )

# Which of Alice's friends likes coffee?
g.Neighborhood(
    "Alice",
    arc      = "knows",
    neighbor = {
        'arc'      : "likes",
        'neighbor' : "coffee"
    }
) # -> ['Charlie']

Example 2: Build a vector graph and find most similar match

from pyvgx import *
import random

# Connect root to many vertices with vectors
root = g.NewVertex( "root" )
for n in range( 10000 ):
    v = g.NewVertex( f"v{n}" )
    v.SetVector( g.sim.rvec(1024) ) # assign a random vector
    r = g.Connect( root, "to", v )

# Select a target and derive a probe (add noise) from its vector
target = g["v7357"]
probe = [x + 0.5 * (random.random()-0.5) for x in target.GetVector().external]

# Run a query around root and sort by similarity to probe vector
g.Neighborhood(
    id="root",
    hits=3,
    fields=F_ID|F_RANK,
    vector=probe,
    sortby=S_RANK,
    rank="cosine(vector, next.vector)"
) # -> ['{"id": "v7357", "rankscore": 0.97...}', ...]

VGX Demo System

If you want to see a larger demo system in action, type the following in a terminal:

# Start a multi-node VGX system
vgxdemosystem multi

This will start many server instances (using ~16GB RAM) and open a system dashboard in your web browser:

SystemDashboard

Allow startup to finish and then try to send a query to the dispatcher running on port 9990:

# Run test queries, return JSON search result
curl -s http://127.0.0.1:9990/vgx/plugin/search?name=7357 | jq
curl -s http://127.0.0.1:9990/vgx/plugin/search?name=index | jq

You can see how the demo is implemented here: vgxdemoservice.py and vgxdemoplugin.py

To stop the system type this in a terminal:

vgxdemoservice stop

Documentation

Comprehensive API documentation is available.

A few quick links:

Recommendation: Read the Tutorial first. It covers some of the graph basics without going too deep.

Maintainers

This project was open-sourced by Rakuten, Inc. and is currently maintained by:

  • Stian Lysne@slysne
  • Contact: slysne.dev [at] gmail [dot] com

For questions, issues, or contributions, feel free to open an issue or pull request.

License

This project is licensed under the Apache License Version 2.0. See LICENSE for details.

Project details


Download files

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

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

pyvgx-3.6.0-cp314-cp314-win_amd64.whl (2.7 MB view details)

Uploaded CPython 3.14Windows x86-64

pyvgx-3.6.0-cp314-cp314-manylinux_2_34_x86_64.whl (3.0 MB view details)

Uploaded CPython 3.14manylinux: glibc 2.34+ x86-64

pyvgx-3.6.0-cp314-cp314-macosx_14_0_arm64.whl (1.9 MB view details)

Uploaded CPython 3.14macOS 14.0+ ARM64

pyvgx-3.6.0-cp313-cp313-win_amd64.whl (2.7 MB view details)

Uploaded CPython 3.13Windows x86-64

pyvgx-3.6.0-cp313-cp313-manylinux_2_34_x86_64.whl (3.0 MB view details)

Uploaded CPython 3.13manylinux: glibc 2.34+ x86-64

pyvgx-3.6.0-cp313-cp313-macosx_14_0_arm64.whl (1.9 MB view details)

Uploaded CPython 3.13macOS 14.0+ ARM64

pyvgx-3.6.0-cp312-cp312-win_amd64.whl (2.7 MB view details)

Uploaded CPython 3.12Windows x86-64

pyvgx-3.6.0-cp312-cp312-manylinux_2_34_x86_64.whl (3.0 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.34+ x86-64

pyvgx-3.6.0-cp312-cp312-macosx_14_0_arm64.whl (1.9 MB view details)

Uploaded CPython 3.12macOS 14.0+ ARM64

pyvgx-3.6.0-cp311-cp311-win_amd64.whl (2.7 MB view details)

Uploaded CPython 3.11Windows x86-64

pyvgx-3.6.0-cp311-cp311-manylinux_2_34_x86_64.whl (3.0 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.34+ x86-64

pyvgx-3.6.0-cp311-cp311-macosx_14_0_arm64.whl (1.9 MB view details)

Uploaded CPython 3.11macOS 14.0+ ARM64

pyvgx-3.6.0-cp310-cp310-win_amd64.whl (2.7 MB view details)

Uploaded CPython 3.10Windows x86-64

pyvgx-3.6.0-cp310-cp310-manylinux_2_34_x86_64.whl (3.0 MB view details)

Uploaded CPython 3.10manylinux: glibc 2.34+ x86-64

pyvgx-3.6.0-cp310-cp310-macosx_14_0_arm64.whl (1.9 MB view details)

Uploaded CPython 3.10macOS 14.0+ ARM64

pyvgx-3.6.0-cp39-cp39-win_amd64.whl (2.7 MB view details)

Uploaded CPython 3.9Windows x86-64

pyvgx-3.6.0-cp39-cp39-manylinux_2_34_x86_64.whl (3.0 MB view details)

Uploaded CPython 3.9manylinux: glibc 2.34+ x86-64

pyvgx-3.6.0-cp39-cp39-macosx_14_0_arm64.whl (1.9 MB view details)

Uploaded CPython 3.9macOS 14.0+ ARM64

File details

Details for the file pyvgx-3.6.0-cp314-cp314-win_amd64.whl.

File metadata

  • Download URL: pyvgx-3.6.0-cp314-cp314-win_amd64.whl
  • Upload date:
  • Size: 2.7 MB
  • Tags: CPython 3.14, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.9

File hashes

Hashes for pyvgx-3.6.0-cp314-cp314-win_amd64.whl
Algorithm Hash digest
SHA256 2ff482b751b87ea9e0b54e106366c5ef47fa2d284d7acd0fbf9d73f99983be0c
MD5 381ec52459e2ae277fa2e4674bf351f4
BLAKE2b-256 461c15d2f7c38ae8f84e3ed1b434b5541bebd8030243f29990da5d538e391dfd

See more details on using hashes here.

File details

Details for the file pyvgx-3.6.0-cp314-cp314-manylinux_2_34_x86_64.whl.

File metadata

File hashes

Hashes for pyvgx-3.6.0-cp314-cp314-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 1ed76e4895a240b5d1a3ca675851eebee90ea7faae2b0f215f89106475624722
MD5 cd7f20e4f6d1fb3ad4f8e9bceb4498ed
BLAKE2b-256 a95df9dc0ea2c9b57e464e0413c854a1e9f57d7f147eeb19b0fce47eca8cfdd5

See more details on using hashes here.

File details

Details for the file pyvgx-3.6.0-cp314-cp314-macosx_14_0_arm64.whl.

File metadata

File hashes

Hashes for pyvgx-3.6.0-cp314-cp314-macosx_14_0_arm64.whl
Algorithm Hash digest
SHA256 55aeb860dd4b02e447f971f187b6526750573b1a7509fda75c30d263fa29de54
MD5 4e24221840da2e65caf1d2f2df0a5da2
BLAKE2b-256 32c31c101ee81197d7a63333fdcc583036ae6363591856632a07d687fc253ce4

See more details on using hashes here.

File details

Details for the file pyvgx-3.6.0-cp313-cp313-win_amd64.whl.

File metadata

  • Download URL: pyvgx-3.6.0-cp313-cp313-win_amd64.whl
  • Upload date:
  • Size: 2.7 MB
  • Tags: CPython 3.13, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.9

File hashes

Hashes for pyvgx-3.6.0-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 f3625066934819f447120fde663b4a65d70c68931ca1a1d7f5e662d1d93deb80
MD5 196a893da22fc188ec59e673713e233b
BLAKE2b-256 448ce61a84b5b6933fdc2f36a8abefc1c2ca829f3af5a7dfb7f0b593a6e79801

See more details on using hashes here.

File details

Details for the file pyvgx-3.6.0-cp313-cp313-manylinux_2_34_x86_64.whl.

File metadata

File hashes

Hashes for pyvgx-3.6.0-cp313-cp313-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 661897bfa7b931b7baeb9b3183143875a346fb56dfebf5824e21a42382c91c00
MD5 294849b9c0f19ff45ff8ab013aeea560
BLAKE2b-256 3a1a8fb678f02ca722b3a831c0de2329d5394390bf76a486097dda04a75098f9

See more details on using hashes here.

File details

Details for the file pyvgx-3.6.0-cp313-cp313-macosx_14_0_arm64.whl.

File metadata

File hashes

Hashes for pyvgx-3.6.0-cp313-cp313-macosx_14_0_arm64.whl
Algorithm Hash digest
SHA256 d9a618ee36fb99e6d8a2bac08f4acb330e0d3bebc1463d36aa7a05abcef67759
MD5 5f3f55f6f8259d9267b861153af7b5f0
BLAKE2b-256 7478dbef3e0e816be271399eb91f901123922217c59a4a9baf5ddcf3b9226e85

See more details on using hashes here.

File details

Details for the file pyvgx-3.6.0-cp312-cp312-win_amd64.whl.

File metadata

  • Download URL: pyvgx-3.6.0-cp312-cp312-win_amd64.whl
  • Upload date:
  • Size: 2.7 MB
  • Tags: CPython 3.12, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.9

File hashes

Hashes for pyvgx-3.6.0-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 496b8e3f66abcb75b5f9b9a9fde5240d2eec945006c745d0c78dcef6a8763ef5
MD5 56f5b5de9650d5015000a3c3100d0a0f
BLAKE2b-256 6adb2e04684c81fe2650e93e7fafc06532e1bf404dea7e1b20f90bbefe26eed0

See more details on using hashes here.

File details

Details for the file pyvgx-3.6.0-cp312-cp312-manylinux_2_34_x86_64.whl.

File metadata

File hashes

Hashes for pyvgx-3.6.0-cp312-cp312-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 d434a171eed185eecee64cff1092fc5fd581e29b4f4dc10117c1a965cb4da234
MD5 68351cce070db22aaa9895ba64fbea7e
BLAKE2b-256 d6b75a4089427c2223707519f32389ac4e45b8d8506ae95547fc3f1d44811be3

See more details on using hashes here.

File details

Details for the file pyvgx-3.6.0-cp312-cp312-macosx_14_0_arm64.whl.

File metadata

File hashes

Hashes for pyvgx-3.6.0-cp312-cp312-macosx_14_0_arm64.whl
Algorithm Hash digest
SHA256 3a244946f4ddccefe5065e3a4d8005c0ab2544c613990bc4aa22779032708df3
MD5 88b87032d5bb79c06ed8975ddd51f7b7
BLAKE2b-256 df97e9694f7f1195733bd8bd2ef6fb5111a29d20a90138c5cf476e6581a8ab75

See more details on using hashes here.

File details

Details for the file pyvgx-3.6.0-cp311-cp311-win_amd64.whl.

File metadata

  • Download URL: pyvgx-3.6.0-cp311-cp311-win_amd64.whl
  • Upload date:
  • Size: 2.7 MB
  • Tags: CPython 3.11, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.9

File hashes

Hashes for pyvgx-3.6.0-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 4bb4e2c03f76a7b52adc04bacad17a35a910bba5e9ff5041d36a78d7d8c888e5
MD5 2aabf2435f546793a49f7e4ce4047d15
BLAKE2b-256 6f0ece8f48f7232eaee2ffe3a55ac0f4162842bf523726997a4d6bacb663bd75

See more details on using hashes here.

File details

Details for the file pyvgx-3.6.0-cp311-cp311-manylinux_2_34_x86_64.whl.

File metadata

File hashes

Hashes for pyvgx-3.6.0-cp311-cp311-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 226faeb10c48651b53da592fa4023a22dc2b41ef0bd43d9237e7ce38439b0be6
MD5 0216f30d89be3810c695f03513ca1261
BLAKE2b-256 b59920af21970f31b5aef0fdd084c4553ddee917ebaef1d64bc980e2025cf9c2

See more details on using hashes here.

File details

Details for the file pyvgx-3.6.0-cp311-cp311-macosx_14_0_arm64.whl.

File metadata

File hashes

Hashes for pyvgx-3.6.0-cp311-cp311-macosx_14_0_arm64.whl
Algorithm Hash digest
SHA256 e79a60f24bd26c094b0694066126d1077e149a1a1142ae1d9def7b344d4d3850
MD5 6d691021730683e804b0ebe2be46f82b
BLAKE2b-256 5c7a19faf0e3dc0848790eef797120c235ce1ca68312dd1766707b6858ddabca

See more details on using hashes here.

File details

Details for the file pyvgx-3.6.0-cp310-cp310-win_amd64.whl.

File metadata

  • Download URL: pyvgx-3.6.0-cp310-cp310-win_amd64.whl
  • Upload date:
  • Size: 2.7 MB
  • Tags: CPython 3.10, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.9

File hashes

Hashes for pyvgx-3.6.0-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 7748f7ae15b3f0134d1206f88adc540769624fdcd00706c022a5361db2af6e81
MD5 87b5c4597f4eeb0a172193e4b9375dfb
BLAKE2b-256 d6c636665e89a077edd655c87fc368d4b5c3ce7c61f93d36d4b36e277a375244

See more details on using hashes here.

File details

Details for the file pyvgx-3.6.0-cp310-cp310-manylinux_2_34_x86_64.whl.

File metadata

File hashes

Hashes for pyvgx-3.6.0-cp310-cp310-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 96f9d34ecc56194f23be21b82bd489cb9acbc9747c1487fcc1780e633fd9b97c
MD5 4ff02a86ef40105ad312406c3b1af909
BLAKE2b-256 e9db875b7809fd2d3846eda6d3eb39b63b496e53f7da472ae6623ab43a1d89c4

See more details on using hashes here.

File details

Details for the file pyvgx-3.6.0-cp310-cp310-macosx_14_0_arm64.whl.

File metadata

File hashes

Hashes for pyvgx-3.6.0-cp310-cp310-macosx_14_0_arm64.whl
Algorithm Hash digest
SHA256 08791f60cade08efad73d9d170d41a8c4b94d6f408cec2af71a78d4b0c4cfc8b
MD5 55fa1599da164fc34c47678cced61472
BLAKE2b-256 c0f8bd75a74de7af9e7100528ad291a56ccae6da5e804f8b78f362ae802b1c12

See more details on using hashes here.

File details

Details for the file pyvgx-3.6.0-cp39-cp39-win_amd64.whl.

File metadata

  • Download URL: pyvgx-3.6.0-cp39-cp39-win_amd64.whl
  • Upload date:
  • Size: 2.7 MB
  • Tags: CPython 3.9, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.9

File hashes

Hashes for pyvgx-3.6.0-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 0259bab3938c6fb07473a425793629479d812e797e334df40fafeafc13848e73
MD5 7e0754ee4eb1ae2aa3c277431202d4ae
BLAKE2b-256 cb82c0b68ac5e837fda3fabf7f2e8ae089602ec221e5862fa1d4a27f42592f7e

See more details on using hashes here.

File details

Details for the file pyvgx-3.6.0-cp39-cp39-manylinux_2_34_x86_64.whl.

File metadata

File hashes

Hashes for pyvgx-3.6.0-cp39-cp39-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 0fab10e7b8f79c3e5968a97b6dfe82c5035ad46c551bfedc1ac3ca15234e03a3
MD5 b61b412fa858f583c14d0ef3fd2d607d
BLAKE2b-256 7449728104ea47a37112271ccf0d30a2c7698881799c6a13364c3c5fcf35f2ac

See more details on using hashes here.

File details

Details for the file pyvgx-3.6.0-cp39-cp39-macosx_14_0_arm64.whl.

File metadata

File hashes

Hashes for pyvgx-3.6.0-cp39-cp39-macosx_14_0_arm64.whl
Algorithm Hash digest
SHA256 6ec06b17f2886113c1574825f982c37d167a83e87ec72aae5228b0eae4d81d92
MD5 46a53ce868a2cd4705de1723a454619c
BLAKE2b-256 4ef491da060f82058b87380038ab66cc20e5f28d4e2ed3fdb42714a76dfb1b64

See more details on using hashes here.

Supported by

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