Weil Jimmer's BlogWeil Jimmer's Blog


[筆記] 使用 Docker Compose 安裝 Hindsight 替 Hermes Agent 建立記憶庫

-
更新於 2026-05-07 18:55:33

前言

這次就懶得打那麼多廢話了,簡單來說就是替 AI Agent 的記憶上強度,原本 只有 MEMORY.md 還是太廢了,更不用說 Hermes Agent 預設值 2200 字元,根本塞不了太長的記憶,隨著時間增長,記憶也會變成問題,假設加大這個數量,那麼注入提詞的 Token 也會變長,導致 Profilling 變得很重要,總之還是拖慢效能。

最好的辦法是安裝一個 Memory Provider,寫這篇文章是因為遇到了坑,不寫怕忘記。套件軟體官網就有教學了,但不詳細。

安裝套件

我採用 Docker compose,直接上文件:

docker-compose.yml


services:
  hindsight-api:
    image: ghcr.io/vectorize-io/hindsight:latest
    pull_policy: always
    ports:
      - "8888:8888"   # API
      - "9900:9999"   # UI (原9999改為9900,右邊容器內port不動)
    environment:
      # === LLM 設定:指向本機 llama.cpp ===
      - HINDSIGHT_API_EMBEDDINGS_PROVIDER=local
      - HINDSIGHT_API_EMBEDDINGS_LOCAL_MODEL=BAAI/bge-small-en-v1.5
      - HINDSIGHT_API_LLM_PROVIDER=openai
      - HINDSIGHT_API_LLM_BASE_URL=http://192.168.100.100:9999/v1
      - HINDSIGHT_API_LLM_API_KEY=local-llama
      - "HINDSIGHT_API_LLM_MODEL=llmfan46/Qwen3.6-35B-A3B-uncensored-heretic-NVFP4-Experts-Only-GGUF:NVFP4"
      - HINDSIGHT_API_LLM_TIMEOUT=600
      # 關閉 Qwen3 thinking mode,避免 token 被內部推理吃光
      - 'HINDSIGHT_API_LLM_EXTRA_BODY={"chat_template_kwargs": {"enable_thinking": false}}'
      # 跳過啟動時的 LLM verification
      - HINDSIGHT_API_SKIP_LLM_VERIFICATION=true
    volumes:
      - hindsight_pg:/home/hindsight/.pg0
    extra_hosts:
      - "host.docker.internal:host-gateway"
    restart: unless-stopped
volumes:
  hindsight_pg:

要關 Thinking 真的是一個坑。誰知道要關阿!試錯老半天。模型名稱也是,建議加雙引號,避免傳遞變量問題。

然後設定好內網的 llama.cpp 的 API 地址。

接下來就簡單了,直接 docker compose up 就搞定。

配置 Hermes Agent

這個就照官方的教學,沒啥問題。

hermes memory setup 照著步驟往下走。

分享一下我設定的 config:

/home/user/.hermes/hindsight

{
  "mode": "local_external",
  "apiKey": "",
  "timeout": 120,
  "idle_timeout": 300,
  "retain_tags": "",
  "retain_source": "",
  "retain_user_prefix": "USER",
  "retain_assistant_prefix": "ME",
  "banks": {
    "ariel": {
      "bankId": "ariel",
      "budget": "mid",
      "enabled": true
    }
  },
  "api_url": "http://192.168.100.100:8888",
  "bank_id": "ariel",
  "recall_budget": "mid"
}

bank_id 就是你想建立的記憶庫名稱,我取名為我自己的 AI Agent 的英文名字,然後小修改了一些東西。

大功告成

做到這一步,重啟 hermes gateway 應該就能 work 了。

為何選用這套件?

原本有嘗試用 Open Viking,後來發現它對 Hermes Agent 的支持感覺有點差,只提供工具,問題是 AI 不一定會主動調用工具查詢記憶,我認為主動注入記憶是很重要的,所以專門挑能夠本地架設,又能夠自動化注入記憶的套件,這套就是其中之一。

我嘗試的工具其實滿少的,原本也有考慮 Honcho,最好還是選擇了有 auto_recall 的 Hindsight。感覺整合起來會比較好。

每輪對話中會自動化注入記憶,AI Agent 也能用工具主動查詢、保存記憶,感覺不錯,而且還有原生 Web UI 查看記憶,非常好。

By Weil Jimmer


This entry was posted in AI-Agent, DGX, Experience, Note By Weil Jimmer.

About Weil Jimmer

avatar

Hi! Everyone! My name is Weil Jimmer. This is my personal blog. I'm a webmaster of this site. I hope the site will be popular. Now, Let's go! Enjoy gaining more knowledge.
More Details About Me : https://weils.net/profile.php

Leave a Reply

Name*:

Email*:

Website:

Privacy:   

Comment*:

Visitor Count

pop
nonenonenone

Note

不要和愚蠢的人發生爭執。

支持網路中立性.
Support Net Neutrality.

支持臺灣實施
無條件基本收入

歡迎前來本站。

Quotes

我一定會老。

我一定會病。

我一定會死。

人生終須一別。

我們是業的主人。

Search

Music

Life Counter

22760days



Breaths between now and when I die.

Blogging Journey

4997days

since our first blog post.

Words Quiz


Quotes

The strong do what they can and the weak suffer what they must.

Privacy is your right and ability to be yourself and express yourself without the fear that someone is looking over your shoulder and that you might be punished for being yourself, whatever that may be.

It is quality rather than quantity that matters.

I WANT Internet Freedom.

Reality made most of people lost their childishness.

Justice,Freedom,Knowledge.

Without music life would be a mistake.

Support/Donate

This site also need a little money to maintain operations, not entirely without any cost in the Internet. Your donations will be the best support and power of the site.
MethodBitcoin Address
bitcoin1gtuwCjjVVrNUHPGvW6nsuWGxSwygUv4x
buymeacoffee
Register in linode via invitation link and stay active for three months.Linode

Support The Zeitgeist Movement

The Zeitgeist Movement

The Lie We Live

The Lie We Live

The Questions We Never Ask

The Questions We Never Ask

Man

Man

THE EMPLOYMENT

Man

In The Fall

In The Fall

Categories

AI-Agent (1)

Android (8)

Announcement (4)

Arduino (2)

Bash (2)

C (3)

C# (5)

C++ (1)

DGX (2)

Experience (58)

Flash (2)

Free (13)

Functions (36)

Games (13)

General (67)

Git (3)

HTML (7)

Java (13)

JS (7)

Mood (24)

NAS (2)

Note (38)

Office (1)

OpenWrt (8)

PHP (9)

Privacy (5)

Product (12)

Python (4)

Software (11)

The Internet (28)

Tools (18)

VB.NET (8)

VR (1)

WebHosting (7)

Wi-Fi (5)

XML (4)