OpenViking

nhan03bit2026-10-26查看 1667复制 1255

用于 AI 代理的 OpenViking 上下文数据库 — 文件系统范式上下文管理,具有分层加载 (L0/L1/L2)、分层检索和自动会话内存。用于代理上下文的平面 RAG 的替代/补充。

Download (.md)

📘如何使用这个技能

  1. 1
    复制技能内容·点击上方「Copy SKILL.md」复制全部内容,或 Download 下载到本地
  2. 2
    打开你的 AI 客户端·支持 Claude Code、Trae、Cursor、ChatGPT、DeepSeek、Kimi 等任意 AI 助手
  3. 3
    粘贴为系统提示/知识文件·Claude Code:放入 .claude/skills/ 目录;普通对话:作为首条消息发送并说「请严格按这份技能文档执行」
  4. 4
    直接提出你的需求·AI 会按技能定义的工作流、格式和约束来处理,无需再解释背景

💡 提示:技能生效后,每次对话只需一句需求,AI 会按 SKILL.md 的流程执行。

SKILL.md2813 chars
---
name: openviking
description: OpenViking context database for AI agents — filesystem-paradigm context management with tiered loading (L0/L1/L2), hierarchical retrieval, and automatic session memory. Alternative/complement to flat RAG for agent context.
triggers:
  - "context database"
  - "agent context"
  - "openviking"
  - "hierarchical context"
  - "viking context"
  - "context management agent"
  - "tiered context"
linksTo:
  - "rag"
  - "ai-agents"
  - "context-engineering"
---

# OpenViking — Context Database for AI Agents

> Open-source context management system using filesystem paradigm for AI agents.
> Source: https://github.com/volcengine/OpenViking | Stars: 6K+

## Core Concept

OpenViking treats agent context like a filesystem (`viking://` protocol):
- **L0**: One-sentence summary (always loaded)
- **L1**: ~2K token overview (loaded on demand)
- **L2**: Full details (loaded when deep dive needed)

Reduces token consumption vs loading full context every turn.

## Installation

```bash
pip install openviking --upgrade --force-reinstall
```

Requirements: Python 3.10+, Go 1.22+, C++ compiler

**Config** (`~/.openviking/ov.conf`):
```toml
[embedding]
provider = "openai"  # or volcengine, litellm

[vlm]
provider = "openai"
model = "gpt-4o"
```

## Key CLI Commands

```bash
# Add a resource to the context DB
ov add-resource ./docs/architecture.md --tags "architecture,backend"

# Search context
ov find "authentication patterns"
ov grep "database schema"

# Start VikingBot agent
ov bot start
```

## Architecture

```
viking://
├── memories/          # Session memories (auto-extracted)
├── resources/         # Documents, code, specs
├── skills/            # Agent capabilities
└── preferences/       # User/project preferences
```

## Tiered Retrieval Flow

1. Lock high-score directory (vector search over L0 summaries)
2. Refine: load L1 overviews of top directories
3. Zoom in: load L2 full content only when needed
4. Track: every retrieval trajectory is logged (transparent RAG)

## vs UltraThink Memory

| Feature | UltraThink | OpenViking |
|---------|-----------|-----------|
| Storage | Neon Postgres + pgvector | Filesystem + vector index |
| Retrieval | Category/scope SQL | Hierarchical directory |
| Context tiers | Single level | L0/L1/L2 progressive |
| Session mgmt | Custom hooks | Built-in auto-extract |
| Language | TypeScript | Python + Go |

## Integration Pattern

OpenViking can serve as the **resource/document** layer for UltraThink — store large reference docs in OpenViking for efficient tiered retrieval while UltraThink handles episodic memory (solutions, patterns, decisions).

```bash
# Index UltraThink skills into OpenViking
ov add-resource .claude/skills/ --recursive --tags "skills"
ov add-resource memory/src/ --tags "memory,typescript"
```
来源:skillsdirectory

评论0

登录后参与评论

还没有评论,来抢沙发吧