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.3.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.3.tar.gz.

File metadata

File hashes

Hashes for llama_index_graph_stores_coordinode-0.4.3.tar.gz
Algorithm Hash digest
SHA256 4ca20440f462305eae3a81e8203ca2ddbebcd40373c0103bfda2249b675dbefb
MD5 054b68e6917a8ad223ba801e56f0738c
BLAKE2b-256 a52881c96f6cd936519c92869b466614a2b914c228213ec3b46b0ad74b1c2b38

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for llama_index_graph_stores_coordinode-0.4.3-py3-none-any.whl
Algorithm Hash digest
SHA256 9044d9f5c0ac81bdfdb90dbd52aafe3dcf08cc09d83d1dc3b060606a40a011d3
MD5 8af035c8f885b13bbfeb08c16a0c2fc2
BLAKE2b-256 1d98d33823be5a5d60d332d1ff557fbc4f3ef3dbfefec45512e32ccf1d64381e

See more details on using hashes here.

Provenance

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