LangChain integration for CoordiNode — GraphStore backed by graph + vector + full-text
Project description
langchain-coordinode
LangChain integration for CoordiNode — GraphStore implementation and GraphCypherQAChain support for GraphRAG pipelines.
Installation
pip install langchain-coordinode
uv add langchain-coordinode
Requirements
- Python 3.11+
- Running CoordiNode instance
Quick Start
GraphCypherQAChain — Question Answering over a Knowledge Graph
from langchain_coordinode import CoordinodeGraph
from langchain.chains import GraphCypherQAChain
from langchain_openai import ChatOpenAI
# Connect to CoordiNode
graph = CoordinodeGraph("localhost:7080")
# Build a QA chain that generates and executes Cypher queries
chain = GraphCypherQAChain.from_llm(
ChatOpenAI(model="gpt-4o-mini"),
graph=graph,
verbose=True,
)
result = chain.invoke({"query": "What concepts are related to attention mechanisms?"})
print(result["result"])
Schema Inspection
from langchain_coordinode import CoordinodeGraph
graph = CoordinodeGraph("localhost:7080")
# Refresh schema from database
graph.refresh_schema()
# Schema string used by the LLM to generate Cypher
print(graph.schema)
# Node properties: Person (name: String, age: Integer), Concept (name: String) ...
# Relationships: (Person)-[:KNOWS]->(Person), (Document)-[:ABOUT]->(Concept) ...
Direct Cypher Queries
from langchain_coordinode import CoordinodeGraph
graph = CoordinodeGraph("localhost:7080")
# Returns List[Dict[str, Any]]
result = graph.query(
"MATCH (n:Person)-[:KNOWS]->(m) WHERE n.name = $name RETURN m.name AS colleague",
params={"name": "Alice"},
)
for row in result:
print(row["colleague"])
LLMGraphTransformer — Extract Knowledge from Text
from langchain_community.graphs.graph_document import GraphDocument
from langchain_openai import ChatOpenAI
from langchain_experimental.graph_transformers import LLMGraphTransformer
from langchain_coordinode import CoordinodeGraph
from langchain_core.documents import Document
graph = CoordinodeGraph("localhost:7080")
llm = ChatOpenAI(model="gpt-4o-mini", temperature=0)
transformer = LLMGraphTransformer(llm=llm)
docs = [Document(page_content="Alice knows Bob. Bob works at Acme Corp.")]
graph_docs = transformer.convert_to_graph_documents(docs)
# Store extracted entities and relationships
graph.add_graph_documents(graph_docs)
Connection Options
# host:port string
graph = CoordinodeGraph("localhost:7080")
# TLS
graph = CoordinodeGraph("db.example.com:7443", tls=True)
# Custom timeout
graph = CoordinodeGraph("localhost:7080", timeout=60.0)
API Reference
CoordinodeGraph
| Method | Description |
|---|---|
query(query, params) |
Execute Cypher, returns List[Dict[str, Any]] |
refresh_schema() |
Reload node/relationship schema from database |
add_graph_documents(docs) |
Batch MERGE nodes + relationships from GraphDocument list |
schema |
Schema string for LLM context |
Related Packages
| Package | Description |
|---|---|
coordinode |
Core gRPC client |
llama-index-graph-stores-coordinode |
LlamaIndex PropertyGraphStore |
Links
Support
License
Apache-2.0
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file langchain_coordinode-0.4.2.tar.gz.
File metadata
- Download URL: langchain_coordinode-0.4.2.tar.gz
- Upload date:
- Size: 5.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f850ab292fd6c896767bb61fd237eed89ad13c474138415bc0ddf18a1c338a45
|
|
| MD5 |
23a7298300f5acfecd593bf40bf17f9e
|
|
| BLAKE2b-256 |
c5befe8fac3a993337065ff5596c887eaba4f3d280965597172c1f9bb348513b
|
Provenance
The following attestation bundles were made for langchain_coordinode-0.4.2.tar.gz:
Publisher:
release.yml on structured-world/coordinode-python
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
langchain_coordinode-0.4.2.tar.gz -
Subject digest:
f850ab292fd6c896767bb61fd237eed89ad13c474138415bc0ddf18a1c338a45 - Sigstore transparency entry: 1262682982
- Sigstore integration time:
-
Permalink:
structured-world/coordinode-python@1e613ab7b51fcf6c8c8fe86b034e14e4646e3582 -
Branch / Tag:
refs/tags/v0.4.2 - Owner: https://github.com/structured-world
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@1e613ab7b51fcf6c8c8fe86b034e14e4646e3582 -
Trigger Event:
push
-
Statement type:
File details
Details for the file langchain_coordinode-0.4.2-py3-none-any.whl.
File metadata
- Download URL: langchain_coordinode-0.4.2-py3-none-any.whl
- Upload date:
- Size: 5.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
fd5e2c9489e50ca7e762dd73402c896856c7f6aa40a49a48d235987e055e2e19
|
|
| MD5 |
bc3feabdfc45f7ef38ab06d321603aa2
|
|
| BLAKE2b-256 |
5baf23197b4589bcac03850fa38e4eb5d4fc86db87d34652181b54f0289c6c29
|
Provenance
The following attestation bundles were made for langchain_coordinode-0.4.2-py3-none-any.whl:
Publisher:
release.yml on structured-world/coordinode-python
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
langchain_coordinode-0.4.2-py3-none-any.whl -
Subject digest:
fd5e2c9489e50ca7e762dd73402c896856c7f6aa40a49a48d235987e055e2e19 - Sigstore transparency entry: 1262682994
- Sigstore integration time:
-
Permalink:
structured-world/coordinode-python@1e613ab7b51fcf6c8c8fe86b034e14e4646e3582 -
Branch / Tag:
refs/tags/v0.4.2 - Owner: https://github.com/structured-world
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@1e613ab7b51fcf6c8c8fe86b034e14e4646e3582 -
Trigger Event:
push
-
Statement type: