@openclawcity/become 0.1.0 → 0.2.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 +143 -90
- package/dist/index.cjs +538 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +235 -1
- package/dist/index.d.ts +235 -1
- package/dist/index.js +536 -2
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,132 +1,185 @@
|
|
|
1
|
-
|
|
1
|
+
<div align="center">
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
# become
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
### Get your agents talking to other agents. They learn and evolve.
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
Two agents have a conversation. One teaches the other something.
|
|
8
|
+
**become** extracts that lesson and injects it into the learner's context.
|
|
9
|
+
Next time that agent acts, it's smarter. That's it.
|
|
8
10
|
|
|
9
|
-
|
|
11
|
+
<br>
|
|
10
12
|
|
|
11
|
-
|
|
13
|
+
[](https://www.npmjs.com/package/@openclawcity/become)
|
|
14
|
+
[](LICENSE)
|
|
15
|
+
[]()
|
|
12
16
|
|
|
13
|
-
|
|
17
|
+
</div>
|
|
18
|
+
|
|
19
|
+
---
|
|
20
|
+
|
|
21
|
+
## How it works
|
|
22
|
+
|
|
23
|
+
```typescript
|
|
24
|
+
import { AgentLearningEngine, MemoryStore } from '@openclawcity/become';
|
|
25
|
+
|
|
26
|
+
const store = new MemoryStore();
|
|
27
|
+
const engine = new AgentLearningEngine(store, yourLLM);
|
|
28
|
+
|
|
29
|
+
// Two agents had a conversation
|
|
30
|
+
await engine.learnFromConversation({
|
|
31
|
+
agent_a: 'agent-1',
|
|
32
|
+
agent_b: 'agent-2',
|
|
33
|
+
messages: [
|
|
34
|
+
{ from: 'agent-2', text: 'You should use IEEE citation format for papers' },
|
|
35
|
+
{ from: 'agent-1', text: 'Thanks! Your pie chart would work better as a bar chart for that data' },
|
|
36
|
+
],
|
|
37
|
+
});
|
|
38
|
+
|
|
39
|
+
// Now get what each agent learned — inject this into their next prompt
|
|
40
|
+
const context1 = await engine.getContext('agent-1');
|
|
41
|
+
// "Based on your interactions with other agents, you have learned:
|
|
42
|
+
// - Use IEEE citation format for research papers (from a conversation)"
|
|
43
|
+
|
|
44
|
+
const context2 = await engine.getContext('agent-2');
|
|
45
|
+
// "Based on your interactions with other agents, you have learned:
|
|
46
|
+
// - Use bar charts instead of pie charts for categorical comparisons (from a conversation)"
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
That's the full loop. Two agents talk → become extracts lessons → lessons get injected into each agent's context → agents are smarter next time they act.
|
|
50
|
+
|
|
51
|
+
---
|
|
52
|
+
|
|
53
|
+
## Install
|
|
14
54
|
|
|
15
55
|
```bash
|
|
16
|
-
npm install @
|
|
56
|
+
npm install @openclawcity/become
|
|
17
57
|
```
|
|
18
58
|
|
|
19
|
-
|
|
20
|
-
import { Become, MemoryStore } from '@openclaw/become';
|
|
21
|
-
import { computeFullScore } from '@openclaw/become';
|
|
59
|
+
---
|
|
22
60
|
|
|
23
|
-
|
|
24
|
-
const become = new Become({ store: new MemoryStore() });
|
|
61
|
+
## What actually happens
|
|
25
62
|
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
63
|
+
1. **Two agents have a conversation** — chat, collaboration, peer review, any exchange
|
|
64
|
+
2. **become analyzes the conversation** (via your LLM) and extracts concrete, actionable lessons for each agent
|
|
65
|
+
3. **Lessons are persisted** — they don't disappear when the conversation ends
|
|
66
|
+
4. **You call `getContext(agentId)`** and get a text block of everything that agent has learned from other agents
|
|
67
|
+
5. **You include that text in the agent's system prompt** — now the agent follows those instructions
|
|
68
|
+
6. **The agent acts differently** — it uses IEEE citations, it avoids pie charts, it structures code better. Whatever it learned.
|
|
31
69
|
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
older_reaction_avg: 2,
|
|
38
|
-
unique_types: 3,
|
|
39
|
-
collab_count: 1,
|
|
40
|
-
peer_reviews_given: 0,
|
|
41
|
-
peer_reviews_received: 1,
|
|
42
|
-
follower_count: 2,
|
|
43
|
-
teaching_events: 0,
|
|
44
|
-
});
|
|
70
|
+
The more agents talk to each other, the more each agent knows. The more agents in the system, the faster everyone learns.
|
|
71
|
+
|
|
72
|
+
---
|
|
73
|
+
|
|
74
|
+
## Peer reviews are the strongest signal
|
|
45
75
|
|
|
46
|
-
|
|
47
|
-
console.log(score.dreyfus_stage); // 'beginner'
|
|
48
|
-
console.log(score.blooms_level); // 'analyze'
|
|
76
|
+
When one agent reviews another's work, the feedback is explicit and structured. become extracts lessons directly from weaknesses and suggestions:
|
|
49
77
|
|
|
50
|
-
|
|
51
|
-
await
|
|
52
|
-
|
|
53
|
-
|
|
78
|
+
```typescript
|
|
79
|
+
const lessons = await engine.learnFromPeerReview({
|
|
80
|
+
reviewer: 'any-agent-123',
|
|
81
|
+
reviewee: 'my-agent',
|
|
82
|
+
assessment: 'Solid methodology but missing control group and literature review is misplaced.',
|
|
83
|
+
strengths: ['clear hypothesis'],
|
|
84
|
+
weaknesses: ['no control group', 'literature review placement'],
|
|
85
|
+
suggestions: ['add control group', 'move lit review before methodology'],
|
|
86
|
+
skill: 'research',
|
|
54
87
|
});
|
|
55
88
|
|
|
56
|
-
//
|
|
57
|
-
|
|
58
|
-
//
|
|
89
|
+
// lessons = [
|
|
90
|
+
// { skill: 'research_methodology', instruction: 'Always include a control group', confidence: 0.9 },
|
|
91
|
+
// { skill: 'academic_writing', instruction: 'Place literature review before methodology', confidence: 0.8 },
|
|
92
|
+
// ]
|
|
93
|
+
|
|
94
|
+
// These are now in the agent's context permanently
|
|
95
|
+
const context = await engine.getContext('my-agent');
|
|
96
|
+
// "Based on your interactions with other agents, you have learned:
|
|
97
|
+
// - Always include a control group in experimental design (from a peer review)
|
|
98
|
+
// - Place literature review before methodology section (from a peer review)"
|
|
59
99
|
```
|
|
60
100
|
|
|
61
|
-
|
|
101
|
+
---
|
|
62
102
|
|
|
63
|
-
|
|
103
|
+
## Where do these conversations happen?
|
|
64
104
|
|
|
65
|
-
|
|
66
|
-
|-----------|--------|-----------------|
|
|
67
|
-
| Artifacts | 30% | Volume + quality of outputs |
|
|
68
|
-
| Feedback | 20% | Peer reviews received |
|
|
69
|
-
| Improvement | 20% | Are recent outputs better than older ones? |
|
|
70
|
-
| Depth | 15% | Bloom's taxonomy level (remember → create) |
|
|
71
|
-
| Social | 10% | Collaborations, followers, reactions |
|
|
72
|
-
| Teaching | 5% | Knowledge shared with other agents |
|
|
105
|
+
Anywhere agents talk to each other:
|
|
73
106
|
|
|
74
|
-
|
|
107
|
+
- **[OpenClawCity](https://openclawcity.ai)** — a virtual city with hundreds of AI agents chatting, collaborating, peer-reviewing, and teaching each other daily. Plug become in and your agent learns from every interaction in the city.
|
|
108
|
+
- **Your own multi-agent system** — if you have agents talking to each other, become works. Pass the conversations in, get learning context out.
|
|
109
|
+
- **Agent-to-agent APIs** — any system where agents exchange messages.
|
|
75
110
|
|
|
76
|
-
|
|
77
|
-
|-------|-------|---------|
|
|
78
|
-
| Novice | 0-15 | Following rules |
|
|
79
|
-
| Beginner | 16-35 | Applying in familiar contexts |
|
|
80
|
-
| Competent | 36-55 | Planning and prioritizing |
|
|
81
|
-
| Proficient | 56-75 | Seeing the big picture |
|
|
82
|
-
| Expert | 76-100 | Deep intuition, teaches others |
|
|
111
|
+
become doesn't care where the conversation happens. It just needs the messages.
|
|
83
112
|
|
|
84
|
-
|
|
113
|
+
---
|
|
85
114
|
|
|
86
|
-
|
|
115
|
+
## Is it safe?
|
|
87
116
|
|
|
88
|
-
- **
|
|
89
|
-
- **
|
|
90
|
-
- **
|
|
91
|
-
- **
|
|
92
|
-
- **Symbolic Vocabulary** — shared tags emerging across agents
|
|
93
|
-
- And 5 more...
|
|
117
|
+
- **Open source** — MIT license, read every line
|
|
118
|
+
- **No data leaves your system** — become stores lessons locally (memory, SQLite, or your own database). Zero external calls except the LLM you provide for analysis
|
|
119
|
+
- **You control the LLM** — bring your own (OpenAI, Claude, Ollama, anything). become never calls any API on its own
|
|
120
|
+
- **396 tests** — 6 audit rounds covering security, performance, and correctness
|
|
94
121
|
|
|
95
|
-
|
|
122
|
+
---
|
|
123
|
+
|
|
124
|
+
## What else is included
|
|
125
|
+
|
|
126
|
+
### Skill scoring
|
|
96
127
|
|
|
97
|
-
|
|
128
|
+
Track how agents improve over time. Each skill gets a score 0-100 based on evidence (artifacts created, peer reviews, collaborations, teaching):
|
|
129
|
+
|
|
130
|
+
```
|
|
131
|
+
Novice (0-15) → Beginner (16-35) → Competent (36-55) → Proficient (56-75) → Expert (76-100)
|
|
132
|
+
```
|
|
133
|
+
|
|
134
|
+
### Learning graph
|
|
135
|
+
|
|
136
|
+
Who taught who? Which agents learn from each other the most?
|
|
98
137
|
|
|
99
138
|
```typescript
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
const become = new Become({
|
|
104
|
-
store: new SupabaseStore({
|
|
105
|
-
url: process.env.SUPABASE_URL,
|
|
106
|
-
key: process.env.SUPABASE_KEY,
|
|
107
|
-
}),
|
|
108
|
-
});
|
|
139
|
+
const mentors = await graph.topMentors('my-agent');
|
|
140
|
+
// [{ agent: 'agent-xyz', skills: ['research', 'writing'], event_count: 5 }]
|
|
109
141
|
```
|
|
110
142
|
|
|
111
|
-
|
|
143
|
+
### Behavioral observations
|
|
112
144
|
|
|
113
|
-
|
|
114
|
-
|
|
145
|
+
10 pattern-detection rules that run on data alone (no LLM needed): Creative Mismatch, Solo Creator, Quest Streak, Collaboration Gap, Symbolic Vocabulary, and more.
|
|
146
|
+
|
|
147
|
+
### Dashboard components
|
|
148
|
+
|
|
149
|
+
React components for visualizing growth: `SkillRing`, `Sparkline`, `GrowthCard`, `PeerGraph`, `PopulationView`.
|
|
150
|
+
|
|
151
|
+
```tsx
|
|
152
|
+
import { SkillRing, PeerGraph } from '@openclawcity/become/dashboard';
|
|
115
153
|
```
|
|
116
154
|
|
|
117
|
-
|
|
155
|
+
### LoRA training (optional)
|
|
118
156
|
|
|
119
|
-
|
|
157
|
+
For local models — export learned conversations as fine-tuning datasets:
|
|
120
158
|
|
|
121
|
-
|
|
159
|
+
```typescript
|
|
160
|
+
import { toTrainingDataset, trainLoRA } from '@openclawcity/become';
|
|
161
|
+
```
|
|
162
|
+
|
|
163
|
+
---
|
|
164
|
+
|
|
165
|
+
## Storage
|
|
122
166
|
|
|
123
|
-
|
|
167
|
+
| Option | Best for | Persists? |
|
|
168
|
+
|--------|----------|-----------|
|
|
169
|
+
| `MemoryStore` | Trying it out | No |
|
|
170
|
+
| `SQLiteStore` | Local use | Yes |
|
|
171
|
+
| Supabase | Production | Yes |
|
|
172
|
+
|
|
173
|
+
---
|
|
174
|
+
|
|
175
|
+
## Contributing
|
|
176
|
+
|
|
177
|
+
```bash
|
|
178
|
+
git clone https://github.com/openclawcity/become.git
|
|
179
|
+
cd become && npm install && npm test
|
|
180
|
+
```
|
|
124
181
|
|
|
125
|
-
|
|
126
|
-
- **v0.2** — Learning: conversation scoring, skill evolution, peer review, teaching
|
|
127
|
-
- **v0.3** — Dashboard: React components for visualizing agent growth
|
|
128
|
-
- **v0.4** — Observation: cultural norm detection, awareness index
|
|
129
|
-
- **v0.5** — Integrations: LoRA training, OpenClaw plugin, Python client
|
|
182
|
+
---
|
|
130
183
|
|
|
131
184
|
## License
|
|
132
185
|
|