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

File metadata

File hashes

Hashes for llama_index_graph_stores_coordinode-0.4.0.tar.gz
Algorithm Hash digest
SHA256 a4ae74d9db66934a6f64a58b229b282068a0855924517cba4cc724a2757e491e
MD5 2a6c0f79a8fceb9059f19013999267fa
BLAKE2b-256 d4b62687ef69c61ffed6838ac161ff71c06b757f4e9ed020a24b7f3f670c22f0

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for llama_index_graph_stores_coordinode-0.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 09c6ac77868a720879ce4b11f1e158551c37ed052c6a727eb527f5bd6f907365
MD5 73abb7683d5dda8ed81578085cd23081
BLAKE2b-256 9abc816dce551cf8a448cd05a7fa4e113851553255c58fce4a3807434f7a2053

See more details on using hashes here.

Provenance

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