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.2.tar.gz (6.9 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.2.tar.gz.

File metadata

File hashes

Hashes for llama_index_graph_stores_coordinode-0.4.2.tar.gz
Algorithm Hash digest
SHA256 bd296d7736aef65df88d716e7dca0ffac2668e0dda736be2e6469b05101277d7
MD5 fc4904779244d8bdfe2a4378dfa221ef
BLAKE2b-256 f090ad41710528f582a0dfacb2aad96f2a894023ce0894bc002a7fe291dabab1

See more details on using hashes here.

Provenance

The following attestation bundles were made for llama_index_graph_stores_coordinode-0.4.2.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.2-py3-none-any.whl.

File metadata

File hashes

Hashes for llama_index_graph_stores_coordinode-0.4.2-py3-none-any.whl
Algorithm Hash digest
SHA256 ad3f4435af79473886ef5ddbf5118042071af9a99e0457ccc9d3dda63e18faad
MD5 636260be86bf56ca24b7f29b18117177
BLAKE2b-256 8bde8cbfc31e0d3c7ede985162cdf0bd733a2acf40f1f3d421a9bd9fc80c6d93

See more details on using hashes here.

Provenance

The following attestation bundles were made for llama_index_graph_stores_coordinode-0.4.2-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