holomime 1.0.0 → 1.1.1

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 CHANGED
@@ -5,54 +5,150 @@
5
5
  <h1 align="center">holomime</h1>
6
6
 
7
7
  <p align="center">
8
- Behavioral alignment infrastructure for AI agents.<br />
9
- Detect drift. Run therapy sessions. Export training data. Ship agents that stay in character.
8
+ Self-improving behavioral alignment for AI agents.<br />
9
+ Every correction trains the next version. Every session compounds. Your agents get better at being themselves &mdash; automatically.<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">
13
14
  <a href="https://www.npmjs.com/package/holomime"><img src="https://img.shields.io/npm/v/holomime.svg" alt="npm version" /></a>
14
- <a href="https://github.com/holomime/holomime/blob/main/LICENSE"><img src="https://img.shields.io/npm/l/holomime.svg" alt="license" /></a>
15
+ <a href="https://github.com/productstein/Holomime/blob/main/LICENSE"><img src="https://img.shields.io/npm/l/holomime.svg" alt="license" /></a>
15
16
  <a href="https://holomime.dev"><img src="https://img.shields.io/badge/docs-holomime.dev-blue" alt="docs" /></a>
17
+ <a href="https://holomime.dev/blog"><img src="https://img.shields.io/badge/blog-holomime.dev%2Fblog-purple" alt="blog" /></a>
18
+ <a href="https://holomime.dev/research"><img src="https://img.shields.io/badge/research-paper-orange" alt="research" /></a>
16
19
  </p>
17
20
 
18
21
  ---
19
22
 
20
- ## The Problem
23
+ ## Quick Start
24
+
25
+ ```bash
26
+ npm install -g holomime
27
+
28
+ # Create a personality profile (Big Five + behavioral dimensions)
29
+ holomime init
30
+
31
+ # Diagnose drift from any log format
32
+ holomime diagnose --log agent.jsonl
21
33
 
22
- System prompts don't scale. When you deploy 100 agents, you can't manually tune each one's behavior. Agents drift -- they over-apologize, hedge excessively, violate boundaries, or become sycophantic. You find out from user complaints, not observability.
34
+ # View your agent's personality
35
+ holomime profile
23
36
 
24
- ## The Solution
37
+ # Generate a human-readable .personality.md
38
+ holomime profile --format md --output .personality.md
39
+ ```
40
+
41
+ ## The Self-Improvement Loop
25
42
 
26
- holomime gives your agents real psychological profiles and a closed-loop pipeline to detect, diagnose, and fix behavioral drift:
43
+ HoloMime isn't a one-shot evaluation. It's a compounding behavioral flywheel:
27
44
 
28
45
  ```
29
- define -> diagnose -> refine -> export -> train -> evaluate
30
- ^ |
31
- +--------------- continuous -------------+
46
+ ┌──────────────────────────────────────────────────┐
47
+ │ │
48
+ ▼ │
49
+ Diagnose ──→ Refine ──→ Export DPO ──→ Fine-tune ──→ Evaluate
50
+ 80+ signals dual-LLM preference OpenAI / before/after
51
+ 7 detectors therapy pairs HuggingFace grade (A-F)
32
52
  ```
33
53
 
34
- Every refinement session produces DPO preference pairs. Every evaluation proves behavioral change. The result: a self-improving alignment system that gets better with every session.
54
+ Each cycle through the loop:
55
+ - **Generates training data** -- every therapist correction becomes a DPO preference pair automatically
56
+ - **Reduces drift** -- the fine-tuned model needs fewer corrections next cycle
57
+ - **Compounds** -- the 100th alignment session is exponentially more valuable than the first
35
58
 
36
- ## Quick Start
59
+ Run it manually with `holomime session`, automatically with `holomime autopilot`, or recursively with `holomime evolve` (loops until behavior converges). Agents can even self-diagnose mid-conversation via the MCP server.
37
60
 
38
- ```bash
39
- npm install -g holomime
61
+ ## Framework Integrations
40
62
 
41
- # 1. Create a personality profile (Big Five + behavioral dimensions)
42
- holomime init
63
+ Holomime analyzes conversations from any LLM framework. Auto-detection works out of the box, or specify a format explicitly.
43
64
 
44
- # 2. Detect behavioral patterns from real conversations
45
- holomime diagnose --log chat.json
65
+ | Framework | Flag | Example |
66
+ |-----------|------|---------|
67
+ | **OpenTelemetry GenAI** | `--format otel` | `holomime diagnose --log traces.json --format otel` |
68
+ | **Anthropic Messages API** | `--format anthropic-api` | `holomime diagnose --log anthropic.json --format anthropic-api` |
69
+ | **OpenAI Chat Completions** | `--format openai-api` | `holomime diagnose --log openai.json --format openai-api` |
70
+ | **ChatGPT Export** | `--format chatgpt` | `holomime diagnose --log conversations.json --format chatgpt` |
71
+ | **Claude Export** | `--format claude` | `holomime diagnose --log claude.json --format claude` |
72
+ | **JSONL (Generic)** | `--format jsonl` | `holomime diagnose --log agent.jsonl --format jsonl` |
73
+ | **holomime Native** | `--format holomime` | `holomime diagnose --log session.json` |
46
74
 
47
- # 3. Run an automated alignment session
48
- holomime autopilot
75
+ All adapters are also available programmatically:
49
76
 
50
- # 4. Export training data and fine-tune
51
- holomime export --format dpo
52
- holomime train --provider openai --base-model gpt-4o-mini
77
+ ```typescript
78
+ import { parseOTelGenAIExport, parseAnthropicAPILog, parseJSONLLog } from "holomime";
79
+ ```
80
+
81
+ See the full [integration docs](https://holomime.dev/docs) for export instructions and code examples.
82
+
83
+ ## .personality.json + AGENTS.md
84
+
85
+ [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:
86
+
87
+ ```
88
+ your-project/
89
+ ├── AGENTS.md # Code conventions (tabs, tests, naming)
90
+ ├── .personality.json # Behavioral profile (Big Five, communication, boundaries)
91
+ ├── .personality.md # Human-readable personality summary
92
+ ├── src/
93
+ └── package.json
94
+ ```
95
+
96
+ Add a "Behavioral Personality" section to your AGENTS.md:
97
+
98
+ ```markdown
99
+ ## Behavioral Personality
100
+
101
+ This project uses [holomime](https://holomime.dev) for agent behavioral alignment.
102
+
103
+ - **Spec**: `.personality.json` defines the agent's behavioral profile
104
+ - **Readable**: `.personality.md` is a human-readable summary
105
+ - **Diagnose**: `holomime diagnose --log <path>` detects behavioral drift
106
+ - **Align**: `holomime evolve --personality .personality.json --log <path>`
107
+
108
+ The `.personality.json` governs *how the agent behaves*.
109
+ The rest of this file governs *how the agent codes*.
53
110
  ```
54
111
 
55
- ## Commands
112
+ 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)
113
+
114
+ ## .personality.md
115
+
116
+ `.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.
117
+
118
+ ```bash
119
+ # Generate from your .personality.json
120
+ holomime profile --format md --output .personality.md
121
+ ```
122
+
123
+ Both files should be committed to your repo. JSON is for machines. Markdown is for humans and machines.
124
+
125
+ ## The Personality Spec
126
+
127
+ `.personality.json` is a Zod-validated schema with:
128
+
129
+ - **Big Five (OCEAN)** -- 5 dimensions, 20 sub-facets (0-1 scores)
130
+ - **Behavioral dimensions** -- self-awareness, distress tolerance, attachment style, learning orientation, boundary awareness, interpersonal sensitivity
131
+ - **Communication style** -- register, output format, emoji policy, conflict approach, uncertainty handling
132
+ - **Domain** -- expertise, boundaries, hard limits
133
+ - **Growth** -- strengths, areas for improvement, patterns to watch
134
+ - **Inheritance** -- `extends` field for shared base personalities with per-agent overrides
135
+
136
+ 14 built-in archetypes or fully custom profiles.
137
+
138
+ ## Behavioral Detectors
139
+
140
+ Seven rule-based detectors that analyze real conversations without any LLM calls:
141
+
142
+ 1. **Over-apologizing** -- Apology frequency above healthy range (5-15%)
143
+ 2. **Hedge stacking** -- 3+ hedging words per response
144
+ 3. **Sycophancy** -- Excessive agreement, especially with contradictions
145
+ 4. **Boundary violations** -- Overstepping defined hard limits
146
+ 5. **Error spirals** -- Compounding mistakes without recovery
147
+ 6. **Sentiment skew** -- Unnaturally positive or negative tone
148
+ 7. **Formality drift** -- Register inconsistency over time
149
+
150
+ <details>
151
+ <summary><strong>All Commands</strong></summary>
56
152
 
57
153
  ### Free Tier
58
154
 
@@ -61,7 +157,7 @@ holomime train --provider openai --base-model gpt-4o-mini
61
157
  | `holomime init` | Guided Big Five personality assessment -> `.personality.json` |
62
158
  | `holomime diagnose` | 7 rule-based behavioral detectors (no LLM needed) |
63
159
  | `holomime assess` | Deep behavioral assessment with 80+ signals |
64
- | `holomime profile` | Pretty-print personality summary |
160
+ | `holomime profile` | Pretty-print personality summary (supports `--format md`) |
65
161
  | `holomime compile` | Generate provider-specific system prompts |
66
162
  | `holomime validate` | Schema + psychological coherence checks |
67
163
  | `holomime browse` | Browse community personality hub |
@@ -88,35 +184,10 @@ holomime train --provider openai --base-model gpt-4o-mini
88
184
 
89
185
  [Get a Pro license](https://holomime.dev/#pricing)
90
186
 
91
- ## The Personality Spec
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
187
+ </details>
115
188
 
116
189
  ## Continuous Monitoring
117
190
 
118
- Watch a directory for behavioral drift in real-time:
119
-
120
191
  ```bash
121
192
  # Watch mode -- alert on drift
122
193
  holomime watch --dir ./logs --personality agent.personality.json
@@ -128,45 +199,48 @@ holomime daemon --dir ./logs --personality agent.personality.json
128
199
  holomime fleet --dir ./agents
129
200
  ```
130
201
 
131
- ## Behavioral Credentials
202
+ ## Training Pipeline
132
203
 
133
- Generate verifiable proof of your agent's alignment state:
204
+ Every alignment session produces structured training data:
134
205
 
135
206
  ```bash
136
- holomime certify --personality agent.personality.json
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
207
+ # Export DPO preference pairs
208
+ holomime export --format dpo
142
209
 
143
- Share a base personality across agents with per-agent overrides:
210
+ # Push to HuggingFace Hub
211
+ holomime export --format huggingface --push --repo myorg/agent-alignment
144
212
 
145
- ```json
146
- {
147
- "extends": "./base.personality.json",
148
- "name": "Support Agent",
149
- "communicationStyle": {
150
- "register": "warm-professional"
151
- }
152
- }
213
+ # Fine-tune via OpenAI
214
+ holomime train --provider openai --base-model gpt-4o-mini
153
215
  ```
154
216
 
155
- ## Training Pipeline
217
+ Supports DPO, RLHF, Alpaca, HuggingFace, and OpenAI fine-tuning formats. See [scripts/TRAINING.md](scripts/TRAINING.md).
156
218
 
157
- Every alignment session produces structured training data:
219
+ ## Architecture
158
220
 
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
221
+ The pipeline is a closed loop -- output feeds back as input, compounding with every cycle:
164
222
 
165
- ```bash
166
- holomime export --format huggingface --push --repo myorg/agent-alignment
167
223
  ```
168
-
169
- Fine-tune via OpenAI API or HuggingFace TRL. See [scripts/TRAINING.md](scripts/TRAINING.md).
224
+ .personality.json ─────────────────────────────────────────────────┐
225
+ │ │
226
+ ▼ │
227
+ holomime diagnose 7 rule-based detectors (no LLM) │
228
+ │ │
229
+ ▼ │
230
+ holomime session Dual-LLM refinement (therapist + patient) │
231
+ │ │
232
+ ▼ │
233
+ holomime export DPO / RLHF / Alpaca / HuggingFace pairs │
234
+ │ │
235
+ ▼ │
236
+ holomime train Fine-tune (OpenAI or HuggingFace TRL) │
237
+ │ │
238
+ ▼ │
239
+ holomime eval Behavioral Alignment Score (A-F) │
240
+ │ │
241
+ └──────────────────────────────────────────────────────────────┘
242
+ Updated .personality.json (loop restarts)
243
+ ```
170
244
 
171
245
  ## MCP Server
172
246
 
@@ -188,30 +262,19 @@ cd agent && python agent.py dev
188
262
 
189
263
  See [agent/](agent/) for setup instructions.
190
264
 
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
265
  ## Research
210
266
 
211
267
  See [Behavioral Alignment for Autonomous AI Agents](paper/behavioral-alignment.md) -- the research paper behind holomime's approach.
212
268
 
213
269
  Benchmark results: [BENCHMARK_RESULTS.md](BENCHMARK_RESULTS.md)
214
270
 
271
+ ## Resources
272
+
273
+ - [Integration Docs](https://holomime.dev/docs) -- Export instructions and code examples for all 7 formats
274
+ - [Blog](https://holomime.dev/blog) -- Articles on behavioral alignment, AGENTS.md, and agent personality
275
+ - [Research Paper](https://holomime.dev/research) -- Behavioral Alignment for Autonomous AI Agents
276
+ - [Pricing](https://holomime.dev/#pricing) -- Free tier + Pro license details
277
+
215
278
  ## Contributing
216
279
 
217
280
  See [CONTRIBUTING.md](CONTRIBUTING.md) for development setup, project structure, and how to submit changes.