kianajunjie/dsh-hippocampus ↗★ 2

dsh-hippocampus

给「大肥鱼」这类养成型 QQ 伴侣用的记忆层:事件编码、情绪加权遗忘、联想召回、关系与技能,还会承认自己记不清。Memory layers for a long-running companion bot.

パッケージ
dsh-hippocampus
互換性
未検証
バージョン
0.3.1
ライセンス
MIT
最終更新
2026/11/05

同名パッケージの別リポジトリ

インストール

$npx -p @deepseek-ai/dsh dsh plugin --profile web add github:kianajunjie/dsh-hippocampus

ドキュメント

README 全文を読む ↗

使用

直接调库

import { createHippocampus } from 'dsh-hippocampus'

const hip = await createHippocampus({ apiKey: process.env.DEEPSEEK_API_KEY })

// 每条消息
const r = await hip.handleTurn({ channel: 'qq', externalId: msg.user_id, text, reply })
// r.context → 塞进系统提示,r.recall → 召回结果

// 每天一次
await hip.replay()

HTTP 接口(任何语言)

import { createMemoryServer } from 'dsh-hippocampus/http'
await createMemoryServer({ hip, port: 7717, token: 'secret' })
curl -s localhost:7717/context -H 'authorization: Bearer secret' \
  -H 'content-type: application/json' \
  -d '{"channel":"telegram","externalId":"42","text":"我腿疼"}'

DSH 插件(im / 网页)

dsh plugin --profile web add github:kianajunjie/dsh-hippocampus

命令行

node cli.mjs demo                          # 不需要模型,先看效果
node cli.mjs encode --turns turns.json
node cli.mjs replay
node cli.mjs context --subject 主人 "我腿疼"
node cli.mjs list 20 | audit | stats

提示词怎么配:见 docs/prompt.md。多种接入方式:见 docs/integration.md。实测数据:见 docs/bench.md。