Skip to main content
OpenViking uses a three-layer information model (L0/L1/L2) to balance retrieval efficiency and content completeness. This design enables progressive detail loading, significantly reducing token consumption while maintaining context quality.

Overview

L0: Abstract

~100 tokensQuick filtering and vector search

L1: Overview

~2k tokensContent navigation and rerank

L2: Detail

UnlimitedFull content, on-demand loading

L0: Abstract

The most concise representation of content, used for vector retrieval and quick filtering.

Characteristics

  • Ultra-short: Maximum ~100 tokens
  • Quick perception: Allows Agent to quickly perceive content relevance
  • Vectorized: Used for semantic search in vector index
  • Always text: Even for multimedia content, L0 is text description

Example: Documentation Abstract

Example: Code File Abstract

API Usage

L1: Overview

Comprehensive summary with navigation guidance, used for rerank and understanding access methods.

Characteristics

  • Moderate length: ~1-2k tokens
  • Navigation guide: Tells Agent how to access detailed content
  • Structural information: Describes subdirectories and file organization
  • Usage hints: Provides guidance on when to load L2 details

Example: Documentation Overview

Example: Code Module Overview

API Usage

L2: Detail

Complete original content, loaded only when needed.

Characteristics

  • Full content: No token limit, preserves all information
  • On-demand loading: Read only when confirmed necessary through L0/L1
  • Original format: Preserves source structure and formatting
  • Multimodal: Can be text, image, video, audio, or binary files

Example: Full Documentation

GET /oauth/authorize? response_type=code& client_id=YOUR_CLIENT_ID& redirect_uri=YOUR_REDIRECT_URI& scope=read write

API Usage

Generation Mechanism

L0 and L1 layers are automatically generated by OpenViking’s semantic processing system.

When Generated

When adding resources, L0/L1 are generated asynchronously:
  1. Parser parses document and creates directory structure
  2. TreeBuilder moves files to AGFS and enqueues semantic processing
  3. SemanticQueue processes bottom-up, generating L0/L1 for each directory
  4. Vector Index stores L0/L1 vectors for semantic search

Who Generates

Generation Order

Bottom-up aggregation: Child directory L0s are aggregated into parent L1, forming hierarchical navigation.
1

Process Leaf Nodes

Generate L0/L1 for individual files at the deepest level
2

Aggregate to Parent

Collect child abstracts and generate parent directory L0/L1
3

Recursive Upward

Continue aggregating up the directory tree
4

Complete at Root

Final root directory L0/L1 provides project-level overview

Directory Structure

Each directory follows a unified file structure:
Special files starting with . are system-managed:
  • .abstract.md - Auto-generated L0 summary
  • .overview.md - Auto-generated L1 overview
  • .relations.json - System-managed relations
  • .meta.json - System metadata
Do not manually edit these files.

Multimodal Support

OpenViking supports multimodal content with text-based L0/L1 descriptions.

Text Content

  • L0/L1: Generated from text content
  • L2: Original text file

Multimedia Content

For binary content (images, videos, audio), L0/L1 describe in text:

Best Practices

When you need to quickly filter relevant contexts from search results:
When you need to understand what a resource contains before loading:
Only load L2 when you need the complete content:
L1 is usually sufficient for building context:

Token Budget Management

Implementation Details

Architecture

System architecture and data flow

Context Types

Resource, Memory, and Skill types

Viking URI

URI specification and structure

Extraction

L0/L1 generation details