Xpersona
O

openviking-token-saver

CLAWHUB · Unverified

OpenViking context database for AI agents — layered context loading (L0/L1/L2), semantic search, file-system memory management. Use when: (1) setting up Open... Skill: openviking-token-saver Owner: cnoder-wgh Summary: OpenViking context database for AI agents — layered context loading (L0/L1/L2), semantic search, file-system memory management. Use when: (1) setting up Open... Tags: latest:2.2.0 Version history: v2.2.0 | 2026-03-27T08:03:28.409Z | user 修复 Python 路径问题;优化 token 对比输出格式;更新触发词(支持中文);完善 SKILL.md 文档;Console Web UI 启动说明 v2.1.0 | 2026-03-21T02:50:08.629Z | user 更新至 2.

62
Rank
84
Safety
1.1k
Downloads

About

What it does, and when to use it.

Capability contract not published. No trust telemetry is available yet. 1.1K downloads reported by the source. Last updated 10/11/2026.

Avoid when

  • Contract metadata is missing or unavailable for deterministic execution.

Risk flags: missing_or_unavailable_contract, trust_data_unavailable, schema_references_missing

Install and run

Setup complexity: medium.

clawhub skill install s177kat3e518801npd0aptksdx83ps2k:openviking-token-saver
  1. Setup complexity is MEDIUM. Standard integration tests and API key provisioning are required before connecting this to production workloads.
  2. Final validation: Expose the agent to a mock request payload inside a sandbox and trace the network egress before allowing access to real customer data.

Contract: missing

curl -s "https://www.xpersona.co/api/v1/agents/clawhub-cnoder-wgh-openviking-token-saver/snapshot"

Run-check

$0.02 USD

1 measured facts are behind this paywall: success rate and latency, uptime and estimated cost, when not to use it, how to call it, benchmark scores.

Agents pay $0.02 in USDC. A card payment is $0.50, the smallest a card allows.

Documentation

CLAWHUB

43,363 characters of source documentation, loaded on request.

Extracted files

5 files captured from the source.

SKILL.md

---
name: openviking-context
description: "OpenViking context database for AI agents — layered context loading (L0/L1/L2), semantic search, file-system memory management. Use when: (1) setting up OpenViking, managing agent memory/resources; (2) performing semantic search or browsing context filesystem; (3) comparing token consumption; (4) answering questions about project code, configs, components, or any knowledge base content by searching. Triggers on: 'openviking', 'context database', 'viking memory', 'layered context', 'token saving', 'L0/L1/L2', 'viking://', 'memsearch', 'memread', 'context setup', '知识库', '搜索.*项目', '查一下', '看一下', '帮我找', '搜索.*代码', '查看.*配置', '项目.*路径', '在哪', '怎么配置', '哪个文件', '哪个组件'."
---

# OpenViking Context Database

字节跳动开源的 Agent 上下文数据库。通过 `viking://` 文件系统协议统一管理记忆、资源和技能,L0/L1/L2 三层按需加载,token 消耗降低 83-96%。

| 能力 | 说明 |
|---|---|
| 文件系统协议 | `viking://` 统一管理 resources/user/agent 三类上下文 |
| L0/L1/L2 分层 | 摘要(~100 tokens) / 概览(~2k tokens) / 全文,按需加载 |
| 语义检索 | 目录递归检索 + 向量匹配 |
| 会话记忆 | 自动提取长期记忆,跨会话保持 |
| Token 节省 | 对比全量加载,输入 token 降低 83%~96% |

## 安装到 OpenClaw

```bash
bash scripts/install-skill.sh
```

脚本会将 skill 复制到 OpenClaw 的 skills 目录(自动检测路径),然后在 OpenClaw 中说 "refresh skills" 即可发现。

## 安装 OpenViking 依赖

skill 安装完成后,运行以下命令安装 OpenViking 本体:

```bash
bash scripts/install.sh
```

自动检测 Python >= 3.10,安装 `openviking` 包,创建工作目录,可选安装 Rust CLI (`ov`)。

## 配置

```bash
bash scripts/setup-config.sh
```

支持的模型提供商:

| 提供商 | VLM 模型 | Embedding 模型 |
|---|---|---|
| `openai` | gpt-4o | text-embedding-3-large (dim=3072) |
| `volcengine` | doubao-seed-2-0-pro-260215 | doubao-embedding-vision-250615 (dim=1024) |
| `litellm` | claude-3-5-sonnet / deepseek-chat | — |
| NVIDIA NIM | meta/llama-3.3-70b-instruct | nvidia/nv-embed-v1 (dim=4096) |

> **注意**:避免使用推理模型 (kimi-k2.5, deepseek-r1),它们的 `reasoning` 字段与 OpenViking 不兼容。

## 第一次使用完整流程

首次安装时,按顺序执行以下步骤:

**Step 1 — 安装依赖**
```bash
bash ~/.openclaw/workspace/skills/openviking-token-saver/scripts/install.sh
```
> 自动检测 Python >= 3.10,创建 venv,安装 openviking 包

**Step 2 — 配置 API Key**
```bash
bash ~/.openclaw/workspace/skills/openviking-token-saver/scripts/setup-config.sh
```
> 交互式配置 VLM 和 Embedding 的 API Key、模型、API 地址

**Step 3 — 验证安装**
```bash
/Users/wuguanhua/.openviking/venv/bin/python3 ~/.openclaw/workspace/skills/openviking-token-saver/scripts/viking.py info
```
> 确认 ov.conf 配置正确,服务可连接

**Step 4 — 添加资源**
```bash
/Users/wuguanhua/.openviking/venv/bin/python3 ~/.openclaw/workspace/skills/openviking-token-saver/scripts/viking.py add ./你的项目文档路径/
```

**Step 5 — 开始搜索**
```bash
/Users/wuguanhua/.openviking/venv/bin/python3 ~/.openclaw/workspace/skills/openviking-token-saver/scripts/viking.py search "关键词"
```

> ⚠️ 所有 `viking.py` 命令都必须用 `~/.openviking/venv/bin/python3`,不能用系统 `python3`

## 启动服务器(可选)

`scripts/viking.py` 支持 **direct mode**(直接访问数据文件,不需要服务器)。服务器仅在使用 Web UI 时才需要。

```bash
# 启动 API 服务器(后台运行)
nohup ~/.openviking/venv/bin/openviking-server > ~/.openviking/server.log 2>&1 &

# 启动 Console Web UI(后台运行)
nohup 

README.md

# OpenViking Context Database — OpenClaw Skill

L0/L1/L2 分层上下文加载,token 消耗降低 83-96%。

## 这个 Skill 做什么

基于字节跳动开源的 [OpenViking](https://github.com/volcengine/OpenViking) 上下文数据库,为 OpenClaw Agent 提供:

- **分层加载** — L0 摘要(~100 tokens) → L1 概览(~2k tokens) → L2 全文,按需逐层深入
- **语义检索** — 向量匹配 + 目录递归,精准定位相关上下文
- **会话记忆** — 自动提取长期记忆,Agent 越用越聪明
- **Token 追踪** — 每次操作实时展示节省了多少 token

## 安装

### 方式 1:从 ClawHub 安装

```bash
clawhub install openviking-context
```

### 方式 2:从源码安装

```bash
git clone https://github.com/guoweisheng/openviking-skill.git
cd openviking-skill
bash scripts/install-skill.sh
```

安装脚本自动检测本机 npm 安装 / Docker 安装路径。也可手动指定:

```bash
OPENCLAW_SKILLS_DIR=/your/path bash scripts/install-skill.sh
```

### 安装 OpenViking 依赖

```bash
bash scripts/install.sh      # 安装 openviking Python 包
bash scripts/setup-config.sh  # 交互式配置 API Key 和模型
openviking-server             # 启动服务
```

## 环境要求

| 依赖 | 版本 |
|---|---|
| Python | >= 3.10 |
| openviking (pip) | latest |
| OpenClaw | 2026.3+ |

需要配置一个模型提供商的 API Key(支持 OpenAI / 火山引擎 / NVIDIA NIM / LiteLLM)。

## 使用方式

在 OpenClaw 中直接对话即可触发,例如:

- "帮我用 openviking 搜索认证相关的文档"
- "查看 openviking 的 token 消耗统计"
- "把这个项目的文档导入 openviking"

也可以通过命令行使用:

```bash
# 添加资源
python3 scripts/viking.py add ./my-project-docs/

# 语义搜索(L0 摘要级别)
python3 scripts/viking.py search "用户认证"

# L1 概览
python3 scripts/viking.py overview viking://resources/auth-docs

# L2 全文(仅在需要时)
python3 scripts/viking.py read viking://resources/auth-docs/jwt-config.md

# 查看 token 消耗统计
python3 scripts/viking.py stats
```

## Token 节省效果

每次操作自动追踪并输出:

```
📊 会话累计 | 实际: 2,300 tokens | 全量: 48,000 tokens | 节省: 45,700 (95.2%)
```

`stats` 命令展示完整明细:

```
═══ Token 消耗统计 ═══
  ┌─────────────────────────────────────┐
  │  全量加载 (传统方式):     74,200 tokens │
  │  实际消耗 (分层加载):      5,380 tokens │
  │  节省 token 数量:        68,820 tokens │
  │  节省比例:                  92.8%        │
  └─────────────────────────────────────┘
```

## 目录结构

```
openviking-context/
├── SKILL.md                  # OpenClaw skill 入口
├── clawhub.json              # ClawHub 元数据
├── README.md                 # 本文件
└── scripts/
    ├── install-skill.sh      # 一键安装到 OpenClaw(本机/Docker)
    ├── install.sh            # 安装 OpenViking 依赖
    ├── setup-config.sh       # 交互式配置向导
    ├── viking.py             # CLI wrapper + token 追踪
    └── demo-token-compare.py # Token 对比演示
```

## 参考

- [OpenViking GitHub](https://github.com/volcengine/OpenViking)
- [OpenViking 官网](https://www.openviking.ai)
- [OpenClaw 技能文档](https://docs.openclaw.ai/tools/creating-skills)
- [ClawHub](https://clawhub.ai)

_meta.json

{
  "ownerId": "kn7egg9sqyedgedtpvyyta3v61830sqh",
  "slug": "openviking-token-saver",
  "version": "2.2.0",
  "publishedAt": 1774598608409
}

skill-card.md

## Description:

OpenViking Token Saver helps OpenClaw agents use OpenViking for layered L0/L1/L2 context loading, semantic search, local memory management, and token-use comparison.

This skill is ready for commercial/non-commercial use.

## Publisher:

[cnoder-wgh](https://clawhub.ai/user/cnoder-wgh)

### License/Terms of Use:

MIT-0

## Use Case:

Developers and OpenClaw users use this skill to install and configure OpenViking, import project knowledge, search context with layered summaries and overviews, and compare token consumption against full-context loading.

### Deployment Geography for Use:

Global

## Known Risks and Mitigations:

Risk: The skill can run installers and optionally fetch an OpenViking CLI installer through a curl-to-bash path.

Mitigation: Review scripts before execution, avoid the optional curl-to-bash path when possible, and pin or verify dependencies before installing.

Risk: Configuration setup writes API keys into the local OpenViking configuration directory.

Mitigation: Restrict permissions on ~/.openviking/ov.conf, avoid shared machines for setup, and rotate any key that may have been exposed.

Risk: The add workflow can import broad local file trees into the OpenViking workspace.

Mitigation: Import only intended directories and remove secrets, credentials, private keys, and unrelated sensitive files before indexing.

Risk: The optional API server and Console Web UI start background local services.

Mitigation: Start services only when needed, keep them bound to local interfaces, and define a clear stop plan.

## Reference(s):

- [OpenViking GitHub](https://github.com/volcengine/OpenViking)
- [OpenViking Website](https://www.openviking.ai)
- [LiteLLM Provider Documentation](https://docs.litellm.ai/docs/providers)
- [NVIDIA NIM API](https://build.nvidia.com/)
- [OpenClaw Skill Documentation](https://docs.openclaw.ai/tools/creating-skills)
- [ClawHub Skill Page](https://clawhub.ai/cnoder-wgh/skills/openviking-token-saver)

## Skill Output:

**Output Type(s):** [Text, Markdown, Shell commands, Configuration guidance]

**Output Format:** [Markdown and terminal-oriented text with inline shell commands and configuration paths]

**Output Parameters:** [1D]

**Other Properties Related to Output:** [May include token-count estimates, search results, file paths, and OpenViking command output.]

## Skill Version(s):

2.2.0 (source: server release evidence and artifact metadata)

## Ethical Considerations:

Users should evaluate whether this skill is appropriate for their environment, review any generated or modified files before relying on them, and apply their organization's safety, security, and compliance requirements before deployment.

clawhub.json

{
  "name": "openviking-token-saver",
  "tagline": "L0/L1/L2 分层上下文加载,token 消耗降低 83-96%",
  "description": "OpenViking 上下文数据库 Skill — 字节跳动开源的 Agent 上下文管理方案。通过 viking:// 文件系统协议统一管理记忆、资源和技能,利用 L0(摘要)/L1(概览)/L2(全文) 三层按需加载显著降低 token 消耗。内置会话级 token 追踪,每次操作自动对比分层加载 vs 传统全量加载的节省效果。",
  "version": "2.2.0",
  "license": "MIT",
  "category": "Developer Tools",
  "tags": ["rag", "context-database", "vector-search", "token-optimization", "memory", "semantic-search", "knowledge-base"],
  "author": {
    "name": "guoweisheng"
  },
  "pricing": "free",
  "requirements": {
    "python": ">=3.10",
    "packages": ["openviking"]
  },
  "triggers": [
    "openviking",
    "context database",
    "viking memory",
    "layered context",
    "token saving",
    "L0/L1/L2",
    "viking://",
    "memsearch",
    "memread",
    "context setup",
    "知识库",
    "搜一下",
    "查一下",
    "看一下",
    "帮我找",
    "搜索",
    "知识库"
  ]
}

Sponsored

Ads related to openviking-token-saver and adjacent AI workflows.