OpenViking-rs
An Agent-native context database library for Rust.
Overview
OpenViking-rs is a Rust library that provides a context database specifically designed for AI agents. It enables efficient storage, retrieval, and management of contextual information that AI agents need to perform their tasks effectively.
This is a Rust port of the OpenViking project, reimplemented in pure Rust for better performance, memory safety, and easier integration with other Rust projects.
Features
- Virtual File System (VikingFS) - A virtual file system with Viking URI support (
viking://[scope]/[path]) - Three-Layer Context Storage - L0 (Abstract), L1 (Overview), L2 (Full Content)
- Vector Database - HNSW-based approximate nearest neighbor search with scalar filtering
- Session Management - Conversation tracking with memory extraction and deduplication
- Hierarchical Retrieval - Directory-recursive retrieval strategy with intent analysis
- File Parsing - Support for multiple file formats (text, markdown, code, PDF, Office documents)
- Async Processing Queue - Background embedding and semantic processing
- OVPack Import/Export - Package resources for sharing and backup
Installation
Add this to your Cargo.toml:
[]
= "0.1.0"
Feature Flags
pdf- Enable PDF parsing supportoffice- Enable Word/Excel/PowerPoint parsing supporthtml- Enable HTML parsing supportepub- Enable EPUB parsing supportfull- Enable all optional features
[]
= { = "0.1.0", = ["full"] }
Quick Start
Implement Required Traits
OpenViking-rs uses trait abstractions for embedding and VLM models, allowing you to integrate any provider:
use ;
use async_trait;
;
;
Using the Client
use ;
async
License
Licensed under the Apache License, Version 2.0. See LICENSE for details.
Acknowledgments
This project is a Rust implementation inspired by and ported from OpenViking.
We would like to express our sincere gratitude to:
- Volcengine Team - The original creators of OpenViking for their innovative design of an Agent-native context database
- OpenViking Contributors - All the developers who contributed to the original Python/C++ implementation
- Open Source Community - For the excellent Rust crates that made this port possible
If you use this library, please consider starring the original OpenViking repository to show your support for the original project.