Skip to main content
OpenVikingStore is a LangGraph BaseStore backed by OpenViking. Use it for long-term memory across threads in an OpenViking HTTP deployment.

Overview

OpenViking is a context database for AI agents. The langchain-openviking package includes an OpenVikingStore class for storing LangGraph values as durable OpenViking content records and indexing them for query-based search calls.
The examples on this page require langchain-openviking>=0.2.0.

Integration details

Setup

To use OpenVikingStore, you need an OpenViking HTTP deployment and an API key.

Installation

Use Python 3.10 or later. Install the integration with the langgraph extra:

Credentials

Set your OpenViking URL and API key:

Instantiation

Instantiate OpenVikingStore with your OpenViking HTTP connection settings:
root_uri defaults to viking://~/memories/langgraph_store. Use an OpenViking server that supports the viking://~ home alias, which resolves to the authenticated user’s space. To target a specific user, pass an explicit viking://user/<uid>/... URI as root_uri.

Usage

Use put to write a JSON-serializable mapping under a namespace and key:
Use get to retrieve the stored item:
Use search with a namespace prefix. Pass query for semantic search:
To skip semantic indexing for a value, pass index=False or index=[] to put. The value remains available through get:
Use delete to remove a key:
When you finish using the store, close its connection:
In async code, use await store.aclose(). The store also supports with and async with for automatic cleanup. If you supply a client through client=, close that client yourself.

API reference

For detailed documentation, see the OpenViking LangChain and LangGraph integration guide and the OpenVikingStore source for v0.2.0. See also the LangGraph store integrations list.