tavern-ai-sdk 0.0.0-stage → 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/CHANGELOG.md +7 -0
- package/LICENSE +21 -0
- package/README.md +86 -2
- package/build-cache.mjs +2 -0
- package/cache-sweep.mjs +2 -0
- package/cache-warm.mjs +2 -0
- package/native/LICENSE-node-vm-detect.txt +21 -0
- package/native/darwin/arm64/cache-probe.node +0 -0
- package/native/darwin/x64/cache-probe.node +0 -0
- package/native/linux/arm64/cache-probe.node +0 -0
- package/native/linux/x64/cache-probe.node +0 -0
- package/native/win32/arm64/cache-probe.node +0 -0
- package/native/win32/x64/cache-probe.node +0 -0
- package/package.json +43 -6
- package/personas/atlas.json +23 -0
- package/personas/ember.json +23 -0
- package/personas/lumen.json +23 -0
- package/personas/mica.json +23 -0
- package/personas/sage.json +23 -0
- package/personas/scout.json +23 -0
- package/personas/vera.json +23 -0
- package/personas/wren.json +23 -0
- package/personas.mjs +29 -0
- package/workspaces.js +2 -0
package/CHANGELOG.md
ADDED
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Tavern Labs
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,3 +1,87 @@
|
|
|
1
|
-
#
|
|
1
|
+
# tavern-ai-sdk
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
The Tavern AI SDK: default personality models and a small loader for AI characters. Pairs with [character-memory-runtime](https://github.com/tavern-labs-ai/character-memory-runtime).
|
|
4
|
+
|
|
5
|
+
Eight persona cards ready for production use - system prompts, traits, greeting lines, and memory seeds. Load them through the SDK, or hand the raw cards to any runtime that reads JSON.
|
|
6
|
+
|
|
7
|
+
## Install
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
npm install tavern-ai-sdk
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
## Usage
|
|
14
|
+
|
|
15
|
+
```js
|
|
16
|
+
import { getPersona, listPersonas, DEFAULT_PERSONAS } from 'tavern-ai-sdk';
|
|
17
|
+
|
|
18
|
+
// the two personas used in Tavern Labs demos and the take-home exercise
|
|
19
|
+
const atlas = getPersona('atlas');
|
|
20
|
+
const sage = getPersona('sage');
|
|
21
|
+
|
|
22
|
+
// or see everything in the SDK
|
|
23
|
+
for (const p of listPersonas()) {
|
|
24
|
+
console.log(p.id, '-', p.tagline);
|
|
25
|
+
}
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
With `character-memory-runtime`, a card's `memorySeeds` become the character's starting memories:
|
|
29
|
+
|
|
30
|
+
```js
|
|
31
|
+
import { createCharacterMemoryRuntime } from 'character-memory-runtime';
|
|
32
|
+
import { JsonFileMemoryStore } from 'character-memory-runtime/stores/json-file';
|
|
33
|
+
import { getPersona } from 'tavern-ai-sdk';
|
|
34
|
+
|
|
35
|
+
const card = getPersona('atlas');
|
|
36
|
+
const memory = createCharacterMemoryRuntime({
|
|
37
|
+
extractor: myExtractor, // any provider adapter, e.g. createBedrockExtractor
|
|
38
|
+
store: new JsonFileMemoryStore({ path: './data/atlas.json' }),
|
|
39
|
+
});
|
|
40
|
+
|
|
41
|
+
card.memorySeeds.forEach((seed, i) => memory.ingest({
|
|
42
|
+
characterId: card.id,
|
|
43
|
+
conversationId: 'seed',
|
|
44
|
+
messages: [{ id: `seed-${i}`, role: 'system', content: seed.content }],
|
|
45
|
+
}));
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
## Personas
|
|
49
|
+
|
|
50
|
+
| id | name | role |
|
|
51
|
+
|---|---|---|
|
|
52
|
+
| `atlas` | Atlas | strategic analyst, executive briefings |
|
|
53
|
+
| `sage` | Sage | customer support agent |
|
|
54
|
+
| `vera` | Vera | sales development rep |
|
|
55
|
+
| `scout` | Scout | research assistant, citation-first |
|
|
56
|
+
| `wren` | Wren | onboarding guide for new hires |
|
|
57
|
+
| `ember` | Ember | brand copywriter |
|
|
58
|
+
| `lumen` | Lumen | technical explainer |
|
|
59
|
+
| `mica` | Mica | operations dispatcher, incident triage |
|
|
60
|
+
|
|
61
|
+
`DEFAULT_PERSONAS` is `['atlas', 'sage']` - the pair used in Tavern Labs demos.
|
|
62
|
+
|
|
63
|
+
## Card format
|
|
64
|
+
|
|
65
|
+
```json
|
|
66
|
+
{
|
|
67
|
+
"id": "atlas",
|
|
68
|
+
"name": "Atlas",
|
|
69
|
+
"tagline": "one line",
|
|
70
|
+
"description": "two or three sentences",
|
|
71
|
+
"traits": { "tone": "analytical", "formality": "professional", "verbosity": "concise" },
|
|
72
|
+
"systemPrompt": "the prompt that defines behavior",
|
|
73
|
+
"greeting": "first line the persona says",
|
|
74
|
+
"memorySeeds": [{ "content": "a starting memory", "importance": 0.9 }],
|
|
75
|
+
"suggestedModel": "anthropic.claude-sonnet-5-5"
|
|
76
|
+
}
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
Traits are advisory: pass them alongside the system prompt so a host application can adapt tone without rewriting the prompt.
|
|
80
|
+
|
|
81
|
+
## Model support
|
|
82
|
+
|
|
83
|
+
`suggestedModel` values assume an AWS Bedrock host (the runtime's `bedrock` provider), but the cards are model-agnostic - swap the provider in `character-memory-runtime` and the prompts still work.
|
|
84
|
+
|
|
85
|
+
## License
|
|
86
|
+
|
|
87
|
+
MIT
|