Skip to main content

LlamaIndex PropertyGraphStore backed by CoordiNode

Project description

llama-index-graph-stores-coordinode

PyPI Python License CI

LlamaIndex PropertyGraphStore backed by CoordiNode — graph + vector + full-text in a single transactional engine.

Installation

pip install llama-index-graph-stores-coordinode
uv add llama-index-graph-stores-coordinode

Requirements

  • Python 3.11+
  • Running CoordiNode instance

Quick Start

PropertyGraphIndex — Build from Documents

from llama_index.core import PropertyGraphIndex, SimpleDirectoryReader
from llama_index.graph_stores.coordinode import CoordinodePropertyGraphStore

# Connect to CoordiNode
store = CoordinodePropertyGraphStore("localhost:7080")

# Build graph index from documents (auto-extracts entities + relationships)
docs = SimpleDirectoryReader("./data").load_data()
index = PropertyGraphIndex.from_documents(
    docs,
    property_graph_store=store,
    show_progress=True,
)

# Query
engine = index.as_query_engine(include_text=True)
response = engine.query("Explain the attention mechanism in transformers")
print(response)

Load Existing Graph

from llama_index.core import PropertyGraphIndex
from llama_index.graph_stores.coordinode import CoordinodePropertyGraphStore

store = CoordinodePropertyGraphStore("localhost:7080")

# Load from existing data in CoordiNode (no re-extraction)
index = PropertyGraphIndex.from_existing(property_graph_store=store)

engine = index.as_query_engine()
response = engine.query("Who are the key researchers in graph neural networks?")

Vector + Keyword Hybrid Retrieval

from llama_index.core import PropertyGraphIndex
from llama_index.core.indices.property_graph import (
    VectorContextRetriever,
    LLMSynonymRetriever,
)
from llama_index.graph_stores.coordinode import CoordinodePropertyGraphStore
from llama_index.embeddings.openai import OpenAIEmbedding

store = CoordinodePropertyGraphStore("localhost:7080")
embed_model = OpenAIEmbedding(model="text-embedding-3-small")

index = PropertyGraphIndex.from_existing(
    property_graph_store=store,
    embed_model=embed_model,
)

# Combine vector similarity + keyword/synonym retrieval
retriever = index.as_retriever(
    sub_retrievers=[
        VectorContextRetriever(index.property_graph_store, embed_model=embed_model),
        LLMSynonymRetriever(index.property_graph_store),
    ]
)
nodes = retriever.retrieve("graph attention networks")

Manual Node and Relation Upsert

from llama_index.core.graph_stores.types import EntityNode, Relation
from llama_index.graph_stores.coordinode import CoordinodePropertyGraphStore

store = CoordinodePropertyGraphStore("localhost:7080")

# Upsert entities
nodes = [
    EntityNode(label="Person", name="Alice", properties={"role": "researcher"}),
    EntityNode(label="Concept", name="GraphRAG", properties={"field": "AI"}),
]
store.upsert_nodes(nodes)

# Upsert relationships
relations = [
    Relation(
        label="RESEARCHES",
        source_id="Alice",
        target_id="GraphRAG",
        properties={"since": 2023},
    )
]
store.upsert_relations(relations)

# Query triplets
triplets = store.get_triplets(entity_names=["Alice"])
for subj, rel, obj in triplets:
    print(f"{subj.name} -[{rel.label}]-> {obj.name}")

Direct Cypher

from llama_index.graph_stores.coordinode import CoordinodePropertyGraphStore

store = CoordinodePropertyGraphStore("localhost:7080")

result = store.structured_query(
    "MATCH (n:Person)-[:KNOWS]->(m) WHERE n.name = $name RETURN m.name AS name",
    param_map={"name": "Alice"},
)

Connection Options

# host:port string
store = CoordinodePropertyGraphStore("localhost:7080")

# TLS
store = CoordinodePropertyGraphStore("db.example.com:7443", tls=True)

# Custom timeout
store = CoordinodePropertyGraphStore("localhost:7080", timeout=60.0)

Capabilities

Feature Supported
Node upsert
Relation upsert
Triplet queries
Relationship map traversal
Schema inspection
Direct Cypher (structured_query)
Vector similarity queries ✅ (returns empty until HNSW index wiring — v0.4)
Async support via AsyncCoordinodeClient

Related Packages

Package Description
coordinode Core gRPC client
langchain-coordinode LangChain GraphStore + GraphCypherQAChain

Links

Support

USDT TRC-20

USDT (TRC-20): TFDsezHa1cBkoeZT5q2T49Wp66K8t2DmdA

GitHub Sponsors · Open Collective

License

Apache-2.0

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

llama_index_graph_stores_coordinode-0.4.1.tar.gz (7.0 kB view details)

Uploaded Source

Built Distribution

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

File details

Details for the file llama_index_graph_stores_coordinode-0.4.1.tar.gz.

File metadata

File hashes

Hashes for llama_index_graph_stores_coordinode-0.4.1.tar.gz
Algorithm Hash digest
SHA256 051b494c02715e9d45eabcb8aaf514226f2d6b3d68420ca8f714843baffd2c23
MD5 a10c0306a9a1e10f92ea425a59359c02
BLAKE2b-256 defdb2e1530717a4e1f94f7940834276594ee9ad2bac69aff2b1b89b86d1cb91

See more details on using hashes here.

Provenance

The following attestation bundles were made for llama_index_graph_stores_coordinode-0.4.1.tar.gz:

Publisher: release.yml on structured-world/coordinode-python

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file llama_index_graph_stores_coordinode-0.4.1-py3-none-any.whl.

File metadata

File hashes

Hashes for llama_index_graph_stores_coordinode-0.4.1-py3-none-any.whl
Algorithm Hash digest
SHA256 7990425b15a95fc521a8cb8e279cb0d128a3ea73f01a367f141aceb8742c5e86
MD5 c5f884f80b625858228fa79a8afd98a3
BLAKE2b-256 0149663a6bfcfb5dbb0ea4ad6001f6b1d4e7cc5c77806d57d6788e98e43c03fe

See more details on using hashes here.

Provenance

The following attestation bundles were made for llama_index_graph_stores_coordinode-0.4.1-py3-none-any.whl:

Publisher: release.yml on structured-world/coordinode-python

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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