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.2.1.tar.gz (9.5 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.2.1-py3-none-any.whl (9.3 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: langchain_arqondb-0.2.1.tar.gz
  • Upload date:
  • Size: 9.5 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.2.1.tar.gz
Algorithm Hash digest
SHA256 f535feb9087783e3fa77365bcc9d06492aa8647099135e58535109e738e8158e
MD5 78bd19762c77edd9aa61271ae09b5761
BLAKE2b-256 b48e02cf336d8ed0d033d13272f0900ea1466be4830ef1d43d90af44b6157a35

See more details on using hashes here.

Provenance

The following attestation bundles were made for langchain_arqondb-0.2.1.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.2.1-py3-none-any.whl.

File metadata

File hashes

Hashes for langchain_arqondb-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 e61864b69127013fe34d5dd8b267fe8fc990d1bdf8b94e45286e8d4c1c19bebe
MD5 fcaf1276e963829866ed0db6d3576e9e
BLAKE2b-256 31a919907589a6d738e4922e5691fc07aff4541090f51fa6c37ee3e1c28dfc95

See more details on using hashes here.

Provenance

The following attestation bundles were made for langchain_arqondb-0.2.1-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