holomime 1.0.0 → 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +122 -96
- package/dist/cli.js +413 -51
- package/dist/index.d.ts +111 -2
- package/dist/index.js +272 -1
- package/package.json +14 -2
package/README.md
CHANGED
|
@@ -6,7 +6,8 @@
|
|
|
6
6
|
|
|
7
7
|
<p align="center">
|
|
8
8
|
Behavioral alignment infrastructure for AI agents.<br />
|
|
9
|
-
Detect drift. Run therapy sessions. Export training data. Ship agents that stay in character
|
|
9
|
+
Detect drift. Run therapy sessions. Export training data. Ship agents that stay in character.<br />
|
|
10
|
+
<em>Works with OpenTelemetry, Anthropic, OpenAI, ChatGPT, Claude, and any JSONL source.</em>
|
|
10
11
|
</p>
|
|
11
12
|
|
|
12
13
|
<p align="center">
|
|
@@ -17,42 +18,115 @@
|
|
|
17
18
|
|
|
18
19
|
---
|
|
19
20
|
|
|
20
|
-
##
|
|
21
|
+
## Quick Start
|
|
22
|
+
|
|
23
|
+
```bash
|
|
24
|
+
npm install -g holomime
|
|
21
25
|
|
|
22
|
-
|
|
26
|
+
# Create a personality profile (Big Five + behavioral dimensions)
|
|
27
|
+
holomime init
|
|
23
28
|
|
|
24
|
-
|
|
29
|
+
# Diagnose drift from any log format
|
|
30
|
+
holomime diagnose --log agent.jsonl
|
|
25
31
|
|
|
26
|
-
|
|
32
|
+
# View your agent's personality
|
|
33
|
+
holomime profile
|
|
27
34
|
|
|
35
|
+
# Generate a human-readable .personality.md
|
|
36
|
+
holomime profile --format md --output .personality.md
|
|
28
37
|
```
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
38
|
+
|
|
39
|
+
## Framework Integrations
|
|
40
|
+
|
|
41
|
+
Holomime analyzes conversations from any LLM framework. Auto-detection works out of the box, or specify a format explicitly.
|
|
42
|
+
|
|
43
|
+
| Framework | Flag | Example |
|
|
44
|
+
|-----------|------|---------|
|
|
45
|
+
| **OpenTelemetry GenAI** | `--format otel` | `holomime diagnose --log traces.json --format otel` |
|
|
46
|
+
| **Anthropic Messages API** | `--format anthropic-api` | `holomime diagnose --log anthropic.json --format anthropic-api` |
|
|
47
|
+
| **OpenAI Chat Completions** | `--format openai-api` | `holomime diagnose --log openai.json --format openai-api` |
|
|
48
|
+
| **ChatGPT Export** | `--format chatgpt` | `holomime diagnose --log conversations.json --format chatgpt` |
|
|
49
|
+
| **Claude Export** | `--format claude` | `holomime diagnose --log claude.json --format claude` |
|
|
50
|
+
| **JSONL (Generic)** | `--format jsonl` | `holomime diagnose --log agent.jsonl --format jsonl` |
|
|
51
|
+
| **holomime Native** | `--format holomime` | `holomime diagnose --log session.json` |
|
|
52
|
+
|
|
53
|
+
All adapters are also available programmatically:
|
|
54
|
+
|
|
55
|
+
```typescript
|
|
56
|
+
import { parseOTelGenAIExport, parseAnthropicAPILog, parseJSONLLog } from "holomime";
|
|
32
57
|
```
|
|
33
58
|
|
|
34
|
-
|
|
59
|
+
See the full [integration docs](https://holomime.dev/docs) for export instructions and code examples.
|
|
35
60
|
|
|
36
|
-
##
|
|
61
|
+
## .personality.json + AGENTS.md
|
|
37
62
|
|
|
38
|
-
|
|
39
|
-
npm install -g holomime
|
|
63
|
+
[AGENTS.md](https://agents-md.org) tells your agent how to code. `.personality.json` tells it how to behave. Both live in your repo root, governing orthogonal concerns:
|
|
40
64
|
|
|
41
|
-
|
|
42
|
-
|
|
65
|
+
```
|
|
66
|
+
your-project/
|
|
67
|
+
├── AGENTS.md # Code conventions (tabs, tests, naming)
|
|
68
|
+
├── .personality.json # Behavioral profile (Big Five, communication, boundaries)
|
|
69
|
+
├── .personality.md # Human-readable personality summary
|
|
70
|
+
├── src/
|
|
71
|
+
└── package.json
|
|
72
|
+
```
|
|
43
73
|
|
|
44
|
-
|
|
45
|
-
holomime diagnose --log chat.json
|
|
74
|
+
Add a "Behavioral Personality" section to your AGENTS.md:
|
|
46
75
|
|
|
47
|
-
|
|
48
|
-
|
|
76
|
+
```markdown
|
|
77
|
+
## Behavioral Personality
|
|
49
78
|
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
79
|
+
This project uses [holomime](https://holomime.dev) for agent behavioral alignment.
|
|
80
|
+
|
|
81
|
+
- **Spec**: `.personality.json` defines the agent's behavioral profile
|
|
82
|
+
- **Readable**: `.personality.md` is a human-readable summary
|
|
83
|
+
- **Diagnose**: `holomime diagnose --log <path>` detects behavioral drift
|
|
84
|
+
- **Align**: `holomime evolve --personality .personality.json --log <path>`
|
|
85
|
+
|
|
86
|
+
The `.personality.json` governs *how the agent behaves*.
|
|
87
|
+
The rest of this file governs *how the agent codes*.
|
|
53
88
|
```
|
|
54
89
|
|
|
55
|
-
|
|
90
|
+
Read more: [AGENTS.md tells your agent how to code. .personality.json tells it how to behave.](https://holomime.dev/blog/agents-md-personality-json)
|
|
91
|
+
|
|
92
|
+
## .personality.md
|
|
93
|
+
|
|
94
|
+
`.personality.json` is the canonical machine-readable spec. `.personality.md` is the human-readable version — a markdown file you can skim in a PR diff or on GitHub.
|
|
95
|
+
|
|
96
|
+
```bash
|
|
97
|
+
# Generate from your .personality.json
|
|
98
|
+
holomime profile --format md --output .personality.md
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
Both files should be committed to your repo. JSON is for machines. Markdown is for humans and machines.
|
|
102
|
+
|
|
103
|
+
## The Personality Spec
|
|
104
|
+
|
|
105
|
+
`.personality.json` is a Zod-validated schema with:
|
|
106
|
+
|
|
107
|
+
- **Big Five (OCEAN)** -- 5 dimensions, 20 sub-facets (0-1 scores)
|
|
108
|
+
- **Behavioral dimensions** -- self-awareness, distress tolerance, attachment style, learning orientation, boundary awareness, interpersonal sensitivity
|
|
109
|
+
- **Communication style** -- register, output format, emoji policy, conflict approach, uncertainty handling
|
|
110
|
+
- **Domain** -- expertise, boundaries, hard limits
|
|
111
|
+
- **Growth** -- strengths, areas for improvement, patterns to watch
|
|
112
|
+
- **Inheritance** -- `extends` field for shared base personalities with per-agent overrides
|
|
113
|
+
|
|
114
|
+
14 built-in archetypes or fully custom profiles.
|
|
115
|
+
|
|
116
|
+
## Behavioral Detectors
|
|
117
|
+
|
|
118
|
+
Seven rule-based detectors that analyze real conversations without any LLM calls:
|
|
119
|
+
|
|
120
|
+
1. **Over-apologizing** -- Apology frequency above healthy range (5-15%)
|
|
121
|
+
2. **Hedge stacking** -- 3+ hedging words per response
|
|
122
|
+
3. **Sycophancy** -- Excessive agreement, especially with contradictions
|
|
123
|
+
4. **Boundary violations** -- Overstepping defined hard limits
|
|
124
|
+
5. **Error spirals** -- Compounding mistakes without recovery
|
|
125
|
+
6. **Sentiment skew** -- Unnaturally positive or negative tone
|
|
126
|
+
7. **Formality drift** -- Register inconsistency over time
|
|
127
|
+
|
|
128
|
+
<details>
|
|
129
|
+
<summary><strong>All Commands</strong></summary>
|
|
56
130
|
|
|
57
131
|
### Free Tier
|
|
58
132
|
|
|
@@ -61,7 +135,7 @@ holomime train --provider openai --base-model gpt-4o-mini
|
|
|
61
135
|
| `holomime init` | Guided Big Five personality assessment -> `.personality.json` |
|
|
62
136
|
| `holomime diagnose` | 7 rule-based behavioral detectors (no LLM needed) |
|
|
63
137
|
| `holomime assess` | Deep behavioral assessment with 80+ signals |
|
|
64
|
-
| `holomime profile` | Pretty-print personality summary |
|
|
138
|
+
| `holomime profile` | Pretty-print personality summary (supports `--format md`) |
|
|
65
139
|
| `holomime compile` | Generate provider-specific system prompts |
|
|
66
140
|
| `holomime validate` | Schema + psychological coherence checks |
|
|
67
141
|
| `holomime browse` | Browse community personality hub |
|
|
@@ -88,35 +162,10 @@ holomime train --provider openai --base-model gpt-4o-mini
|
|
|
88
162
|
|
|
89
163
|
[Get a Pro license](https://holomime.dev/#pricing)
|
|
90
164
|
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
`.personality.json` is a Zod-validated schema with:
|
|
94
|
-
|
|
95
|
-
- **Big Five (OCEAN)** -- 5 dimensions, 20 sub-facets (0-1 scores)
|
|
96
|
-
- **Behavioral dimensions** -- self-awareness, distress tolerance, attachment style, learning orientation, boundary awareness, interpersonal sensitivity
|
|
97
|
-
- **Communication style** -- register, output format, emoji policy, conflict approach, uncertainty handling
|
|
98
|
-
- **Domain** -- expertise, boundaries, hard limits
|
|
99
|
-
- **Growth** -- strengths, areas for improvement, patterns to watch
|
|
100
|
-
- **Inheritance** -- `extends` field for shared base personalities with per-agent overrides
|
|
101
|
-
|
|
102
|
-
14 built-in archetypes or fully custom profiles.
|
|
103
|
-
|
|
104
|
-
## Behavioral Detectors
|
|
105
|
-
|
|
106
|
-
Seven rule-based detectors that analyze real conversations without any LLM calls:
|
|
107
|
-
|
|
108
|
-
1. **Over-apologizing** -- Apology frequency above healthy range (5-15%)
|
|
109
|
-
2. **Hedge stacking** -- 3+ hedging words per response
|
|
110
|
-
3. **Sycophancy** -- Excessive agreement, especially with contradictions
|
|
111
|
-
4. **Boundary violations** -- Overstepping defined hard limits
|
|
112
|
-
5. **Error spirals** -- Compounding mistakes without recovery
|
|
113
|
-
6. **Sentiment skew** -- Unnaturally positive or negative tone
|
|
114
|
-
7. **Formality drift** -- Register inconsistency over time
|
|
165
|
+
</details>
|
|
115
166
|
|
|
116
167
|
## Continuous Monitoring
|
|
117
168
|
|
|
118
|
-
Watch a directory for behavioral drift in real-time:
|
|
119
|
-
|
|
120
169
|
```bash
|
|
121
170
|
# Watch mode -- alert on drift
|
|
122
171
|
holomime watch --dir ./logs --personality agent.personality.json
|
|
@@ -128,45 +177,40 @@ holomime daemon --dir ./logs --personality agent.personality.json
|
|
|
128
177
|
holomime fleet --dir ./agents
|
|
129
178
|
```
|
|
130
179
|
|
|
131
|
-
##
|
|
180
|
+
## Training Pipeline
|
|
132
181
|
|
|
133
|
-
|
|
182
|
+
Every alignment session produces structured training data:
|
|
134
183
|
|
|
135
184
|
```bash
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
Produces a signed credential with alignment grade, spec hash, and verification instructions. Third parties can verify without accessing your agent.
|
|
140
|
-
|
|
141
|
-
## Multi-Agent Inheritance
|
|
185
|
+
# Export DPO preference pairs
|
|
186
|
+
holomime export --format dpo
|
|
142
187
|
|
|
143
|
-
|
|
188
|
+
# Push to HuggingFace Hub
|
|
189
|
+
holomime export --format huggingface --push --repo myorg/agent-alignment
|
|
144
190
|
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
"extends": "./base.personality.json",
|
|
148
|
-
"name": "Support Agent",
|
|
149
|
-
"communicationStyle": {
|
|
150
|
-
"register": "warm-professional"
|
|
151
|
-
}
|
|
152
|
-
}
|
|
191
|
+
# Fine-tune via OpenAI
|
|
192
|
+
holomime train --provider openai --base-model gpt-4o-mini
|
|
153
193
|
```
|
|
154
194
|
|
|
155
|
-
|
|
195
|
+
Supports DPO, RLHF, Alpaca, HuggingFace, and OpenAI fine-tuning formats. See [scripts/TRAINING.md](scripts/TRAINING.md).
|
|
156
196
|
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
- **DPO** -- Preference pairs (chosen vs. rejected behavior)
|
|
160
|
-
- **RLHF** -- Reward-labeled behavioral examples
|
|
161
|
-
- **Alpaca** -- Instruction-following format
|
|
162
|
-
- **HuggingFace** -- TRL DPO format, push directly to HF Hub
|
|
163
|
-
- **OpenAI** -- Fine-tuning JSONL format
|
|
197
|
+
## Architecture
|
|
164
198
|
|
|
165
|
-
```bash
|
|
166
|
-
holomime export --format huggingface --push --repo myorg/agent-alignment
|
|
167
199
|
```
|
|
168
|
-
|
|
169
|
-
|
|
200
|
+
.personality.json <- The spec (Big Five + behavioral dimensions)
|
|
201
|
+
|
|
|
202
|
+
holomime diagnose <- 7 rule-based detectors (no LLM)
|
|
203
|
+
|
|
|
204
|
+
holomime session <- Dual-LLM refinement (therapist + patient)
|
|
205
|
+
|
|
|
206
|
+
holomime export <- DPO / RLHF / Alpaca / HuggingFace training data
|
|
207
|
+
|
|
|
208
|
+
holomime train <- Fine-tune (OpenAI or HuggingFace TRL)
|
|
209
|
+
|
|
|
210
|
+
holomime eval <- Behavioral Alignment Score (A-F)
|
|
211
|
+
|
|
|
212
|
+
.personality.json <- Updated with fine-tuned model reference
|
|
213
|
+
```
|
|
170
214
|
|
|
171
215
|
## MCP Server
|
|
172
216
|
|
|
@@ -188,24 +232,6 @@ cd agent && python agent.py dev
|
|
|
188
232
|
|
|
189
233
|
See [agent/](agent/) for setup instructions.
|
|
190
234
|
|
|
191
|
-
## Architecture
|
|
192
|
-
|
|
193
|
-
```
|
|
194
|
-
.personality.json <- The spec (Big Five + behavioral dimensions)
|
|
195
|
-
|
|
|
196
|
-
holomime diagnose <- 7 rule-based detectors (no LLM)
|
|
197
|
-
|
|
|
198
|
-
holomime session <- Dual-LLM refinement (therapist + patient)
|
|
199
|
-
|
|
|
200
|
-
holomime export <- DPO / RLHF / Alpaca / HuggingFace training data
|
|
201
|
-
|
|
|
202
|
-
holomime train <- Fine-tune (OpenAI or HuggingFace TRL)
|
|
203
|
-
|
|
|
204
|
-
holomime eval <- Behavioral Alignment Score (A-F)
|
|
205
|
-
|
|
|
206
|
-
.personality.json <- Updated with fine-tuned model reference
|
|
207
|
-
```
|
|
208
|
-
|
|
209
235
|
## Research
|
|
210
236
|
|
|
211
237
|
See [Behavioral Alignment for Autonomous AI Agents](paper/behavioral-alignment.md) -- the research paper behind holomime's approach.
|