volcengine / OpenViking
OpenViking: The Context Database for AI Agents
OpenViking: AI 智能体的上下文数据库
OpenViking is an open-source context database for AI agents. It stores memories, resources, and skills as one virtual filesystem under the viking:// protocol, so an agent browses its own context with ls, tree, and find instead of querying a black-box vector store. Content is processed into three tiers — L0 abstract, L1 overview, L2 details — and loaded on demand. Every retrieval leaves a trajectory you can watch and debug.
OpenViking 是一个面向 AI 智能体的开源上下文数据库。它将记忆、资源和技能存储在 viking:// 协议下的统一虚拟文件系统中,使智能体能够通过 ls、tree 和 find 等命令浏览自身的上下文,而无需查询黑盒向量数据库。内容被处理为三个层级(L0 摘要、L1 概览、L2 详情)并按需加载。每一次检索都会留下可供观察和调试的轨迹。
Why OpenViking / 为什么选择 OpenViking
- One filesystem for all context. Memories, resources, and skills each get a
viking://URI. Agents locate and manipulate context deterministically, like a developer working with files. 统一的上下文文件系统。 记忆、资源和技能均拥有各自的viking://URI。智能体可以像开发者操作文件一样,确定性地定位和操作上下文。 - Tiered loading cuts token spend. Every entry is processed into L0 (abstract), L1 (overview), and L2 (details) on write, then loaded only as deep as the task requires. 分层加载降低 Token 消耗。 每条条目在写入时都会被处理为 L0(摘要)、L1(概览)和 L2(详情),系统仅根据任务需求加载相应深度的数据。
- Directory recursive retrieval. Vector search first locates the highest-scoring directory, then drills down layer by layer, so results arrive with their surrounding context intact. 目录递归检索。 向量搜索首先定位得分最高的目录,然后逐层深入,确保返回的结果保留其完整的上下文环境。
- Observable retrieval. Each query preserves its directory-browsing trajectory. When a result looks wrong, you can see exactly which path produced it. 可观测的检索。 每次查询都会保留其目录浏览轨迹。当结果出现偏差时,你可以清晰地看到是哪条路径产生了该结果。
- Sessions become memory. After a session commits, OpenViking asynchronously extracts user preferences and agent experience into long-term memory. 会话转化为记忆。 会话提交后,OpenViking 会异步提取用户偏好和智能体经验,并将其存入长期记忆中。
The three loading tiers / 三个加载层级
- L0 (Abstract): a one-sentence summary for quick relevance checks. L0(摘要): 一句话总结,用于快速判断相关性。
- L1 (Overview): core information and usage scenarios for planning. L1(概览): 核心信息和使用场景,用于任务规划。
- L2 (Details): the full original data, read only when needed. L2(详情): 完整的原始数据,仅在需要时读取。
Proof it works / 性能验证
OpenViking 0.3.22 has been evaluated on long-conversation user memory (LoCoMo) and multi-turn agent tasks (tau2-bench). OpenViking 0.3.22 已在长对话用户记忆(LoCoMo)和多轮智能体任务(tau2-bench)中进行了评估。
- User memory (LoCoMo): with OpenViking, all three agent integrations land at 80–83% accuracy — up from 24–57% on their native memory — while input tokens drop by 34.3–91.0% and query latency by 58.45–66.10%. 用户记忆(LoCoMo): 使用 OpenViking 后,三种智能体集成的准确率均达到 80–83%(原生记忆仅为 24–57%),同时输入 Token 减少了 34.3–91.0%,查询延迟降低了 58.45–66.10%。
- Agent experience (tau2-bench): experience memory lifts task success by +6.87pp (retail) and +11.87pp (airline) over the same LLM without memory. 智能体经验(tau2-bench): 相比没有记忆的同款大模型,经验记忆使零售任务成功率提升了 6.87 个百分点,航空任务提升了 11.87 个百分点。
Quick start / 快速开始
Requires Python 3.10 or higher. 需要 Python 3.10 或更高版本。
pip install openviking --upgrade
openviking-server init # 交互式向导:配置提供商、模型、ov.conf
openviking-server doctor # 验证设置
openviking-server # 启动服务
init walks you through provider setup and writes ~/.openviking/ov.conf. It supports Volcengine, OpenAI, Codex OAuth, Kimi, GLM, and local Ollama.
init 会引导你完成提供商设置并生成 ~/.openviking/ov.conf 文件。它支持火山引擎(Volcengine)、OpenAI、Codex OAuth、Kimi、GLM 以及本地 Ollama。
Use it with your agent / 在你的智能体中使用
Integrations inject OpenViking recall into your agent’s context and auto-commit session memory: 通过集成,你可以将 OpenViking 的检索能力注入到智能体的上下文中,并自动提交会话记忆:
- Claude Code / Codex / OpenClaw / Hermes
- Cursor / TRAE / TRAE CN / TraeCode CLI 2.0
- OpenCode / pi / Agent Plugins 1.0 / MCP clients
- LangChain / LangGraph