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.8.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.1.8-py3-none-any.whl (9.3 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: langchain_arqondb-0.1.8.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.1.8.tar.gz
Algorithm Hash digest
SHA256 035e02a1c0673d35d9d5404bce424a43f96ae8432f266222f8becf89f4c40aac
MD5 a549d519a4c17b09ace7d52d8d7738e9
BLAKE2b-256 cf59f855a2cc9611694e4c182fb32cb11737e1a45af76096bb4d5d73265f546c

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for langchain_arqondb-0.1.8-py3-none-any.whl
Algorithm Hash digest
SHA256 4a7efdc64657dfe67e7c5a419b169810e4ab6f597f7b3e524ab34f98ed99414b
MD5 2a4fa43bb01212d6cfdd4a95508e4403
BLAKE2b-256 d716394676a03095f7dc819ebe996d2e9a5848fd0bdfad11fb8f7d28bf59d01b

See more details on using hashes here.

Provenance

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