An integration package connecting ArcadeDB and LangChain.
Project description
langchain-arcadedb
This package contains the LangChain integration for ArcadeDB, the multi-model database with native graph, document, key-value, time-series, and vector support.
Installation
pip install langchain-arcadedb
This will also install the neo4j Python driver, which is used to connect to
ArcadeDB via its native Bolt protocol.
Prerequisites
ArcadeDB must be running with the Bolt protocol plugin enabled.
Docker (quickest way)
docker run --rm -p 2480:2480 -p 7687:7687 \
-e JAVA_OPTS="-Darcadedb.server.plugins=Bolt:com.arcadedb.bolt.BoltProtocolPlugin" \
-e arcadedb.server.rootPassword=playwithdata \
arcadedata/arcadedb:latest
Then create a database (e.g. via the HTTP API):
curl -X POST http://localhost:2480/api/v1/server \
-d '{"command":"create database mydb"}' \
-u root:playwithdata \
-H "Content-Type: application/json"
Server / Embedded
If you run ArcadeDB from a distribution or embedded, add the Bolt plugin to your server configuration:
arcadedb.server.plugins=Bolt:com.arcadedb.bolt.BoltProtocolPlugin
See the ArcadeDB docs for details.
Quick Start
from langchain_arcadedb import ArcadeDBGraph
graph = ArcadeDBGraph(
url="bolt://localhost:7687",
username="root",
password="playwithdata",
database="mydb",
)
# Schema is auto-detected from existing data
print(graph.get_schema)
# Run Cypher queries
result = graph.query("MATCH (n:Person) RETURN n.name AS name")
Use with GraphCypherQAChain
ArcadeDBGraph implements the GraphStore protocol, so it works as a drop-in
replacement wherever LangChain expects a graph store:
from langchain_arcadedb import ArcadeDBGraph
from langchain_neo4j import GraphCypherQAChain
from langchain_openai import ChatOpenAI
graph = ArcadeDBGraph(
url="bolt://localhost:7687",
username="root",
password="playwithdata",
database="mydb",
)
llm = ChatOpenAI(model="gpt-4o-mini", temperature=0)
chain = GraphCypherQAChain.from_llm(llm=llm, graph=graph, verbose=True)
answer = chain.invoke({"query": "Who does Alice know?"})
Import Graph Documents
You can import structured graph documents directly:
from langchain_arcadedb import ArcadeDBGraph, GraphDocument, Node, Relationship
from langchain_core.documents import Document
graph = ArcadeDBGraph(
url="bolt://localhost:7687",
username="root",
password="playwithdata",
database="mydb",
)
# Build a graph document
nodes = [
Node(id="alice", type="Person", properties={"name": "Alice", "age": 30}),
Node(id="bob", type="Person", properties={"name": "Bob", "age": 25}),
]
relationships = [
Relationship(source=nodes[0], target=nodes[1], type="KNOWS"),
]
doc = GraphDocument(
nodes=nodes,
relationships=relationships,
source=Document(page_content="Alice knows Bob"),
)
graph.add_graph_documents([doc])
Configuration
Connection parameters can be passed directly or via environment variables:
| Parameter | Environment Variable | Default |
|---|---|---|
url |
ARCADEDB_URI |
bolt://localhost:7687 |
username |
ARCADEDB_USERNAME |
root |
password |
ARCADEDB_PASSWORD |
playwithdata |
database |
ARCADEDB_DATABASE |
(empty) |
Key Features
- Bolt protocol -- connects via the standard Neo4j Python driver
- APOC-free -- schema introspection and document import use pure Cypher
- GraphStore protocol -- works with
GraphCypherQAChainout of the box - Graph document import -- batched
MERGEoperations grouped by type - Lazy initialization -- connection is established on first use
- Schema auto-detection -- node labels, relationship types, and property types are inferred from sampled data
Development
# Install dependencies
uv sync --all-groups
# Run unit tests
make test
# Run integration tests (requires a running ArcadeDB instance)
make integration_tests
# Lint & format
make lint
make format
Links
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_arcadedb-0.1.0.tar.gz.
File metadata
- Download URL: langchain_arcadedb-0.1.0.tar.gz
- Upload date:
- Size: 11.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8693de0df8f7569460bc551af798ff1c3c4be4a6af63c3afc14ceece5ad334ce
|
|
| MD5 |
19dc8ba9061b5202f981216951cbd69b
|
|
| BLAKE2b-256 |
c85af1c4353ba66bfb2532a6e5d9fa34da0c93db9c9dc849f944fdde940417da
|
Provenance
The following attestation bundles were made for langchain_arcadedb-0.1.0.tar.gz:
Publisher:
publish.yml on ArcadeData/langchain-arcadedb
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
langchain_arcadedb-0.1.0.tar.gz -
Subject digest:
8693de0df8f7569460bc551af798ff1c3c4be4a6af63c3afc14ceece5ad334ce - Sigstore transparency entry: 1006697636
- Sigstore integration time:
-
Permalink:
ArcadeData/langchain-arcadedb@4ec4c7ce157db2e282054dc812c0b35a9772ab86 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/ArcadeData
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@4ec4c7ce157db2e282054dc812c0b35a9772ab86 -
Trigger Event:
release
-
Statement type:
File details
Details for the file langchain_arcadedb-0.1.0-py3-none-any.whl.
File metadata
- Download URL: langchain_arcadedb-0.1.0-py3-none-any.whl
- Upload date:
- Size: 9.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8009e799435bde7f1746edbf506b4540f9caf6be4d5704a313339bca91b41131
|
|
| MD5 |
92e8291d9996b7cc25f9f85b1a69a9e3
|
|
| BLAKE2b-256 |
509444985eb4d7e2c96a49c2b1eb358c11f54ba1157c205a6069284f3550aeff
|
Provenance
The following attestation bundles were made for langchain_arcadedb-0.1.0-py3-none-any.whl:
Publisher:
publish.yml on ArcadeData/langchain-arcadedb
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
langchain_arcadedb-0.1.0-py3-none-any.whl -
Subject digest:
8009e799435bde7f1746edbf506b4540f9caf6be4d5704a313339bca91b41131 - Sigstore transparency entry: 1006697637
- Sigstore integration time:
-
Permalink:
ArcadeData/langchain-arcadedb@4ec4c7ce157db2e282054dc812c0b35a9772ab86 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/ArcadeData
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@4ec4c7ce157db2e282054dc812c0b35a9772ab86 -
Trigger Event:
release
-
Statement type: