Minimal Postgres stack combining Apache AGE graph + pgvector with simple async helpers.
Project description
QuixiAI VectorGraph
A minimal, batteries-included PostgreSQL stack that pairs Apache AGE (graph) with pgvector. Spin it up with Docker, hit a couple of Python helpers, and you have graph + vector storage in one place.
60-second start
- Copy env:
cp .env.example .env - Bring up services:
vectorgraph up(Docker compose stack with graph/vector) - Run tests:
pytest -q - Tinker in Python (see below), or connect to Postgres on
localhost:5432.
Install options:
pipx install .(recommended for CLI) orpip install .in a venv.- CLI commands:
vectorgraph up,vectorgraph down,vectorgraph logs -f,vectorgraph ps,vectorgraph demo.
Python quickstart
import asyncio
from vectorgraph import create_db, delete_db, graph_create_entity, vector_add, vector_nearest_neighbors
async def main():
db_id = await create_db()
try:
await graph_create_entity(db_id, "n1", "Hello", "Graph+Vector")
await vector_add(db_id, "n1", [0.1]*768, {"label": "hello"})
neighbors = await vector_nearest_neighbors(db_id, [0.1]*768, k=3)
print(neighbors)
finally:
await delete_db(db_id)
asyncio.run(main())
More complete example: python examples/demo.py (creates types/entities/relationships, vectors, queries, and cleans up).
Files
db.py— public async API for graph + vector helpers (AGE + pgvector).graph.py/vector.py— thin wrappers if you prefer to import per-domain.schema.sql— enables extensions and embeds the TEI-friendlyget_embeddingfunction.Dockerfile— Postgres 16 image with AGE, pgvector, pgsql-http.docker-compose.yml— Postgres + HuggingFace TEI (embedding service).tests/— async end-to-end tests for graph and vector paths.pyproject.toml— package metadata (dependencies via pip/uv/pdm) and CLI entrypoint.vectorgraph/stack/— packageddocker-compose.yml,Dockerfile,schema.sqlused by the CLI.
Environment
POSTGRES_* are read by both the Python helpers and the Docker stack. The CLI prefers .env in your current directory; if absent, it will use one in its cache directory (~/.cache/vectorgraph/stack/) if present. The embedding container sits on a private Docker network (no host port) and is reachable from Postgres at http://embeddings:80.
Typical flow
docker compose up -d- run Python code using the helpers
pytest -qto sanity checkdocker compose down -vwhen done (drops volumes)
Notes
- Vectors are fixed at 768-dim; the TEI model (
unsloth/embeddinggemma-300m) matches that. - Each call to
create_db()makes a dedicated AGE graph + vector table keyed by UUID to keep tests isolated.
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 Distribution
Built Distribution
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 vectorgraph-0.1.0.tar.gz.
File metadata
- Download URL: vectorgraph-0.1.0.tar.gz
- Upload date:
- Size: 18.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
20347e8d80ca5db38e547fbeacbd8b96c8c07b6e6f152d6682dcc21e1522df9d
|
|
| MD5 |
a22880d7bd5ee112344024ad3932d9ff
|
|
| BLAKE2b-256 |
179e63848b1154dfc46dcec8c4ecdce8270c30d35eaccead4d7fe08e59e55d56
|
File details
Details for the file vectorgraph-0.1.0-py3-none-any.whl.
File metadata
- Download URL: vectorgraph-0.1.0-py3-none-any.whl
- Upload date:
- Size: 17.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c68f61bf9c75eb0c7e66890fc7dd9821b8547d360f04ba374aa40db91e5486e8
|
|
| MD5 |
0aa64a105618c27ab59d57b4b7d00a88
|
|
| BLAKE2b-256 |
3ba8f7935cdd52c86fc0830d5e59891a3b7fae20852da98ef219d23c114fc48e
|