OpenViking’s Core Mechanism: From “Flat Vectors” to a “File System Paradigm”
Traditional Retrieval-Augmented Generation (RAG) techniques often face three major challenges in practice: First, text is split into independent “chunks,” leading to semantic isolation and loss of contextual relationships. Second, while retrieval based on vector similarity can increase recall, similarity does not equal relevance, and precision often suffers. Finally, after a conversation ends, the insights and knowledge gained during the interaction cannot be effectively retained, preventing the AI model from achieving structured learning.
The OpenViking framework aims to systematically address these challenges. Its core innovation lies in replacing the commonly used “flat vector database” with a “file system paradigm.” The framework maps all information sources—including documents, code, user preferences, and Agent skills—into a virtual file tree structure. Each information node is assigned a unique URI (Uniform Resource Identifier), such as viking://resources/report.pdf. This allows the AI to browse, locate, and operate on context just like an operating system, making the entire retrieval and reasoning process more structured, traceable, and debuggable.
L0/L1/L2 Three-Tiered Retrieval: Balancing Token Efficiency and Retrieval Accuracy
To solve the common issue of high token consumption when processing large documents, OpenViking has designed an L0/L1/L2 three-tiered context retrieval mechanism. This system mimics the human cognitive process of reading, moving from a general overview to specific details in a layered approach.
- L0 (Abstract): Approx. 100 tokens. Provides the highest-level summary of a node, like the blurb on a book cover, used to quickly determine if the material is relevant to the query’s intent.
- L1 (Overview): Approx. 2000 tokens. Offers a more detailed, structured overview, similar to a book’s table of contents or chapter summaries, for the AI to use as a basis for decision-making during the planning phase.
- L2 (Detail): The full original text. The full text is loaded only when the AI determines it is necessary to consult the source information, thus avoiding the inefficient feeding of entire documents.
This layered retrieval strategy significantly reduces the token cost of interacting with large language models. Especially when processing massive volumes of documents, reports, and books, it can markedly improve the system’s cost-effectiveness and response speed.
Recursive Directory Search and Conversational Memory Persistence
In terms of information retrieval strategy, OpenViking abandons the traditional method of brute-force searching across the entire database. Instead, it employs a more refined recursive directory search model. The process is as follows:
- Intent Analysis: First, the user’s query is analyzed to break it down into multiple parallel search conditions.
- Top-Level Localization: A vector search is performed on the top-level directories of the virtual file system to quickly pinpoint the most relevant “directory” nodes.
- Hierarchical Deep Dive: After entering a high-scoring directory, a second, more refined search is conducted. If the directory contains subdirectories, the process is executed recursively until the most relevant leaf nodes (specific files or paragraphs) are located.
- Result Aggregation: Finally, the system summarizes, ranks, and refines all candidate results to generate the final response.
Furthermore, OpenViking has the ability to automatically extract and persist memory after a conversation. The system writes discovered user preferences to the user/memories/ path and successful problem-solving experiences or reusable skills to the agent/memories/ path. This mechanism allows the Agent to gradually accumulate experience across multiple tasks, enabling a shift from a “stateless” to a “stateful and evolvable” model.
Application Boundaries: Defining the “Cold Data Layer” and “Hot Memory Layer”
Although OpenViking is powerful, it is not designed to handle all types of data. Its core strength lies in managing structured, long-form “cold data.” Indiscriminately ingesting all data can lead to system bloat and negate its design advantages.
The five types of materials best suited for OpenViking include:
- Long-form Documents: Such as industry reports, academic papers, and technical white papers.
- Clipping Collections: Large collections of articles, case studies, and web pages that require long-term archiving and retrieval.
- Books and Courses: E-books, course lectures, and user manuals that naturally have a chapter-based structure.
- Project and Code Assets: Code repositories containing READMEs, architecture documents, and design specifications.
- Topical Research Materials: Collections of various documents aggregated around a specific theme.

Data types not recommended for ingestion tend to be “hot memory,” such as frequently updated daily notes, fragmented personal thoughts, configuration files, or temporary logs. For this type of short, high-frequency, real-time content, using lightweight local quick-search tools like QMD is a more efficient choice.
Therefore, the best practice for building an efficient AI knowledge system is not to pursue a single “All-in-One” solution, but to adopt a layered strategy: use tools like QMD to build a fast-response “hot memory layer” for handling daily, high-frequency information, while using OpenViking as a stable, structured “cold data layer” responsible for managing and deeply leveraging large-scale knowledge assets. This “toolkit matrix” approach is the key to truly maximizing the value of different technologies.