Skip to main content

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

  1. Install: pipx install . (or pip install . in a venv)
  2. Bring up services: vectorgraph up (Docker compose stack with graph/vector)
  3. Run tests: pytest -q
  4. Tinker in Python (see below) or run vectorgraph demo then python demo.py.

Install options:

  • pipx install . (recommended for CLI) or pip 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-friendly get_embedding function.
  • 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/ — packaged docker-compose.yml, Dockerfile, schema.sql used by the CLI.

Environment

Defaults are baked into the stack; you normally don’t need to touch .env. If a .env exists in your project root, vectorgraph up will copy it into its cache and use it; otherwise it uses the packaged defaults. The embedding container sits on a private Docker network (no host port) and is reachable from Postgres at http://embeddings:80.

Typical flow

  • vectorgraph up
  • run Python code using the helpers (or vectorgraph demo then python demo.py)
  • pytest -q to sanity check
  • vectorgraph down when done

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


Download files

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

Source Distribution

vectorgraph-0.1.1.tar.gz (18.5 kB view details)

Uploaded Source

Built Distribution

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

vectorgraph-0.1.1-py3-none-any.whl (17.0 kB view details)

Uploaded Python 3

File details

Details for the file vectorgraph-0.1.1.tar.gz.

File metadata

  • Download URL: vectorgraph-0.1.1.tar.gz
  • Upload date:
  • Size: 18.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.9

File hashes

Hashes for vectorgraph-0.1.1.tar.gz
Algorithm Hash digest
SHA256 fea0d1b4d63d0783b33cc6697f46aecd9fe80652ef88fbfb50b4ac3ce8d2b348
MD5 4e15ebbe0223d99e56161d4608394e82
BLAKE2b-256 9702866d1b8f6586294fbeebc0c31844f1f0a06e261a92855150e73957aff1fa

See more details on using hashes here.

File details

Details for the file vectorgraph-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: vectorgraph-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 17.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.9

File hashes

Hashes for vectorgraph-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 ea880e96abdc3119038ec231b2f83a56ce658e0fdbdb3415f4e03e41afacff0a
MD5 43781f0c799a670c33e04033d119d054
BLAKE2b-256 f4bb3db07cdfa335e2fe3ffd82ca393c510551d491c1d1f7f6fabda92ff3e9e1

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