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.4.tar.gz (7.7 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.4.tar.gz.

File metadata

File hashes

Hashes for llama_index_graph_stores_coordinode-0.4.4.tar.gz
Algorithm Hash digest
SHA256 9af5405c2aff84723239e2eb2434d33a813f6cd193cec8b7aadd18579b236022
MD5 2777150da04a416ba46e13f31d5ad281
BLAKE2b-256 938cb4cfab6db4a7fc728bc1e7396759568227c18e0027c58edb42180e43925e

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for llama_index_graph_stores_coordinode-0.4.4-py3-none-any.whl
Algorithm Hash digest
SHA256 0747d6ca15845118a774f01eb8439380f2d03ee7457a66eea5dd3f09d9b6337a
MD5 83868136fa1c5b7a4aabe44cbbd9bd5d
BLAKE2b-256 c61a7c2dcf931b50e108e918cd83017e8bbcf47b7a8e0b1766585f96c954998a

See more details on using hashes here.

Provenance

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