Skip to main content

dbx-tools-graphiti

Run Graphiti REST, MCP, model routing, and PostgreSQL-backed graph memory from one Python runtime. Use embedded PostgreSQL for local persistence or connect to an external PostgreSQL or Lakebase database.

Start the server

uv add 'dbx-tools-graphiti[dev]'
GRAPHITI_LISTEN=tcp://127.0.0.1:8000 \
uv run python -m dbx_tools.graphiti

The application exposes:

  • FastAPI documentation at /docs.
  • OpenAPI at /openapi.json.
  • Health, search, and ingestion routes, including /healthcheck and /search.
  • Direct tool operations under /tools/*.
  • Streamable HTTP MCP at /mcp/.

The direct HTTP and MCP operations share the same operation definitions. OpenAPI includes field-level argument descriptions for AppKit tool registration.

From this repository, start the local runtime with an explicit configured profile:

cd packages/py/graphiti
DATABRICKS_CONFIG_PROFILE=<profile> \
uv run --extra dev python -m dbx_tools.graphiti

Print the OpenAPI document

Generate the OpenAPI JSON without starting PostgreSQL or model clients:

python -m dbx_tools.graphiti docs

The command writes the document to standard output and exits.

Configure Graphiti

The Python server and Node supervisor use the same environment contract:

Setting Default Purpose
DATABRICKS_CONFIG_PROFILE Python SDK default credentials Selects a Databricks CLI profile.
MODEL_CLASS chat-fast Selects the chat model capability class.
TEMPERATURE 1 Sets the Graphiti LLM sampling temperature from 0 through 2.
LLM_STRUCTURED_OUTPUT_MODE json_object Selects the structured-output mode passed to Graphiti.
GRAPHITI_LISTEN tcp://127.0.0.1:7272 Sets the HTTP listener.
GRAPHITI_TOKEN Unset Requires one bearer token for every Graphiti HTTP endpoint.
GRAPHITI_HOME Platform data directory Sets the embedded runtime data directory.
DATABASE_URL or LAKEBASE_ENDPOINT Unset Selects external PostgreSQL or Lakebase. Omit both for embedded PostgreSQL.
GRAPHITI_DATABASE_SCHEMA dbx_tools_graphiti Selects the PostgreSQL schema for graph tables.
DBX_TOOLS_GRAPHITI_STARTUP_TIMEOUT_MS 180000 Limits startup time for Node-supervised processes.

PostgreSQL settings such as PGHOST, PGPORT, PGDATABASE, PGUSER, and PGSSLMODE follow the shared dbx-tools Postgres option schema.

Understand model selection

The process creates one auth client and one model client at startup. It selects the chat endpoint by modelClass and independently selects the highest-ranked embedding endpoint. REST and MCP reuse the same model clients. The auth client adds refreshed Databricks headers to each model request.

Graphiti reads embedding dimensions from discovered endpoint metadata before it initializes PostGraph. Startup fails when the selected endpoint doesn't publish a positive dimension. There is no model-name or dimension fallback.

Use Graphiti from Python

Use the importable runtime without starting Uvicorn:

from dbx_tools.graphiti.runtime import GraphitiRuntime

async with GraphitiRuntime.from_options(
    {"profile": "MY-PROFILE", "modelClass": "chat-fast"}
) as runtime:
    graphiti = runtime.graphiti

In a Databricks notebook or Lakeflow Job, omitted auth options use the Python SDK's default WorkspaceClient. Pass profile only when you need to select an explicit Databricks CLI profile.

Graphiti depends on dbx-tools-node-runtime. A normal pip installation works on Databricks serverless compute without system Node.js or npm:

%pip install dbx-tools-graphiti

The shared runtime uses system npm when available. Otherwise, its first binding load installs a compatible nodejs-wheel and PythonMonkey into the active Python environment.

Choose database persistence

Install the optional embedded runtime when you don't provide databaseUrl:

uv add 'dbx-tools-graphiti[dev]'

Embedded mode starts PostgreSQL with pgvector and persists data under GRAPHITI_HOME or the platform data directory. The PostgreSQL process stops with the runtime. Its data remains for the next start.

Pass a PostgreSQL URL to use an existing database. A passwordless non-local URL, Lakebase resource path, or Lakebase project name is resolved by the generated Lakebase client. It adds a short-lived credential when asyncpg opens a physical connection without persisting that credential in the URL.

Lakebase mode uses GRAPHITI_DATABASE_SCHEMA, which defaults to dbx_tools_graphiti, because application identities normally can't write to public. If no vector extension exists, Graphiti installs it in that schema. If the database has an existing vector installation, Graphiti uses that extension schema for type resolution.

Wait for memory writes

The direct HTTP and MCP add_memory operation queues a write and returns immediately. Call wait_for_memory_queue before stopping a short-lived runtime when queued work must be durable. Queue processing errors are logged with their tracebacks and raised by the wait operation.

Use add_memory_sync when the request must wait for persistence. get_queue_status reports the pending count and worker state.

When you create an episode, omit uuid and use the generated UUID for later retrieval. A supplied uuid selects an existing episode to update.

Understand operational limits

  • Embedded PostgreSQL requires the dev extra. Without an external database or that extra, startup fails.
  • External PostgreSQL must support the vector extension. The runtime installs it only when the connected identity has permission.
  • Queued add_memory calls can outlive the request that submitted them. Use add_memory_sync or wait_for_memory_queue before shutdown when required.
  • GRAPHITI_TOKEN is one shared HTTP bearer token. It doesn't replace Databricks model authentication or provide per-user authorization.
  • Set GRAPHITI_TOKEN before you expose GRAPHITI_LISTEN on a non-loopback interface.
  • Model and embedding discovery happens at startup. A model endpoint change requires a runtime restart before selection runs again.

Metadata

Release files for dbx-tools-graphiti 0.9.134

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for dbx-tools-graphiti 0.9.134
File Size Uploaded
dbx_tools_graphiti-0.9.134.tar.gz 637.6 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for dbx-tools-graphiti 0.9.134
File Interpreter ABI Platform
dbx_tools_graphiti-0.9.134-py3-none-any.whl Python 3 none any Details

Total release size: 1.3 MB

Release files / dbx_tools_graphiti-0.9.134.tar.gz

Download URL dbx_tools_graphiti-0.9.134.tar.gz
Size 637.6 kB
Tags Source
SHA-256 checksum
How to use checksums
3f5cf39a0ae0b9967fcb30c6a3e83cb20586858d661b8e200a2025e14ee6f29d
BLAKE2b-256 checksum
How to use checksums
21383d6c8043b0623dc4560d72266378e20c80bfc2ada824dcdd981fef6d4e64
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 15, 2026.

Transparency log

Release files / dbx_tools_graphiti-0.9.134-py3-none-any.whl

Download URL dbx_tools_graphiti-0.9.134-py3-none-any.whl
Size 671.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
4e4822e0e615988ddb72bdf8a446d9a7fc60d59a354153c61ab0cbc5c843894c
BLAKE2b-256 checksum
How to use checksums
6b31e71577158aeb21c892569ee6277181026c4c1c967416a2a88eb19372798e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 15, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.9.134 This release

2 release files

0.9.99

2 release files

0.9.9

2 release files

0.9.8

2 release files

0.9.7

2 release files

0.9.6

2 release files

0.9.5

2 release files

0.9.4

2 release files

0.9.3

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page