Downloads · 30 days
0
feiertu/hermes-association-engine
hermes-association-engine is a text generation model from feiertu. Use it when you need the model to write or continue text. It is set up for peft.
Downloads · 30 days
0
Access
Public
Updated Aug 9, 2026
Repo size
—
Likes
0
Public
Click a slice to open those files.
.py100 KB · 92%
From the Hugging Face model README
为任意 AI agent 提供基于 QLoRA 微调的隐式偏好学习能力。
Agent 推理时主动检索用户历史偏好并默认应用,减少重复沟通成本,同时作为多 agent 协作的共享偏好池。
| 机制 | 说明 |
|---|---|
| 联想 (Association) | 不等用户开口,主动检索历史偏好 → 注入推理上下文 |
| 动态语义聚类 | 偏好自动聚合为生活切面(scope),不预设类型和数量 |
| QLoRA 微调 | 闲时低资源训练,每个 scope 独立 LoRA 权重 |
| 维度递增约束 | 同 scope 内偏好描述精度必须递增,防止信息退化 |
Agent → CLI / Python SDK → Hermes Daemon (SQLite + QLoRA 训练沙箱)
pip install -e .
hermes init # 一键初始化(下载模型、验证环境)
hermes demo # 交互演示
hermes start # 后台启动 daemon
from hermes_core import HermesClient
client = HermesClient(user_id="u_alex", agent_id="my-agent")
# 推理前查询偏好
prefs = client.query("帮我写个用户登录接口")
# Agent 自主记录偏好
client.record("后端开发", [
{"key": "language", "value": "TypeScript", "context": "默认语言"},
{"key": "framework", "value": "Express", "context": "默认框架"},
])
# 记录偏好
hermes record --user u_alex --scope-desc "后端开发" \
--dimensions '[{"key":"language","value":"TypeScript"}]'
# 查询偏好
hermes query --user u_alex --text "帮我写个API"
# 查看状态
hermes status
每个 scope 独立训练 LoRA 适配器,基于 Qwen/Qwen2.5-7B-Instruct:
# 手动触发训练
hermes train --user u_alex --scope <scope_id>
# 或让 daemon 闲时自动训练
hermes start
训练完成后,LoRA 权重保存在 ~/.hermes/data/users/{user_id}/checkpoints/{scope_id}/v{version}/。
hermes/
├── hermes_core/ # 核心逻辑(Python SDK)
├── cli/ # Click 命令行壳
├── daemon/ # 后台训练守护进程
├── tests/ # 40 个单元测试全部通过
└── pyproject.toml