PyVGX - Vector Graph Index Python Extensions
Project description
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.12 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:
Allow startup to finish and then try to send a query to the dispatcher running on port 9990:
# Run a test query, returns JSON search result
curl -s http://127.0.0.1:9990/vgx/plugin/search?name=7357 | 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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distributions
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pyvgx-3.6.0a2-cp314-cp314-win_amd64.whl.
File metadata
- Download URL: pyvgx-3.6.0a2-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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
25001a52171d3d992a6803823309c3d3e60d2ee28ab16affad20b73142e5afb2
|
|
| MD5 |
5ada0f08e05478eec85186b807cc020c
|
|
| BLAKE2b-256 |
02ca798023ce7208ef19351875b94c03f3a0afed7045d281246630cfea38671c
|
File details
Details for the file pyvgx-3.6.0a2-cp314-cp314-manylinux_2_34_x86_64.whl.
File metadata
- Download URL: pyvgx-3.6.0a2-cp314-cp314-manylinux_2_34_x86_64.whl
- Upload date:
- Size: 3.0 MB
- Tags: CPython 3.14, manylinux: glibc 2.34+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5ed7aa588d6117e6f406307a0bd5914a0d9c324915d63a6adf0eb9dea9d5d7e1
|
|
| MD5 |
e3abac5c7244c614a22162c0f415228e
|
|
| BLAKE2b-256 |
295dcd5d239b1daa34d1a66f653242dafede7271a33570a2883554665b26e3dc
|
File details
Details for the file pyvgx-3.6.0a2-cp314-cp314-macosx_14_0_arm64.whl.
File metadata
- Download URL: pyvgx-3.6.0a2-cp314-cp314-macosx_14_0_arm64.whl
- Upload date:
- Size: 1.9 MB
- Tags: CPython 3.14, macOS 14.0+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b0d0fcbd9938b8cab745aaffb354ef16c0a7f1190713ebfcc789aa846126f62a
|
|
| MD5 |
6c14ed286c7c62b2ecc87f1de28c97e2
|
|
| BLAKE2b-256 |
839eaa2c68260601d15eb0cc96d20e0adae7bd38be23c3f66379ba7891303f43
|
File details
Details for the file pyvgx-3.6.0a2-cp313-cp313-win_amd64.whl.
File metadata
- Download URL: pyvgx-3.6.0a2-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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
bf4c1f74867a1444812dcb35301031925584963e6379043e00ffab00ed39b4fb
|
|
| MD5 |
08f27208f2b54e6fc12e8d68f205bcae
|
|
| BLAKE2b-256 |
f8725b61d99181e0b16d3bf3043d0db9f4c37bdeb12515bc883bbfc56bee5479
|
File details
Details for the file pyvgx-3.6.0a2-cp313-cp313-manylinux_2_34_x86_64.whl.
File metadata
- Download URL: pyvgx-3.6.0a2-cp313-cp313-manylinux_2_34_x86_64.whl
- Upload date:
- Size: 3.0 MB
- Tags: CPython 3.13, manylinux: glibc 2.34+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
57d74a6ddb05be72aa21397453034013d5bd63ebb04068d47245d04f9df0b4d6
|
|
| MD5 |
509545689fa5ab1a66fa67a34081d920
|
|
| BLAKE2b-256 |
854804f76061c92f92a49eea5b8fe2889236a7670632b7279c1fa1e6a8786b73
|
File details
Details for the file pyvgx-3.6.0a2-cp313-cp313-macosx_14_0_arm64.whl.
File metadata
- Download URL: pyvgx-3.6.0a2-cp313-cp313-macosx_14_0_arm64.whl
- Upload date:
- Size: 1.9 MB
- Tags: CPython 3.13, macOS 14.0+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b70118a3e93486114ed66210e51b5b14e9a2ab30a97500eb91742a450e1d533b
|
|
| MD5 |
d794c33251946b1569a292d5c39b8fd9
|
|
| BLAKE2b-256 |
9984bd1bfa719401d461dd041013363f5500b73c95979505aa08638401d1e24f
|
File details
Details for the file pyvgx-3.6.0a2-cp312-cp312-win_amd64.whl.
File metadata
- Download URL: pyvgx-3.6.0a2-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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
18596d6d7463657707329dd2b0e1446619261f6567de825121c8fd0a5369851f
|
|
| MD5 |
67ebf6bd6d93bf22ff73909eeba41801
|
|
| BLAKE2b-256 |
10ea219d80b9d3aced5995fe2ce42dacb1151d3dbcc2c21d8d6be9f421fe2034
|
File details
Details for the file pyvgx-3.6.0a2-cp312-cp312-manylinux_2_34_x86_64.whl.
File metadata
- Download URL: pyvgx-3.6.0a2-cp312-cp312-manylinux_2_34_x86_64.whl
- Upload date:
- Size: 3.0 MB
- Tags: CPython 3.12, manylinux: glibc 2.34+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3183178cbc0cbbe3b96c234fbf488de72ec044c169cfea9bcb725cb8f59e46f1
|
|
| MD5 |
565648de451419c77180cec904e171ff
|
|
| BLAKE2b-256 |
6c149cc07254c4025714c0c3363bb3578d66b15e94adee9f108ea74646a995d9
|
File details
Details for the file pyvgx-3.6.0a2-cp312-cp312-macosx_14_0_arm64.whl.
File metadata
- Download URL: pyvgx-3.6.0a2-cp312-cp312-macosx_14_0_arm64.whl
- Upload date:
- Size: 1.9 MB
- Tags: CPython 3.12, macOS 14.0+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7e41b827f179131507d947cf1c1e8fe6f041de4ae8270ff7edc3b57cb1f06a59
|
|
| MD5 |
2d6bcd576880099323a5439299bf7882
|
|
| BLAKE2b-256 |
9ecd411b4e220b2abb77dcd7ad685b0383bfef13df35587db06b600cdf40a54a
|
File details
Details for the file pyvgx-3.6.0a2-cp311-cp311-win_amd64.whl.
File metadata
- Download URL: pyvgx-3.6.0a2-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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
35a50e137fc8c0402b4697fceaa49e76f993067c5efd51dceb11a1173c6726ee
|
|
| MD5 |
ab79b6a5faebec1c76612faa4b8eebe6
|
|
| BLAKE2b-256 |
c9837a212c044abf2f173402c9f58dfc9c45b21be2a682c28b8a3a03276ef6fc
|
File details
Details for the file pyvgx-3.6.0a2-cp311-cp311-manylinux_2_34_x86_64.whl.
File metadata
- Download URL: pyvgx-3.6.0a2-cp311-cp311-manylinux_2_34_x86_64.whl
- Upload date:
- Size: 3.0 MB
- Tags: CPython 3.11, manylinux: glibc 2.34+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
fa6e3efe7130884b96d5a8b3e2950e87692e4846850ef1aace91f4d94acb9897
|
|
| MD5 |
7320d7c7a4e0b6bd43a9031191b1e0e8
|
|
| BLAKE2b-256 |
c11153f480696bbb33838e3a1298f5dba170b8cd4177f2f02a0ad8666124c80f
|
File details
Details for the file pyvgx-3.6.0a2-cp311-cp311-macosx_14_0_arm64.whl.
File metadata
- Download URL: pyvgx-3.6.0a2-cp311-cp311-macosx_14_0_arm64.whl
- Upload date:
- Size: 1.9 MB
- Tags: CPython 3.11, macOS 14.0+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a8601e20543c104c7c891d81149754d8e7698b88e982c257427aa0e6d752c7b4
|
|
| MD5 |
1d00f96e18c170939c5c0f598f130836
|
|
| BLAKE2b-256 |
925da8753e22b3f884fb6ac382579b8655c4c475562ee2c1e1e79180c171d297
|
File details
Details for the file pyvgx-3.6.0a2-cp310-cp310-win_amd64.whl.
File metadata
- Download URL: pyvgx-3.6.0a2-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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
faf492b61ea6e444b67d5d345696850ca41e81f26671a49dbf5245c9a5856633
|
|
| MD5 |
5fef4e18d2b1e54e82d7ab001ff6db43
|
|
| BLAKE2b-256 |
309def688137c6b800ab7fefa10b18d5817845040f20122dab5c901684810ff7
|
File details
Details for the file pyvgx-3.6.0a2-cp310-cp310-manylinux_2_34_x86_64.whl.
File metadata
- Download URL: pyvgx-3.6.0a2-cp310-cp310-manylinux_2_34_x86_64.whl
- Upload date:
- Size: 3.0 MB
- Tags: CPython 3.10, manylinux: glibc 2.34+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
601817ad781e217b46213fe12b21ba76ff49a9dc1ac936320ea6e8863ee5f206
|
|
| MD5 |
f1da3126ddb535c810d6965ff177e53d
|
|
| BLAKE2b-256 |
cf0c813cb649d17046508a1cd41f6cdebbf75044ae23e6350390187c913ad481
|
File details
Details for the file pyvgx-3.6.0a2-cp310-cp310-macosx_14_0_arm64.whl.
File metadata
- Download URL: pyvgx-3.6.0a2-cp310-cp310-macosx_14_0_arm64.whl
- Upload date:
- Size: 1.9 MB
- Tags: CPython 3.10, macOS 14.0+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
27b83cf247e605bf376753b0b50a9201260180f5e44402ec7ce78caff3b68271
|
|
| MD5 |
c25e23ffb75bc03924c3b762e1d9b494
|
|
| BLAKE2b-256 |
e2fdf3aea76e80159a937e91f56dbea3cbca8bc74d15b1091ddb20012b32e18e
|
File details
Details for the file pyvgx-3.6.0a2-cp39-cp39-win_amd64.whl.
File metadata
- Download URL: pyvgx-3.6.0a2-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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
29a21b97e91b32a391fc5076c3e2300c942732eeca36e8f1fd0b87ad023ee93f
|
|
| MD5 |
8d88bfbcc0bdcfc7893b3c7eb5f6d342
|
|
| BLAKE2b-256 |
fd39c42a74f80b60499cd667e241c8c6614044151e53cf6558a34c9bd1d0f928
|
File details
Details for the file pyvgx-3.6.0a2-cp39-cp39-manylinux_2_34_x86_64.whl.
File metadata
- Download URL: pyvgx-3.6.0a2-cp39-cp39-manylinux_2_34_x86_64.whl
- Upload date:
- Size: 3.0 MB
- Tags: CPython 3.9, manylinux: glibc 2.34+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9cb4555ee2ee501ee8dd09837ed706c8ab9552b4a1bfd2f28d6b55ad876e2f20
|
|
| MD5 |
acbc0b5cca8613a8498fa4576fe4e6e2
|
|
| BLAKE2b-256 |
3a9a4c1902cf41d412565288a211310a0c994bf6855bf5081c3cf136d9d4951d
|
File details
Details for the file pyvgx-3.6.0a2-cp39-cp39-macosx_14_0_arm64.whl.
File metadata
- Download URL: pyvgx-3.6.0a2-cp39-cp39-macosx_14_0_arm64.whl
- Upload date:
- Size: 1.9 MB
- Tags: CPython 3.9, macOS 14.0+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c97307689a1ddc0cdd0af39720b152169343d9c53daaf9b3890917f38fa79737
|
|
| MD5 |
3e9b43fa8c5798c0f3d8257345ec0baf
|
|
| BLAKE2b-256 |
3b5607136e4300ab70f5271273fea030f4fb66ee0226a10a755636a085bcb038
|