hermes 外部记忆openviking服务端embedding模型使用llama.cpp

📅 2026/7/27 13:51:59
hermes 外部记忆openviking服务端embedding模型使用llama.cpp
环境Win11WSL2Ubuntu24.04openviking-server --versionopenviking-server 0.4.10ov --helpOpenViking v0.4.11.dev0一、相关文档记忆提供程序Memory Providersopenviking简介openviking快速开始在线服务OpenViking Service火山引擎云产品介绍二、备份数据停止服务CtrlC 或pkill -f openviking-server备份数据目录cp -r ~/.openviking/data ~/.openviking/data_backup_volc_embedding三、切换embedding模型doubao-embedding-vision新版本Seed-1.6-embedding图文多模态向量化模型全新上线主要面向图文多模向量检索的使用场景支持图片输入及中、英双语文本输入最长 8K 上下文长度。输入文本、图片、视频openviking不支持其他厂商嵌入模型的多模态能力bge-small-zh-v1.5-f16FlagEmbedding 能够将任意文本映射为低维稠密向量可用于检索、分类、聚类、语义搜索等任务同时也可配合大语言模型应用于向量数据库场景中。openviking-server init操作uadminPC26:~$ openviking-server init ╭─────────────────────────────────────────────────────────╮ │ OpenViking Setup │ │ Context database for AI agents — data in, context out │ ╰─────────────────────────────────────────────────────────╯ Data will be stored under /home/uadmin/.openviking/data unless you edit ov.conf later. Existing config found: /home/uadmin/.openviking/ov.conf Current configuration Embedding: ollama · qwen3-embedding-cpu:0.6b (1024d) VLM: litellm · ollama/qwen3.6:35b Query planner: litellm · ollama/guoxuter/ov_intent_analysis_sft:v7_q8 Server: 127.0.0.1:1933 · auth dev (no auth) What would you like to do? ↑/↓ move · enter select ❯ Start over (full setup, current config backed up as .bak) Update VLM (now: litellm · ollama/qwen3.6:35b) Update embedding (now: ollama · qwen3-embedding-cpu:0.6b (1024d)) Update server auth (now: 127.0.0.1:1933 · auth dev (no auth)) Cancel 选择Update embedding --------------------------------------------------------------------------------------- ❯ Update embedding Current embedding: ollama · qwen3-embedding-cpu:0.6b (1024d) Embedding setup: ↑/↓ move · enter select Cloud API (VolcEngine, BytePlus, OpenAI) ❯ Local via Ollama (no API key, runs on this machine) Lightweight CPU embedding (llama.cpp, ~24 MB, no Ollama needed) 选择Lightweight CPU embedding --------------------------------------------------------------------------------------- ❯ Lightweight CPU embedding Checking llama-cpp-python... not installed llama-cpp-python is required for local CPU embedding. Install now? (pip install openviking[local-embed]) [Y/n]: 输入Y --------------------------------------------------------------------------------------- Install now? (pip install openviking[local-embed]) [Y/n]: Y /home/uadmin/.local/share/uv/tools/openviking/bin/python: No module named pip Native build failed, retrying with generic CPU flags... /home/uadmin/.local/share/uv/tools/openviking/bin/python: No module named pip Installation failed. Try manually: pip install openviking[local-embed] Continue anyway? (config will be generated) [y/N]: 输入N --------------------------------------------------------------------------------------- Continue anyway? (config will be generated) [y/N]: N Setup cancelled.安装系统编译依赖llama-cpp-python 编译需要sudo apt update sudo apt install -y build-essential cmake用 uv 原生方式安装本地嵌入依赖直接用 uv 给 OpenViking 工具环境添加 local-embed 额外依赖uv 会自动处理安装不需要 pipuv tool install --reinstall openviking[local-embed]说明--reinstall 会保留你原有配置仅补充安装额外依赖包包括 llama-cpp-python。另一种安装方法手动给 openviking 的 uv 环境安装依赖uv pip install --python ~/.local/share/uv/tools/openviking/bin/python openviking[local-embed]重新执行openviking-server init❯ Lightweight CPU embedding Checking llama-cpp-python... installed Embedding model: ↑/↓ move · enter select ❯ BGE-small-zh v1.5 (f16) (512d, ~24 MB) 选择BGE-small-zh v1.5 (f16) --------------------------------------------------------------------------------------- ❯ BGE-small-zh v1.5 (f16) Model bge-small-zh-v1.5-f16 not downloaded yet. Download now? (~24 MB) [Y/n]: 输入Y --------------------------------------------------------------------------------------- Model bge-small-zh-v1.5-f16 not downloaded yet. Download now? (~24 MB) [Y/n]: Y Downloading... --------------------------------------------------------------------------------------- Model bge-small-zh-v1.5-f16 not downloaded yet. Download now? (~24 MB) [Y/n]: Y Download failed: HTTPSConnectionPool(hosthuggingface.co, port443): Max retries exceeded with url: /CompendiumLabs/bge-small-zh-v1.5-gguf/resolve/main/bge-small-zh-v1.5-f16.gguf?downloadtrue (Caused by NewConnectionError(HTTPSConnection(hosthuggingface.co, port443): Failed to establish a new connection: [Errno 101] Network is unreachable)) Model will be auto-downloaded on first server start. Embedding dimension changes from 1024 to 512. Existing vector indexes become unusable — data must be re-ingested. Continue? [y/N]: 网络报错先输入N --------------------------------------------------------------------------------------- Continue? [y/N]: N Setup cancelled.重新执行openviking-server init打开网络代理Model bge-small-zh-v1.5-f16 not downloaded yet. Download now? (~24 MB) [Y/n]: Y Downloading... --------------------------------------------------------------------------------------- Model bge-small-zh-v1.5-f16 not downloaded yet. Download now? (~24 MB) [Y/n]: Y OK Model downloaded to /home/uadmin/.cache/openviking/models/bge-small-zh-v1.5-f16.gguf Embedding dimension changes from 1024 to 512. Existing vector indexes become unusable — data must be re-ingested. Continue? [y/N]: 输入y --------------------------------------------------------------------------------------- Continue? [y/N]: y Change: ollama · qwen3-embedding-cpu:0.6b (1024d) → local · bge-small-zh-v1.5-f16 (512d) Save configuration? [Y/n]: 输入Y --------------------------------------------------------------------------------------- Save configuration? [Y/n]: Y Existing config backed up to /home/uadmin/.openviking/ov.conf.bak.5 OK Configuration updated Validate the setup now? (runs openviking-server doctor) [Y/n]: 输入Y --------------------------------------------------------------------------------------- Validate the setup now? (runs openviking-server doctor) [Y/n]: Y OpenViking Doctor Config: PASS /home/uadmin/.openviking/ov.conf Python: PASS 3.11.15 ( 3.10 required) Native Engine: PASS variantx86_avx2 AGFS: PASS AGFS SDK 0.1.7 Embedding: PASS local/bge-small-zh-v1.5-f16 (/home/uadmin/.cache/openviking/models/bge-small-zh-v1.5-f16.gguf) VLM: PASS litellm/ollama/qwen3.6:35b Ollama: PASS running at localhost:11434 VikingBot: PASS VikingBot aligned with dev OpenViking auth Disk: PASS 947.5 GB free in /home/uadmin/.openviking/data All checks passed. Start the server now? [y/N]: 输入N手动启动 --------------------------------------------------------------------------------------- Start the server now? [y/N]: N配置文件ov.conf~/.openviking/ov.confembedding: { dense: { provider: local, model: bge-small-zh-v1.5-f16, dimension: 512 } },更换嵌入模型后向量数据需要处理。如果是少量测试数据可以清理了。如果想保留数据可以重建向量数据。四、清理向量数据停止服务CtrlC 或pkill -f openviking-server备份数据目录cp -r ~/.openviking/data ~/.openviking/data_backup_volc_embedding删除目录rm -rf ~/.openviking/data/*#mv ~/.openviking/data ~/.openviking/data1重启服务会生成data目录openviking-server五、处理向量数据启动服务openviking-server日志报错openviking.storage.errors.EmbeddingRebuildRequiredError: Existing collection embedding dimension (1024) does not match current configuration (512). Vectors are incompatible; rebuild is required.删除向量数据库目录rm -rf ~/.openviking/data/vectordb再次启动服务openviking-server重建向量数据看根目录有什么ov ls viking:///uadminUD26:~$ ov ls viking:/// cmd: ov ls viking:/// -l 256 -n 256 1. dir · 2026-07-27 06:28 viking://resources 本目录是 Hermes Agent 框架的核心文档集合专注于指导开发者构建具备长期记忆能力和复杂推理能力的智能 Agent... 2. dir · 2026-07-27 06:52 viking://user This directory serves as the central hub for the user component within a sophisticated AI assistant framework. The primary focus is on managing persistent user identity, ensuring secu...# 1. 重建全局资源库的向量手动导入的文档、素材、公共资源ov reindex viking://resources/ --mode vectors_only --wait true# 2. 重建默认用户的所有对话记忆与个人数据的向量ov reindex viking://user/default/ --mode vectors_only --wait trueuadminUD26:~$ ov reindex viking://resources/ --mode vectors_only --wait true status completed uri viking://resources object_type resource mode vectors_only scanned_records 12 rebuilt_records 17 deleted_records 0 would_delete_records 0 unsupported_records 0 failed_records 0 duration_ms 6528 warnings [] uadminUD26:~$ ov reindex viking://user/default/ --mode vectors_only --wait true status completed uri viking://user/default object_type user_namespace mode vectors_only scanned_records 34 rebuilt_records 36 deleted_records 0 would_delete_records 0 unsupported_records 0 failed_records 0 duration_ms 11923 warnings []测试ov find 测试标记uadminUD26:~$ ov find 测试标记 cmd: ov find --uri -n 10 测试标记 9 results Ranked by relevance · limit 10 final results 1. memory · Level 2 · score 0.565 viking://user/default/memories/preferences/2026/07/24/凌晨开发_openviking-20260724.md 测试标记为 openviking-20260724开发者凌晨仍在开发中。 2. memory · Level 2 · score 0.467 viking://user/default/memories/experiences/viking_search验证开发环境记忆.md ## Situation - 用户要求使用viking_search工具搜索开发环境相关内容验证新存储记忆的语义检索有效性 ## Approach - 调用viking_search工具传入开发环境相关的搜索关键词 -... 3. memory · Level 1 · score 0.459 viking://user/default/memories/cases/.overview.md No abstract available. ...ov find --help重新生成语义摘要和重建向量索引一般重建向量数据即可不用重建语义摘要。# 1. 全局资源库重新生成语义摘要 重建向量索引ov reindex viking://resources/ --mode semantic_and_vectors --wait true# 2. 默认用户记忆库重新生成语义摘要 重建向量索引ov reindex viking://user/default/ --mode semantic_and_vectors --wait trueuadminPC26:~$ ov reindex viking://resources/ --mode semantic_and_vectors --wait true status completed uri viking://resources object_type resource mode semantic_and_vectors scanned_records 12 rebuilt_records 17 deleted_records 0 would_delete_records 0 unsupported_records 0 failed_records 0 duration_ms 48866 warnings [] # 这句命令更容易报错 uadminPC26:~$ ov reindex viking://user/default/ --mode semantic_and_vectors ov reindex viking://user/default/ --mode semantic_and_vectors ╭─ Request Timeout ────────────────────────────────────────────────────╮ │ OpenViking did not respond before the configured timeout expired. │ ╰──────────────────────────────────────────────────────────────────────╯ Next: ov config Increase the request timeout ov config show Show the active configopenviking-server日志报错[07/27/26 06:51:58] ERROR Task was destroyed but it is pending! base_events.py:1785 task: Task pending nameTask-1659 coroLoggingWorker._worker_loop() done, defined at /home/uadmin/.local/share/uv/tools/openviking/lib/python3.11/site-packages/litellm/litellm_core_utils/logging_worker.py:109 wait_forFuture cancelled问题分析可能是Ollama压力稍大处理不过来适当调整配置Ollma环境变量# 允许同时处理 2 个推理请求VLM 与嵌入任务并行执行避免完全串行排队OLLAMA_NUM_PARALLEL2# 允许 2 个模型同时常驻显存避免 VLM 和嵌入模型来回加载卸载OLLAMA_MAX_LOADED_MODELS2# 开启 FlashAttention 硬件加速降低显存占用、提升推理速度OLLAMA_FLASH_ATTENTION1ollama serve重启Ollama启动日志能看见这个几个变量ov.conf配置vlm模型从num_ctx: 16384改到8192重启服务后来又改回去了再次执行如果openviking-server日志里有报错ov命令执行成功了可以接受。测试ov findov find 测试标记 -u viking://user/default