Metadata-Version: 2.4
Name: langchain-openviking
Version: 0.1.dev1885
Summary: OpenViking integrations for LangChain and LangGraph
Author-email: ByteDance <noreply@bytedance.com>
License-Expression: AGPL-3.0
Project-URL: Homepage, https://github.com/volcengine/openviking
Project-URL: Documentation, https://openviking.ai
Project-URL: Repository, https://github.com/volcengine/openviking
Project-URL: Issues, https://github.com/volcengine/openviking/issues
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Requires-Python: >=3.10
Description-Content-Type: text/markdown
Requires-Dist: langchain-core<2.0.0,>=1.0.0
Requires-Dist: openviking-sdk>=0.1.1
Requires-Dist: pydantic>=2.0.0
Provides-Extra: langgraph
Requires-Dist: langchain<2.0.0,>=1.0.0; extra == "langgraph"
Requires-Dist: langgraph<2.0.0,>=1.0.0; extra == "langgraph"
Provides-Extra: test
Requires-Dist: pytest>=7.0.0; extra == "test"
Requires-Dist: pytest-asyncio>=0.21.0; extra == "test"
Provides-Extra: dev
Requires-Dist: build>=1.2.0; extra == "dev"
Requires-Dist: mypy>=1.0.0; extra == "dev"
Requires-Dist: ruff>=0.1.0; extra == "dev"
Requires-Dist: twine>=5.0.0; extra == "dev"

# langchain-openviking

`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.

## Installation

For LangChain retrievers, tools, message history, and context wrappers:

```bash
pip install langchain-openviking
```

For the LangGraph store and middleware:

```bash
pip install "langchain-openviking[langgraph]"
```

## Quick start

```python
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",
)
client.initialize()
retriever = OpenVikingRetriever(
    client=client,
    target_uri="viking://user/memories",
)

try:
    documents = retriever.invoke("What deployment preferences should I remember?")
finally:
    client.close()
```

The package also provides `OpenVikingSessionRecorder`,
`OpenVikingContextMiddleware`, `OpenVikingStore`,
`OpenVikingChatMessageHistory`, and `create_openviking_tools`.

## Client ownership

- A client supplied through `client=` or `async_client=` remains caller-owned.
- Clients created from `url=` are managed by the adapter and can be closed with
  `close()` or `aclose()` as documented by each adapter.
- Embedded `path=` mode requires the full `openviking` package. It is kept for
  compatibility, while the standalone package's default boundary is HTTP.

The previous `openviking.integrations.langchain` import path remains available
from the full `openviking` distribution as a compatibility shim.

See the [OpenViking documentation](https://openviking.ai) and the repository's
`examples/langchain-langgraph` directory for complete examples.
