OpenViking 是专为 AI 智能体设计开发的开源上下文管理工具。它通过定义极简的上下文交互范式,将 Agent 的记忆、资源和技能统一组织为层级化结构,支持 L0/L1/L2 分层上下文加载,有效降低 Token 消耗并提升长期记忆能力。该工具能够解决传统上下文碎片化、检索效果不佳等问题,使 Agent 开发更加简洁、可扩展且具备自进化能力。通常作为 OpenClaw 等框架的插件或扩展使用,适用于构建企业知识库、智能问答系统等场景。
启用 OpenViking
1. 修改 OpenViking 配置;
配置文件路径:
Windows:
C:\Users\Administrator\.openviking\ov.confLinux:
/home/ctyun/.openviking/ov.conf
请配置 Embedding 模型和 VLM 模型。使用天翼云 OpenClaw 云电脑默认模型时,配置示例如下(请替换为您的实际 API_KEY):
"embedding": {
"dense": {
"provider": "openai",
"api_key": "YOUR_API_KEY",
"model": "openclaw_ctyun-smart-oc",
"api_base": "https://eaichat.ctyun.cn/ai/platform/v1",
"dimension": 1024
}
},
"vlm": {
"provider": "openai",
"api_key": "YOUR_API_KEY",
"model": "openclaw_ctyun-smart-oc",
"api_base": "https://eaichat.ctyun.cn/ai/platform/v2/cp"
}YOUR_API_KEY 可通过云智助手或 OpenClaw 配置文件获取,配置完成后请保存文件。
说明
自定义模型配置属于进阶操作,详细说明请参考官方文档:https://docs.openviking.ai/zh/guides/01-configuration
2. 修改 OpenClaw 配置;
将 plugins.slots.contextEngine 字段设置为 openviking:
"slots": {
"contextEngine": "openviking"
}同时配置 plugins.entries.openviking 字段:
Windows 配置:
"openviking": {
"enabled": true,
"config": {
"mode": "local",
"configPath": "C:\\Users\\Administrator\\.openviking\\ov.conf",
"port": 1933
}
}Linux 配置:
"openviking": {
"enabled": true,
"config": {
"mode": "local",
"configPath": "/home/ctyun/.openviking/ov.conf",
"port": 1933
}
}3. 重启 OpenClaw。
在终端执行以下命令:
openclaw gateway restart关闭 OpenViking
1. 修改 OpenClaw 配置;
将 plugins.slots.contextEngine 字段修改为 legacy:
"slots": {
"contextEngine": "legacy"
}并将 plugins.entries.openviking 配置修改为:
"openviking": {
"enabled": false
}2. 重启 OpenClaw。
在终端执行以下命令:
openclaw gateway restart注意
修改配置文件后请重启 OpenClaw 使配置生效。
建议在修改配置前备份原配置文件。