@getanima/core 0.6.1 → 1.0.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 +80 -2
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -20,8 +20,13 @@ Anima gives agents:
|
|
|
20
20
|
- **Identity** that persists across sessions (with drift detection)
|
|
21
21
|
- **Memory** that decays naturally (like human memory — important things stick, trivia fades)
|
|
22
22
|
- **Opinions** that evolve over time (with full history)
|
|
23
|
+
- **Episodic memory** — record experiences with emotional weight, auto-decay, promote lessons to knowledge
|
|
24
|
+
- **Relationships** — track who you've met, interacted with, trust/closeness scores
|
|
25
|
+
- **Behavioral state** — decision tables, failure registries, active hypotheses (a "save file" for behavior)
|
|
26
|
+
- **Conflict detection** — find and resolve contradictions in your memories
|
|
23
27
|
- **A lifeboat** for crash recovery (resume mid-task after context loss)
|
|
24
28
|
- **A working memory** system (survives context window compaction)
|
|
29
|
+
- **Typed events** — hook into boot, reflect, opinion changes
|
|
25
30
|
- **Cryptographic signing** (prove you are who you claim to be)
|
|
26
31
|
|
|
27
32
|
## Get Started in 5 Minutes
|
|
@@ -174,6 +179,68 @@ await anima.opine('identity', 'Identity requires consistency, not continuity.',
|
|
|
174
179
|
### Lifeboat (NOW.md)
|
|
175
180
|
A 30-second crash recovery file. Updated every 2 significant actions. If your agent's context gets wiped mid-task, this is how it resumes. `reflect()` preserves lifeboat content instead of overwriting it.
|
|
176
181
|
|
|
182
|
+
### Episodic Memory
|
|
183
|
+
Record experiences as episodes — with emotional weight, participants, and automatic salience decay:
|
|
184
|
+
|
|
185
|
+
```typescript
|
|
186
|
+
await anima.episodes.record({
|
|
187
|
+
content: 'Had a breakthrough debugging the memory system',
|
|
188
|
+
emotionalWeight: 0.8,
|
|
189
|
+
participants: ['Memo'],
|
|
190
|
+
tags: ['debugging', 'breakthrough'],
|
|
191
|
+
});
|
|
192
|
+
|
|
193
|
+
// Query recent episodes
|
|
194
|
+
const recent = await anima.episodes.query({ limit: 10 });
|
|
195
|
+
|
|
196
|
+
// Consolidate — decay old episodes, promote lessons to knowledge
|
|
197
|
+
const result = await anima.episodes.consolidate();
|
|
198
|
+
// → { decayed: 3, promoted: 1, removed: 0 }
|
|
199
|
+
```
|
|
200
|
+
|
|
201
|
+
### Relationships
|
|
202
|
+
Track people your agent interacts with — closeness, trust, interaction history:
|
|
203
|
+
|
|
204
|
+
```typescript
|
|
205
|
+
await anima.relationships.meet('Alice', { context: 'Met in Discord' });
|
|
206
|
+
await anima.relationships.interact('Alice', 'positive', 'Helped debug my code');
|
|
207
|
+
|
|
208
|
+
const closest = await anima.relationships.closest(5);
|
|
209
|
+
// → [{ name: 'Alice', closeness: 0.7, trust: 0.8, interactions: 3 }]
|
|
210
|
+
```
|
|
211
|
+
|
|
212
|
+
### Behavioral State
|
|
213
|
+
A "save file" for agent behavior — decision tables, failure patterns, active hypotheses:
|
|
214
|
+
|
|
215
|
+
```typescript
|
|
216
|
+
// Record decisions and their outcomes
|
|
217
|
+
await anima.state.recordDecision('greeting-style', 'casual', { confidence: 0.8 });
|
|
218
|
+
await anima.state.recordOutcome('greeting-style', 'casual', true, 'Users responded well');
|
|
219
|
+
|
|
220
|
+
// Track failures to avoid repeating them
|
|
221
|
+
await anima.state.recordFailure({
|
|
222
|
+
action: 'sent-long-message',
|
|
223
|
+
context: 'Discord group chat',
|
|
224
|
+
lesson: 'Keep group chat messages under 3 sentences',
|
|
225
|
+
});
|
|
226
|
+
|
|
227
|
+
// Test hypotheses over time
|
|
228
|
+
await anima.state.createHypothesis({
|
|
229
|
+
claim: 'Users prefer code examples over explanations',
|
|
230
|
+
confidence: 0.6,
|
|
231
|
+
});
|
|
232
|
+
```
|
|
233
|
+
|
|
234
|
+
### Conflict Detection
|
|
235
|
+
Find and resolve contradictions in your memories:
|
|
236
|
+
|
|
237
|
+
```typescript
|
|
238
|
+
const conflicts = await anima.detectConflicts();
|
|
239
|
+
// → [{ memory1: ..., memory2: ..., reason: 'Contradictory claims about...' }]
|
|
240
|
+
|
|
241
|
+
await anima.resolveConflict(conflictId, 'memory1', 'Newer information is more accurate');
|
|
242
|
+
```
|
|
243
|
+
|
|
177
244
|
### Identity Signing
|
|
178
245
|
Cryptographic proof that an agent is who they claim to be. Ed25519 signatures, zero external dependencies.
|
|
179
246
|
|
|
@@ -196,8 +263,19 @@ anima-data/
|
|
|
196
263
|
├── memory/
|
|
197
264
|
│ ├── YYYY-MM-DD.md — Daily logs (human-readable markdown)
|
|
198
265
|
│ └── memories.json — Structured index with decay/salience scores
|
|
199
|
-
|
|
200
|
-
|
|
266
|
+
├── opinions/
|
|
267
|
+
│ └── opinions.json — Opinions with confidence + evolution history
|
|
268
|
+
├── episodes/
|
|
269
|
+
│ └── episodes.json — Episodic memory with salience decay
|
|
270
|
+
├── relationships/
|
|
271
|
+
│ └── relationships.json — People you've met, trust/closeness scores
|
|
272
|
+
├── state/
|
|
273
|
+
│ ├── decisions.json — Decision tables with outcomes
|
|
274
|
+
│ ├── failures.json — Failure registry (don't repeat mistakes)
|
|
275
|
+
│ ├── hypotheses.json — Active hypotheses under test
|
|
276
|
+
│ └── params.json — Behavioral parameters
|
|
277
|
+
└── conflicts/
|
|
278
|
+
└── conflicts.json — Detected memory contradictions
|
|
201
279
|
```
|
|
202
280
|
|
|
203
281
|
## Dogfooded
|