OpenViking integrations for LangChain and LangGraph
Actively maintained. Last release 3 weeks ago, commits in 26 of the last 26 weeks. A safe choice.
pip install langchain-openvikinglangchain-openviking
Working memory is now opt-in. Update installed plugins separately from the OV server, then restart the host. Existing explicit settings still take precedence. See the default-off upgrade guide for native history, re-enabling WM, and old-conversation handoffs.
langchain-openviking is the official OpenViking integration package for
LangChain and LangGraph applications. It keeps framework-specific adapters
separate from the OpenViking server and communicates with remote OpenViking
instances through the lightweight openviking-sdk package.
OpenViking Server requirement: examples here use the
viking://~home alias (for exampleviking://~/memories), which the server expands to the authenticated caller's own user space, so they require a server withviking://~support. The uid-lessviking://user/memoriesshorthand is rejected by newer servers; pass an explicitviking://user/<uid>/...URI when targeting another user.
Installation
For LangChain retrievers, tools, message history, and context wrappers:
pip install langchain-openviking
For the LangGraph store and middleware:
pip install "langchain-openviking[langgraph]"
Quick start
from langchain_openviking import OpenVikingRetriever
from openviking_sdk import SyncHTTPClient
client = SyncHTTPClient(
url="http://127.0.0.1:1933",
api_key="your-user-api-key",
auth_mode="api_key",
)
client.initialize()
retriever = OpenVikingRetriever(
client=client,
target_uri="viking://~/memories",
)
try:
documents = retriever.invoke("What deployment preferences should I remember?")
finally:
client.close()
For API-key-only integrations, pass auth_mode="api_key" alongside api_key.
The authentication mode is forwarded to owned synchronous and asynchronous SDK
clients, including clients rebuilt during safe-read recovery. Leaving it unset
preserves the SDK's existing configuration defaults. The same option is available
on the recorder, retriever, message history, store, tools, and context wrappers.
The package also provides OpenVikingSessionRecorder,
OpenVikingContextMiddleware, OpenVikingStore,
OpenVikingChatMessageHistory, and .