Skip to main content

cognee-community-graph-adapter-turbopuffer

A community graph database adapter for cognee backed by TurboPuffer.

TurboPuffer is a vector/document store with no native graph traversal or query language, so this adapter emulates a graph on two TurboPuffer namespaces per dataset — exactly as the core Postgres graph adapter emulates one on relational tables. All traversal is done client-side with single-hop edge queries.

Storage model

Per dataset, namespace-prefixed by database_name:

  • {database_name}_graph_node — one doc per node: id, name, type (the DataPoint class name), belongs_to_set (string[]), and a non-filterable properties JSON blob holding all remaining fields (so large text is kept in full).
  • {database_name}_graph_edge — one doc per edge: a deterministic uuid5 id (TurboPuffer caps ids at 64 bytes), source_id, target_id, relationship_name, denormalized endpoint identity (source_name/source_type/target_name/target_type), and the full edge properties JSON blob.

Install

uv pip install -e cognee-community/packages/graph/turbopuffer
# or, from the package directory:
uv pip install -e .

Configure & use

import cognee
from cognee_community_graph_adapter_turbopuffer import register

register()  # registers the "turbopuffer" graph provider + dataset handler
cognee.config.set_graph_database_provider("turbopuffer")

# Environment:
#   TURBOPUFFER_API_KEY   (required)
#   TURBOPUFFER_REGION    (required by the SDK; e.g. gcp-us-central1)

await cognee.add("Alice followed the White Rabbit.")
await cognee.cognify()
results = await cognee.search("Who does Alice meet?")

For multi-tenant backend access control, also select the graph dataset handler:

GRAPH_DATABASE_PROVIDER=turbopuffer
GRAPH_DATASET_DATABASE_HANDLER=turbopuffer_graph

(The handler is registered under turbopuffer_graph so it does not collide with the TurboPuffer vector adapter's turbopuffer handler.)

Supported vs. not (v1)

Supported: CRUD, single-hop reads (get_neighbors, get_connections, get_edges), get_neighborhood(depth=1), get_graph_data, get_filtered_graph_data, get_nodeset_subgraph (OR + client-side AND), get_graph_metrics (counts + mean degree), get_triplets_batch (offset pagination via deterministic cursor scan), remove_belongs_to_set_tags, delete_graph, per-dataset isolation.

Not in v1: multi-hop BFS (get_neighborhood(depth>=2)) and raw Cypher (query) raise NotImplementedError. Connectivity-dependent metrics (connected components, diameter, clustering) return the -1 sentinel, matching the Postgres adapter.

Examples & tests

# build the Alice graph and query it
GRAPH_DATABASE_PROVIDER=turbopuffer python examples/example.py
python examples/inspect_graph.py --raw       # inspect node/edge namespaces
python examples/export_graph.py               # dump nodes.json / edges.json

# tests (see tests/README.md for tiers)
./run_tests.sh integration                    # live per-method + isolation
./run_tests.sh e2e                            # full add->cognify->search on Alice

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

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

File details

Details for the file cognee_community_graph_adapter_turbopuffer-0.2.0.tar.gz.

File metadata

File hashes

Hashes for cognee_community_graph_adapter_turbopuffer-0.2.0.tar.gz
Algorithm Hash digest
SHA256 e2b86d68d8b0abe6045f7f52bef0710689be33da9b723edaf4030dfeee704a04
MD5 2a5f2c90890820295f64cba84d7bca5e
BLAKE2b-256 78d2886b31e91d6b0df16adc3eb6c4247e00a5e59a8e664d9bdbf677fa5149d7

See more details on using hashes here.

File details

Details for the file cognee_community_graph_adapter_turbopuffer-0.2.0-py3-none-any.whl.

File metadata

File hashes

Hashes for cognee_community_graph_adapter_turbopuffer-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 c4ef8335580d6ede6ad8fcd88f1d830c6569edb952208a829491b442edc350a0
MD5 5c3daaaa4b096d054cd1322219e5ecd4
BLAKE2b-256 b44b6e5acd21a3522cd02901cf87a65d8515f75acac8855b07d2ae094ee9d1df

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

0.2.0 This release

2 files

0.1.0

2 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