OpenViking brings filesystem-based memory management to AI agents with tiered context loading and self-evolving memory. This skill guides you through installation and configuration.
bash
# Python package
pip install openviking --upgrade --force-reinstall
# CLI tool
curl -fsSL https://raw.githubusercontent.com/volcengine/OpenViking/main/crates/ov_cli/install.sh | bash
Create ~/.openviking/ov.conf:
json
{
"storage": {
"workspace": "/home/your-name/openviking_workspace"
},
"log": {
"level": "INFO",
"output": "stdout"
},
"embedding": {
"dense": {
"api_base": "https://api.openai.com/v1",
"api_key": "your-openai-api-key",
"provider": "openai",
"dimension": 1536,
"model": "text-embedding-3-small"
},
"max_concurrent": 10
},
"vlm": {
"api_base": "https://api.openai.com/v1",
"api_key": "your-openai-api-key",
"provider": "openai",
"model": "gpt-4o",
"max_concurrent": 100
}
}
OpenViking supports multiple VLM providers:
ProviderModel ExampleNotesopenaigpt-4oOfficial OpenAI APIvolcenginedoubao-seed-2-0-proVolcengine Doubaolitellmclaude-3-5-sonnetUnified access (Anthropic, DeepSeek, Gemini, etc.)
For LiteLLM (recommended for flexibility):
json
{
"vlm": {
"provider": "litellm",
"model": "claude-3-5-sonnet-20241022",
"api_key": "your-anthropic-key"
}
}
For Ollama (local models):
json
{
"vlm": {
"provider": "litellm",
"model": "ollama/llama3.1",
"api_base": "http://localhost:11434"
}
}
OpenViking has a native OpenClaw plugin for seamless integration:
bash
# Install OpenClaw plugin
pip install openviking-openclaw
# Or from source
git clone https://github.com/volcengine/OpenViking
cd OpenViking/plugins/openclaw
pip install -e .
Add to your OpenClaw config:
yaml
# ~/.openclaw/config.yaml
memory:
provider: openviking
config:
workspace: ~/.openviking/workspace
tiers:
l0:
max_tokens: 4000
auto_flush: true
l1:
max_tokens: 16000
compression: true
l2:
max_tokens: 100000
archive: true
TierPurposeToken BudgetBehaviorL0Active working memory4K tokensAlways loaded, fast accessL1Frequently accessed16K tokensCompressed, on-demandL2Archive/cold storage100K+ tokensSemantic search only
text
~/.openviking/
├── ov.conf # Configuration
└── workspace/
├── memories/
│ ├── sessions/ # L0: Active session memory
│ ├── compressed/ # L1: Compressed memories
│ └── archive/ # L2: Long-term storage
├── resources/ # Files, documents, assets
└── skills/ # Skill-specific context
python
from openviking import MemoryStore
store = MemoryStore()
# Add to L0
store.add_memory(
content="User prefers Portuguese language responses",
metadata={"tier": "l0", "category": "preference"}
)
# Add resource
store.add_resource(
path="project_spec.md",
content=open("project_spec.md").read()
)
python
# Semantic search across all tiers
results = store.search(
query="user preferences",
tiers=["l0", "l1", "l2"],
limit=10
)
# Directory-based retrieval (more precise)
results = store.retrieve(
path="memories/sessions/2026-03-16/",
recursive=True
)
python
# Trigger manual compaction
store.compact()
# View compaction status
status = store.status()
print(f"L0: {status.l0_tokens}/{status.l0_max}")
print(f"L1: {status.l1_tokens}/{status.l1_max}")
"No module named 'openviking'"
pip install --user openviking"Embedding model not found"
ov.conf has correct provider and model"L0 overflow"
l0.max_tokens in configstore.compact()"Slow retrieval from L2"
After setup, your agent gains:
The more your agent works, the more context it retains—without token bloat.