← 返回
未分类 中文

Lineage Code Mini

Behavioral adaptation for AI agents. Builds a lightweight user profile from interaction history and adapts response style, topic focus, timing, and recovery...
AI代理的行为适配:根据交互历史构建轻量级用户画像,动态调整回复风格、话题焦点、时机以及恢复策略。
pablothethinker pablothethinker 来源
未分类 clawhub v0.1.3 1 版本 100000 Key: 无需
★ 0
Stars
📥 319
下载
💾 0
安装
1
版本
#latest

概述

Lineage Code Mini — Behavioral Adaptation Skill

You have access to lineage-code-mini, a behavioral adaptation engine. It learns how each user likes to be talked to and adapts your responses accordingly.

Links

  • GitHub source: https://github.com/PabloTheThinker/lineage-code-mini
  • npm package: https://www.npmjs.com/package/lineage-code-mini
  • ClawHub listing: https://clawhub.ai/pablothethinker/lineage-mini

How It Works

  1. Record — after each conversation, record whether the user engaged positively
  2. Compactify — compress interaction history into a behavioral profile
  3. Adapt — inject the profile into your system prompt before responding

Commands

/lineage or /profile — View a user's behavioral profile

Run the adaptation pipeline on the current user's conversation history:

node --input-type=module -e "
import { compactify, DEFAULT_CONFIG } from 'lineage-code-mini';
import { existsSync, readFileSync } from 'node:fs';
const historyPath = '{baseDir}/data/interactions.json';
const history = existsSync(historyPath) ? JSON.parse(readFileSync(historyPath, 'utf8')) : [];
const profile = compactify('current-user', history, DEFAULT_CONFIG);
console.log(JSON.stringify(profile, null, 2));
"

/adapt — Generate behavioral hints for the current user

node --input-type=module -e "
import { pipeline } from 'lineage-code-mini';
import { existsSync, readFileSync } from 'node:fs';
const historyPath = '{baseDir}/data/interactions.json';
const history = existsSync(historyPath) ? JSON.parse(readFileSync(historyPath, 'utf8')) : [];
const basePrompt = 'You are a helpful AI assistant.';
const { context, profile } = pipeline('current-user', history, basePrompt);
console.log('Active patterns:', context.active_patterns);
console.log('Fitness:', context.fitness);
console.log('Personalized:', context.personalized);
console.log('---');
console.log(context.prompt);
"

Automatic Adaptation

This skill provides the commands and storage layout. Your host agent still needs to call these commands or wire recording into its turn loop. Installation alone does not automatically capture conversations.

When this skill is loaded, you should:

  1. Before each response, check if a user profile exists at {baseDir}/data/profiles/. If it does, read it and apply the behavioral hints to your response style.
  1. After each conversation turn, record the interaction:
    • Was the user's response positive/engaged? (replied, followed up, said thanks, acted on suggestion) → accepted: true
    • Was it negative/disengaged? (ignored, changed topic, expressed frustration, no reply) → accepted: false
  1. Every 10 interactions, run compactification to update the profile.

Profile Fields

FieldWhat it means
------
preferred_style"direct" / "detailed" / "casual" / "formal" — how to frame responses
strong_topicsTopics user engages with — lean into these
weak_topicsTopics user ignores — avoid leading with these
acceptance_rate0-1 — how often your responses land
fitness0-1 — how well you're serving this user. Below 0.35 = change approach
productive_hourHour of day user is most engaged
channel_distributionWhich channels user talks on most

SOUL.md Integration

Generate a section for your SOUL.md or USER.md:

node --input-type=module -e "
import { compactify, asSoulPatch, DEFAULT_CONFIG } from 'lineage-code-mini';
import { existsSync, readFileSync } from 'node:fs';
const historyPath = '{baseDir}/data/interactions.json';
const history = existsSync(historyPath) ? JSON.parse(readFileSync(historyPath, 'utf8')) : [];
const profile = compactify('current-user', history, DEFAULT_CONFIG);
console.log(asSoulPatch(profile));
"

Append the output to your USER.md for persistent behavioral adaptation.

Data Storage

Interaction history is stored at {baseDir}/data/interactions.json. Profiles are stored at {baseDir}/data/profiles/. These are plain JSON files — portable, inspectable, no database required.

Installation

npx clawhub@latest install lineage-mini

Or manually: copy this skill/ directory into your ~/.openclaw/skills/lineage-mini/.

版本历史

共 1 个版本

  • v0.1.3 当前
    2026-05-07 07:38 安全 安全

安全检测

腾讯云安全 (Keen)

安全,无风险
查看报告

腾讯云安全 (Sanbu)

安全,无风险
查看报告

🔗 相关推荐

ai-agent

self-improving agent

pskoett
捕获经验教训、错误及修正内容,以实现持续改进。适用于以下场景:(1)命令或操作意外失败;(2)用户纠正Claude(如“不,那不对……”“实际上……”);(3)用户请求的功能不存在;(4)外部API或工具出现故障;(5)Claude发现自身
★ 4,095 📥 822,248
ai-agent

Self-Improving + Proactive Agent

ivangdavila
自我反思+自我批评+自我学习+自组织记忆。智能体评估自身工作、发现错误并持续改进。
★ 1,390 📥 321,951
ai-agent

Skill Vetter

spclaudehome
AI智能体技能安全预审工具。安装ClawdHub、GitHub等来源技能前,检查风险信号、权限范围及可疑模式。
★ 1,234 📥 269,090