langchain-hydradb
HydraDB integration for LangChain: give your chains and agents persistent, cross-session memory and retrieval powered by HydraDB.
Install
pip install langchain-hydradb # once published; for local dev: pip install -e .
Prerequisites
- Python >= 3.9
- A HydraDB account: API key + tenant ID (hydradb.com)
langchain-core >= 0.3
Quick start
from langchain_hydradb import HydraDBClient, HydraDBRetriever
client = HydraDBClient(api_key="sk_live_...", tenant_id="your-tenant")
# Use HydraDB as a retriever in any chain
retriever = HydraDBRetriever(client=client, kind="both", max_results=6)
docs = retriever.invoke("what did we decide about auth?")
# Write durable memory
client.add_text("We deploy on Fridays only.", infer=True)
As chat memory
from langchain_core.runnables.history import RunnableWithMessageHistory
from langchain_hydradb import HydraDBChatMessageHistory
chain_with_memory = RunnableWithMessageHistory(
chain,
lambda session_id: HydraDBChatMessageHistory(client, session_id),
input_messages_key="input",
history_messages_key="history",
)
What's included
| Class | Role |
|---|---|
HydraDBClient |
Thin HTTP client, public API only (POST /query, POST /context/ingest, DELETE /context) |
HydraDBRetriever |
BaseRetriever over memory, knowledge, or both |
HydraDBChatMessageHistory |
BaseChatMessageHistory that persists + recalls turns |
Notes
- Public API only. Writes use the public knowledge path (
app_knowledgevia/context/ingest); the memory-family write route is not publicly exposed, soadd_text/add_conversationstore as knowledge. Recallkindmay still be"memory","knowledge", or"both"- default is"knowledge". - Ingestion is asynchronous; recall a source only after it finishes indexing.
- The client depends only on
requests; no HydraDB SDK required.
Test
pip install -e ".[test]"
pytest
License
Apache-2.0 - Copyright (c) 2026 HydraDB
Metadata
Release files for langchain-hydradb 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| langchain_hydradb-0.1.0.tar.gz | 10.4 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| langchain_hydradb-0.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 21.7 kB
Release files / langchain_hydradb-0.1.0.tar.gz
| Download URL | langchain_hydradb-0.1.0.tar.gz |
|---|---|
| Size | 10.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
05175d04cc185213d223a1dee5aac7fac73204f8cbac37e2662af2fbd6e6839c
|
|
BLAKE2b-256 checksum How to use checksums |
0ec8b1ca95a7ba8a4d22a12874a4f8df13d37180fcb496a08ac6ac95aed504c0
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.12.23 {"installer":{"name":"uv","version":"0.12.23","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Arch Linux","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
|
Release files / langchain_hydradb-0.1.0-py3-none-any.whl
| Download URL | langchain_hydradb-0.1.0-py3-none-any.whl |
|---|---|
| Size | 11.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
b4985bfc85668ece3665e75277270b24809af3d84c75f7f2c4f857419cff4a6f
|
|
BLAKE2b-256 checksum How to use checksums |
5831f3b7792f11a47e1e42d7ef40c9b01d2d07ce277c19e89c30a14b05a8daf9
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.12.23 {"installer":{"name":"uv","version":"0.12.23","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Arch Linux","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
|