Skip to main content

LangChain integration for ArqonDB — VectorStore, ChatHistory, and GraphStore backed by a single self-hosted engine.

Project description

langchain-arqondb

LangChain integration for ArqonDB — VectorStore, ChatHistory, and GraphStore backed by a single self-hosted engine.

Install

pip install langchain-arqondb

For GraphStore support:

pip install langchain-arqondb[graph]

Prerequisites

ArqonDB must be running locally:

curl -sL https://github.com/AlbericByte/ArqonDB/releases/download/v0.1.1/install.sh | bash

Usage

VectorStore

from langchain_arqondb import ArqonDBVectorStore
from langchain_openai import OpenAIEmbeddings

vectorstore = ArqonDBVectorStore(
    embedding=OpenAIEmbeddings(),
    addr="localhost:9379",
    index_name="my_docs",
)

# Add documents
vectorstore.add_texts(
    ["The cat sat on the mat", "The dog ran in the park"],
    metadatas=[{"source": "a"}, {"source": "b"}],
)

# Search
docs = vectorstore.similarity_search("cat", k=2)

# Use as retriever in a RAG chain
retriever = vectorstore.as_retriever()

Chat Message History

from langchain_arqondb import ArqonDBChatMessageHistory

history = ArqonDBChatMessageHistory(session_id="user-123")

history.add_user_message("hello")
history.add_ai_message("hi there")

print(history.messages)  # [HumanMessage(...), AIMessage(...)]

history.clear()

Graph Store

from langchain_arqondb import ArqonDBGraphStore
from langchain_community.graphs.graph_document import GraphDocument, Node, Relationship
from langchain_core.documents import Document

graph = ArqonDBGraphStore(addr="localhost:9379", graph_name="knowledge")

alice = Node(id="alice", type="Person", properties={"name": "Alice"})
bob = Node(id="bob", type="Person", properties={"name": "Bob"})
rel = Relationship(source=alice, target=bob, type="KNOWS")

graph.add_graph_documents([
    GraphDocument(nodes=[alice, bob], relationships=[rel], source=Document(page_content=""))
])

results = graph.query("*")
schema = graph.get_structured_schema

Why ArqonDB?

ArqonDB is the only single backend that covers all three LangChain storage needs:

Need Pinecone Neo4j Redis ArqonDB
VectorStore Yes No Yes Yes
GraphStore No Yes No Yes
ChatHistory No No Yes Yes
Self-hosted No Partial Yes Yes
Single engine - - - Yes

Zero extra API keys. Apache-2.0. Self-hosted.

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

langchain_arqondb-0.1.9.tar.gz (9.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

langchain_arqondb-0.1.9-py3-none-any.whl (9.3 kB view details)

Uploaded Python 3

File details

Details for the file langchain_arqondb-0.1.9.tar.gz.

File metadata

  • Download URL: langchain_arqondb-0.1.9.tar.gz
  • Upload date:
  • Size: 9.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for langchain_arqondb-0.1.9.tar.gz
Algorithm Hash digest
SHA256 d9cd7ff5cb5f9dce47289cd46bc7361a88273c84594c7e9171be6330a4e00c4e
MD5 30e5235ce130958ca80d1136363d2f07
BLAKE2b-256 2b926fa9c1d66e3472e9a7a0c7a652a35f01aeace5dbd8d579bc84fa70da7c08

See more details on using hashes here.

Provenance

The following attestation bundles were made for langchain_arqondb-0.1.9.tar.gz:

Publisher: release.yml on AlbericByte/ArqonDB

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file langchain_arqondb-0.1.9-py3-none-any.whl.

File metadata

File hashes

Hashes for langchain_arqondb-0.1.9-py3-none-any.whl
Algorithm Hash digest
SHA256 130cedc3864eb945a3ec64225fd3b190ee14f92043f1d376b2deeb2cdba913d2
MD5 f18f2a87023790b2d0d38ddc4c8964f8
BLAKE2b-256 a600c3dad3f9cc7bec52e0ef2a6fa2f8c50ad3e30c27a6d574526b3a29b801da

See more details on using hashes here.

Provenance

The following attestation bundles were made for langchain_arqondb-0.1.9-py3-none-any.whl:

Publisher: release.yml on AlbericByte/ArqonDB

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