Skip to content

Repository files navigation

Hermes — 联想引擎

为任意 AI agent 提供基于 QLoRA 微调的隐式偏好学习能力。

Agent 推理时主动检索用户历史偏好并默认应用,减少重复沟通成本,同时作为多 agent 协作的共享偏好池。

核心机制

  • 联想:不等用户开口,主动检索历史偏好 → 注入推理上下文
  • 动态语义聚类:偏好自动聚合为生活切面(scope),不预设类型和数量
  • QLoRA 微调:闲时低资源训练,每个 scope 独立 LoRA 权重
  • 维度递增约束:同 scope 内偏好描述精度必须递增

快速开始

pip install -e .
hermes --help
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": "默认语言"}
])

架构

Agent → CLI / Python SDK → Hermes Daemon (SQLite + QLoRA 训练沙箱)
  • hermes_core/ — 核心 Python SDK
  • cli/ — Click 命令行壳
  • daemon/ — 后台训练守护进程

License

MIT

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages