openviking
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseOpenViking Skill
OpenViking Skill
Manage an OpenViking context database: index documents, semantic search, browse, and retrieve summaries.
管理OpenViking上下文数据库:索引文档、语义搜索、浏览及检索摘要。
Prerequisites
前置条件
- Python 3.9+ with package installed (
openviking)pip install openviking - Config file at with valid embedding and VLM credentials
~/.openviking/ov.conf - Environment variable
OPENVIKING_CONFIG_FILE=~/.openviking/ov.conf
If prerequisites are not met, guide the user through setup. See .
references/setup-guide.md- 安装Python 3.9+及包(执行
openviking)pip install openviking - 在路径下存在配置文件,且包含有效的embedding和VLM凭证
~/.openviking/ov.conf - 设置环境变量
OPENVIKING_CONFIG_FILE=~/.openviking/ov.conf
若未满足前置条件,请引导用户完成设置。详见。
references/setup-guide.mdQuick Reference
快速参考
Index a file
索引单个文件
bash
python3 scripts/viking.py add /path/to/file.mdbash
python3 scripts/viking.py add /path/to/file.mdIndex all files in a directory (recursive)
索引目录下所有文件(递归)
bash
python3 scripts/viking.py add-dir /path/to/directory --pattern "*.md"bash
python3 scripts/viking.py add-dir /path/to/directory --pattern "*.md"Semantic search
语义搜索
bash
python3 scripts/viking.py search "query text" --limit 5bash
python3 scripts/viking.py search "query text" --limit 5Browse resources
浏览资源
bash
python3 scripts/viking.py ls [viking://resources/path]bash
python3 scripts/viking.py ls [viking://resources/path]Get summary
获取摘要
bash
python3 scripts/viking.py abstract viking://resources/my_doc
python3 scripts/viking.py overview viking://resources/my_docbash
python3 scripts/viking.py abstract viking://resources/my_doc
python3 scripts/viking.py overview viking://resources/my_docRead full content
读取完整内容
bash
python3 scripts/viking.py read viking://resources/my_doc/section.mdbash
python3 scripts/viking.py read viking://resources/my_doc/section.mdUsage Notes
使用注意事项
- Data directory: Defaults to in the current working directory. Override with
./openviking_data.--data-dir - File name collisions: OpenViking uses file names (not full paths) as URIs. Avoid indexing files with identical names from different directories simultaneously.
- VLM model: Use non-reasoning models (e.g. ) for the VLM. Reasoning models return content in the wrong field.
meta/llama-3.3-70b-instruct - Embedding model: (symmetric, 4096-dim) works without extra parameters. Asymmetric models (e.g.
nvidia/nv-embed-v1) requirenv-embedqa-e5-v5which OpenViking doesn't pass.input_type
- 数据目录:默认位于当前工作目录下的,可通过
./openviking_data参数覆盖。--data-dir - 文件名冲突:OpenViking使用文件名(而非完整路径)作为URI。请避免同时索引来自不同目录的同名文件。
- VLM模型:VLM请使用非推理模型(例如)。推理模型会返回错误字段的内容。
meta/llama-3.3-70b-instruct - Embedding模型:(对称模型,4096维度)无需额外参数即可使用。非对称模型(例如
nvidia/nv-embed-v1)需要nv-embedqa-e5-v5参数,但OpenViking不会传递该参数。input_type
When to Use Python API vs CLI Script
Python API与CLI脚本的适用场景
- CLI script (): For quick one-off operations from the shell.
scripts/viking.py - Python API: For complex workflows, batch operations, or integration into other scripts. See .
references/python-api.md
- CLI脚本():适用于在Shell中执行快速一次性操作。
scripts/viking.py - Python API:适用于复杂工作流、批量操作或集成到其他脚本中。详见。
references/python-api.md