langchain-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 create_openviking_tools.
create_openviking_tools includes viking_rule_search in the retrieval, agent,
and admin profiles. Pass task_context and optionally rule_probability_threshold
(default 0.65) to check compiled constraints before an action or response.
It returns the full rendered Rules without truncation. Use an SDK client exposing
rule_search and a server with POST /api/v1/rules/search; an error must not be
treated as no applicable Rules.
Client ownership
- A client supplied through
client=orasync_client=remains caller-owned. - Clients created from
url=are managed by the adapter and can be closed withclose()oraclose()as documented by each adapter.
Import migration
Starting with the next server release after v0.5.0, the legacy
openviking.integrations.langchain namespace is removed without a compatibility
shim. v0.5.0 still provides it. Install the standalone package and import from
langchain_openviking instead; see the Unreleased migration notes.
from langchain_openviking import OpenVikingRetriever
See the OpenViking documentation, examples, and the framework adapter guide.
Validate
From the repository root:
pip install -e 'integrations/frameworks/langchain[langgraph,test,dev]'
python -m pytest -q --noconftest -o addopts='' \
integrations/frameworks/langchain/tests tests/unit/test_langchain_package_boundary.py
Package metadata and source headers declare AGPL-3.0; see LICENSE. The runnable examples retain Apache-2.0.
Metadata
Release files for langchain-openviking 0.2.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 | Provenance | Actions |
|---|---|---|---|---|
| langchain_openviking-0.2.0.tar.gz | 138.7 kB | With provenance | Details for langchain_openviking-0.2.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| langchain_openviking-0.2.0-py3-none-any.whl | Python 3 | none | any | Details for langchain_openviking-0.2.0-py3-none-any.whl |
Total release size: 216.9 kB
Release files / langchain_openviking-0.2.0.tar.gz
| Download URL | langchain_openviking-0.2.0.tar.gz |
|---|---|
| Size | 138.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
10117ba3c802992d723f090986eb6336b122760c52d128f91ea72385e26c6136
|
|
BLAKE2b-256 checksum How to use checksums |
6f4d4730b4ca3abcf205de6abe72e3d58fcd97b6152855c51bf2e867a4744420
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 6, 2026.
Transparency logRelease files / langchain_openviking-0.2.0-py3-none-any.whl
| Download URL | langchain_openviking-0.2.0-py3-none-any.whl |
|---|---|
| Size | 78.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
353a28ee7f7e680c6d8557a35349ad4ce4f4e9f94dc6cfcfcb8e581e86d394ce
|
|
BLAKE2b-256 checksum How to use checksums |
5899e6abd444da04ea27ca589a211069f9762d00d61393250bf6474517ab0ef7
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 6, 2026.
Transparency logSecurity for langchain-openviking 0.2.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for langchain_openviking-0.2.0.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 6, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.