@framers/agentos 0.1.143 → 0.1.145
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 +157 -279
- package/dist/discovery/CapabilityDiscoveryEngine.d.ts.map +1 -1
- package/dist/discovery/CapabilityDiscoveryEngine.js +82 -5
- package/dist/discovery/CapabilityDiscoveryEngine.js.map +1 -1
- package/dist/memory/pipeline/observation/MemoryObserver.d.ts.map +1 -1
- package/dist/memory/pipeline/observation/MemoryObserver.js +5 -0
- package/dist/memory/pipeline/observation/MemoryObserver.js.map +1 -1
- package/dist/query-router/QueryRouter.d.ts +11 -0
- package/dist/query-router/QueryRouter.d.ts.map +1 -1
- package/dist/query-router/QueryRouter.js +85 -31
- package/dist/query-router/QueryRouter.js.map +1 -1
- package/dist/query-router/types.d.ts +9 -0
- package/dist/query-router/types.d.ts.map +1 -1
- package/dist/query-router/types.js.map +1 -1
- package/knowledge/platform-corpus.json +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -25,9 +25,15 @@
|
|
|
25
25
|
|
|
26
26
|
- [Overview](#overview)
|
|
27
27
|
- [Quick Start](#quick-start)
|
|
28
|
-
- [
|
|
29
|
-
- [
|
|
30
|
-
- [
|
|
28
|
+
- [1. Generate Text (Provider-First)](#1-generate-text-provider-first)
|
|
29
|
+
- [2. Agent with Personality & Memory](#2-agent-with-personality--memory)
|
|
30
|
+
- [3. Multimodal RAG](#3-multimodal-rag)
|
|
31
|
+
- [4. Structured Output (Zod Validation)](#4-structured-output-zod-validation)
|
|
32
|
+
- [5. Workflows & Graphs](#5-workflows--graphs)
|
|
33
|
+
- [6. Multi-Agent Teams](#6-multi-agent-teams)
|
|
34
|
+
- [7. Voice Pipeline](#7-voice-pipeline)
|
|
35
|
+
- [8. Guardrails & Security](#8-guardrails--security)
|
|
36
|
+
- [Default Models Per Provider](#default-models-per-provider)
|
|
31
37
|
- [System Architecture](#system-architecture)
|
|
32
38
|
- [Architecture Diagram](#architecture-diagram)
|
|
33
39
|
- [Request Lifecycle](#request-lifecycle)
|
|
@@ -85,7 +91,7 @@
|
|
|
85
91
|
|
|
86
92
|
## Overview
|
|
87
93
|
|
|
88
|
-
`@framers/agentos` is an open-source TypeScript AI agent runtime for building, deploying, and managing production AI agents. It provides multimodal RAG with cognitive memory (Ebbinghaus decay, 8 neuroscience-backed mechanisms including reconsolidation, retrieval-induced forgetting, involuntary recall, metacognitive FOK, temporal gist extraction, schema encoding, source confidence decay, and emotion regulation — all HEXACO personality-modulated), multi-agent orchestration, 37 channel adapters,
|
|
94
|
+
`@framers/agentos` is an open-source TypeScript AI agent runtime for building, deploying, and managing production AI agents. It provides multimodal RAG with cognitive memory (Ebbinghaus decay, 8 neuroscience-backed mechanisms including reconsolidation, retrieval-induced forgetting, involuntary recall, metacognitive FOK, temporal gist extraction, schema encoding, source confidence decay, and emotion regulation — all HEXACO personality-modulated), multi-agent orchestration, 37 channel adapters, 6 guardrail packs (PII redaction, ML classifiers, topicality, code safety, grounding guard, content policy rewriter) with prompt injection defense, 21 LLM providers, and 72 curated skills. Self-hostable and production-ready, it handles the full lifecycle from prompt construction through tool execution, safety evaluation, and streaming response delivery.
|
|
89
95
|
|
|
90
96
|
**Key facts:**
|
|
91
97
|
|
|
@@ -144,6 +150,7 @@
|
|
|
144
150
|
| **@framers/agentos-ext-topicality** | Embedding-based topic enforcement + drift detection | [](https://www.npmjs.com/package/@framers/agentos-ext-topicality) · [Docs](https://docs.agentos.sh/extensions/built-in/topicality) |
|
|
145
151
|
| **@framers/agentos-ext-code-safety** | OWASP Top 10 code scanning (25 regex rules) | [](https://www.npmjs.com/package/@framers/agentos-ext-code-safety) · [Docs](https://docs.agentos.sh/extensions/built-in/code-safety) |
|
|
146
152
|
| **@framers/agentos-ext-grounding-guard** | RAG-grounded hallucination detection via NLI | [](https://www.npmjs.com/package/@framers/agentos-ext-grounding-guard) · [Docs](https://docs.agentos.sh/extensions/built-in/grounding-guard) |
|
|
153
|
+
| **@framers/agentos-ext-content-policy-rewriter** | Opt-in content policy (8 categories, LLM rewrite/block, 4 presets) | [Docs](https://docs.agentos.sh/extensions/built-in/content-policy-rewriter) |
|
|
147
154
|
|
|
148
155
|
---
|
|
149
156
|
|
|
@@ -153,349 +160,219 @@
|
|
|
153
160
|
npm install @framers/agentos
|
|
154
161
|
```
|
|
155
162
|
|
|
156
|
-
|
|
163
|
+
Set any provider's API key and you're ready:
|
|
157
164
|
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
- Use [`generateText()` / `streamText()` / `generateObject()` / `streamObject()` / `embedText()` / `generateImage()` / `agent()`](./docs/getting-started/HIGH_LEVEL_API.md) for the fastest path from prompt to working code.
|
|
162
|
-
- Use [`AgentOS`](#advanced-agentgraph-and-full-runtime) when you need extensions, workflows, personas, or full runtime lifecycle control.
|
|
163
|
-
- Browse the live docs at [docs.agentos.sh/getting-started/high-level-api](https://docs.agentos.sh/getting-started/high-level-api) and [docs.agentos.sh/api](https://docs.agentos.sh/api).
|
|
165
|
+
```bash
|
|
166
|
+
export OPENAI_API_KEY=sk-... # or ANTHROPIC_API_KEY, GEMINI_API_KEY, GROQ_API_KEY, etc.
|
|
167
|
+
```
|
|
164
168
|
|
|
165
|
-
###
|
|
169
|
+
### 1. Generate Text (Provider-First)
|
|
166
170
|
|
|
167
|
-
|
|
168
|
-
multiple specialised agents. Three lines to go from prompt to a coordinated
|
|
169
|
-
research-and-writing pipeline:
|
|
171
|
+
No model strings needed — AgentOS picks the best default:
|
|
170
172
|
|
|
171
173
|
```typescript
|
|
172
|
-
import {
|
|
174
|
+
import { generateText, streamText } from '@framers/agentos';
|
|
173
175
|
|
|
174
|
-
const
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
writer: { instructions: 'Write a clear, concise summary.' },
|
|
178
|
-
},
|
|
179
|
-
strategy: 'sequential',
|
|
176
|
+
const result = await generateText({
|
|
177
|
+
provider: 'anthropic',
|
|
178
|
+
prompt: 'Explain how TCP handshakes work in 3 bullets.',
|
|
180
179
|
});
|
|
181
|
-
|
|
182
|
-
const result = await team.generate('Summarise recent advances in fusion energy.');
|
|
183
180
|
console.log(result.text);
|
|
184
|
-
```
|
|
185
|
-
|
|
186
|
-
Set any provider's API key (`ANTHROPIC_API_KEY`, `OPENAI_API_KEY`, `GEMINI_API_KEY`,
|
|
187
|
-
`GROQ_API_KEY`, `OLLAMA_BASE_URL`, etc.) and the agency auto-detects the provider.
|
|
188
|
-
All five strategies are available out of the box:
|
|
189
181
|
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
| `debate` | Agents argue and refine a shared answer over multiple rounds |
|
|
195
|
-
| `review-loop` | One agent drafts, another reviews and requests revisions |
|
|
196
|
-
| `hierarchical` | A coordinator dispatches sub-tasks to specialist agents at runtime |
|
|
197
|
-
| `graph` | Explicit dependency DAG via `dependsOn`; tiers run concurrently |
|
|
198
|
-
|
|
199
|
-
**Graph strategy** — declare dependencies between agents and let the orchestrator
|
|
200
|
-
handle topological ordering and concurrent execution:
|
|
201
|
-
|
|
202
|
-
```typescript
|
|
203
|
-
const team = agency({
|
|
204
|
-
agents: {
|
|
205
|
-
researcher: { instructions: 'Research the topic.' },
|
|
206
|
-
writer: { instructions: 'Write an article.', dependsOn: ['researcher'] },
|
|
207
|
-
illustrator: { instructions: 'Describe illustrations.', dependsOn: ['researcher'] },
|
|
208
|
-
reviewer: { instructions: 'Review everything.', dependsOn: ['writer', 'illustrator'] },
|
|
209
|
-
},
|
|
210
|
-
strategy: 'graph', // auto-detected when any agent has dependsOn
|
|
211
|
-
});
|
|
182
|
+
// Streaming
|
|
183
|
+
for await (const chunk of streamText({ provider: 'openai', prompt: 'Explain SYN-ACK.' }).textStream) {
|
|
184
|
+
process.stdout.write(chunk);
|
|
185
|
+
}
|
|
212
186
|
```
|
|
213
187
|
|
|
214
|
-
|
|
215
|
-
transport, `connect()` for channel adapters, RAG context injection, and real
|
|
216
|
-
per-agent stream events in the same config object — see
|
|
217
|
-
[`docs/orchestration/AGENCY_API.md`](./docs/orchestration/AGENCY_API.md) for the full reference.
|
|
188
|
+
16 providers supported. Automatic fallback when one fails (402/429/5xx → tries next available key).
|
|
218
189
|
|
|
219
|
-
###
|
|
190
|
+
### 2. Agent with Personality & Memory
|
|
220
191
|
|
|
221
|
-
|
|
222
|
-
output extraction, embedding generation, image generation, or a single stateful
|
|
223
|
-
session without a multi-agent team.
|
|
224
|
-
|
|
225
|
-
#### Provider-First Pattern (Recommended)
|
|
226
|
-
|
|
227
|
-
The recommended way to call any helper is **provider-first**: specify the provider
|
|
228
|
-
name and let AgentOS pick the best default model automatically. No model string
|
|
229
|
-
needed -- just set the matching environment variable and go.
|
|
192
|
+
Agents have HEXACO personality traits that shape their communication style, and cognitive memory with Ebbinghaus decay:
|
|
230
193
|
|
|
231
194
|
```typescript
|
|
232
|
-
import {
|
|
233
|
-
|
|
234
|
-
// Provider-first -- AgentOS picks the best default model
|
|
235
|
-
const result = await generateText({
|
|
236
|
-
provider: 'openai',
|
|
237
|
-
prompt: 'Explain TCP handshakes in 3 bullets.',
|
|
238
|
-
});
|
|
195
|
+
import { agent } from '@framers/agentos';
|
|
239
196
|
|
|
240
|
-
|
|
241
|
-
const result2 = await generateText({
|
|
197
|
+
const tutor = agent({
|
|
242
198
|
provider: 'anthropic',
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
//
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
199
|
+
instructions: 'You are a patient computer science tutor.',
|
|
200
|
+
personality: {
|
|
201
|
+
openness: 0.9, // creative, exploratory answers
|
|
202
|
+
conscientiousness: 0.95, // thorough, well-structured
|
|
203
|
+
agreeableness: 0.85, // warm, encouraging tone
|
|
204
|
+
},
|
|
205
|
+
memory: {
|
|
206
|
+
enabled: true,
|
|
207
|
+
cognitive: true, // Ebbinghaus decay, reconsolidation, involuntary recall
|
|
208
|
+
},
|
|
250
209
|
});
|
|
251
|
-
```
|
|
252
|
-
|
|
253
|
-
The same pattern works across **every helper function**: `generateText`, `streamText`,
|
|
254
|
-
`generateObject`, `streamObject`, `embedText`, `generateImage`, and `agent`.
|
|
255
210
|
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
from a built-in registry. Set the matching env var and you are ready to go:
|
|
260
|
-
|
|
261
|
-
| Provider | Default Model | Env Var |
|
|
262
|
-
|---|---|---|
|
|
263
|
-
| `openai` | `gpt-4o` | `OPENAI_API_KEY` |
|
|
264
|
-
| `anthropic` | `claude-sonnet-4-20250514` | `ANTHROPIC_API_KEY` |
|
|
265
|
-
| `gemini` | `gemini-2.5-flash` | `GEMINI_API_KEY` |
|
|
266
|
-
| `ollama` | `llama3.2` | `OLLAMA_BASE_URL` |
|
|
267
|
-
| `groq` | `llama-3.3-70b-versatile` | `GROQ_API_KEY` |
|
|
268
|
-
| `openrouter` | `openai/gpt-4o` | `OPENROUTER_API_KEY` |
|
|
269
|
-
| `together` | `Meta-Llama-3.1-70B-Instruct-Turbo` | `TOGETHER_API_KEY` |
|
|
270
|
-
| `mistral` | `mistral-large-latest` | `MISTRAL_API_KEY` |
|
|
271
|
-
| `xai` | `grok-2` | `XAI_API_KEY` |
|
|
211
|
+
const session = tutor.session('student-1');
|
|
212
|
+
const reply = await session.send('Explain recursion with an analogy.');
|
|
213
|
+
console.log(reply.text);
|
|
272
214
|
|
|
273
|
-
|
|
274
|
-
|
|
215
|
+
// Memory persists across sessions — the agent remembers context
|
|
216
|
+
const followUp = await session.send('Can you expand on that?');
|
|
217
|
+
console.log(followUp.text);
|
|
218
|
+
```
|
|
275
219
|
|
|
276
|
-
|
|
220
|
+
### 3. Multimodal RAG
|
|
277
221
|
|
|
278
|
-
|
|
222
|
+
Ingest documents, images, and structured data — retrieve with HyDE (Hypothetical Document Embedding):
|
|
279
223
|
|
|
280
224
|
```typescript
|
|
281
|
-
import {
|
|
282
|
-
|
|
283
|
-
// OpenAI
|
|
284
|
-
await generateText({ provider: 'openai', prompt: 'What is QUIC?' });
|
|
225
|
+
import { agent } from '@framers/agentos';
|
|
285
226
|
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
await generateText({ provider: 'ollama', prompt: 'What is QUIC?' });
|
|
227
|
+
const analyst = agent({
|
|
228
|
+
provider: 'openai',
|
|
229
|
+
instructions: 'You are a financial analyst. Answer questions using provided documents.',
|
|
230
|
+
rag: {
|
|
231
|
+
enabled: true,
|
|
232
|
+
mode: 'aggressive', // always retrieves before answering
|
|
233
|
+
topK: 10,
|
|
234
|
+
strategy: 'hyde', // generates hypothetical answers for better retrieval
|
|
235
|
+
},
|
|
236
|
+
});
|
|
297
237
|
|
|
298
|
-
|
|
299
|
-
await generateText({ provider: 'openrouter', prompt: 'What is QUIC?' });
|
|
238
|
+
const session = analyst.session('q4-review');
|
|
300
239
|
|
|
301
|
-
//
|
|
302
|
-
await
|
|
240
|
+
// Ingest documents
|
|
241
|
+
await session.ingest('Q4 revenue grew 23% YoY to $4.2B...');
|
|
242
|
+
await session.ingest({ type: 'file', path: './earnings-report.pdf' });
|
|
303
243
|
|
|
304
|
-
|
|
305
|
-
|
|
244
|
+
const answer = await session.send('What drove revenue growth in Q4?');
|
|
245
|
+
console.log(answer.text); // Cites specific passages from ingested docs
|
|
306
246
|
```
|
|
307
247
|
|
|
308
|
-
|
|
248
|
+
### 4. Structured Output (Zod Validation)
|
|
309
249
|
|
|
310
|
-
|
|
250
|
+
Extract typed data from unstructured text:
|
|
311
251
|
|
|
312
252
|
```typescript
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
provider: 'openai',
|
|
316
|
-
model: 'gpt-4o-mini',
|
|
317
|
-
prompt: 'Classify this support ticket.',
|
|
318
|
-
});
|
|
253
|
+
import { generateObject } from '@framers/agentos';
|
|
254
|
+
import { z } from 'zod';
|
|
319
255
|
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
256
|
+
const { object } = await generateObject({
|
|
257
|
+
provider: 'gemini',
|
|
258
|
+
schema: z.object({
|
|
259
|
+
name: z.string(),
|
|
260
|
+
sentiment: z.enum(['positive', 'negative', 'neutral']),
|
|
261
|
+
topics: z.array(z.string()),
|
|
262
|
+
}),
|
|
263
|
+
prompt: 'Analyze: "The new iPhone camera is incredible but the battery life is disappointing."',
|
|
325
264
|
});
|
|
326
265
|
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
provider: 'ollama',
|
|
330
|
-
model: 'codellama',
|
|
331
|
-
prompt: 'Write a Python fizzbuzz.',
|
|
332
|
-
});
|
|
266
|
+
console.log(object);
|
|
267
|
+
// { name: "iPhone Review", sentiment: "mixed", topics: ["camera", "battery"] }
|
|
333
268
|
```
|
|
334
269
|
|
|
335
|
-
|
|
270
|
+
### 5. Workflows & Graphs
|
|
336
271
|
|
|
337
|
-
|
|
338
|
-
priority order. Set one key and every call uses that provider automatically --
|
|
339
|
-
no `provider` field needed:
|
|
340
|
-
|
|
341
|
-
```bash
|
|
342
|
-
# Set one of these -- AgentOS picks the first it finds:
|
|
343
|
-
# Priority: OPENROUTER > OPENAI > ANTHROPIC > GEMINI > GROQ > TOGETHER > MISTRAL > XAI > OLLAMA
|
|
344
|
-
export ANTHROPIC_API_KEY=sk-ant-...
|
|
345
|
-
```
|
|
272
|
+
Deterministic multi-step pipelines with branching, parallel execution, and checkpointing:
|
|
346
273
|
|
|
347
274
|
```typescript
|
|
348
|
-
import {
|
|
275
|
+
import { workflow } from '@framers/agentos';
|
|
349
276
|
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
277
|
+
const pipeline = workflow('content-pipeline')
|
|
278
|
+
.step('research', { provider: 'anthropic', instructions: 'Research the topic thoroughly.' })
|
|
279
|
+
.step('draft', { provider: 'openai', instructions: 'Write a blog post from the research.' })
|
|
280
|
+
.step('review', { provider: 'anthropic', instructions: 'Review for accuracy and tone.' })
|
|
281
|
+
.step('publish', { tool: 'blog_publish' });
|
|
353
282
|
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
The `provider:model` string format still works but provider-first is preferred:
|
|
357
|
-
|
|
358
|
-
```typescript
|
|
359
|
-
// Legacy format -- still fully supported but not recommended for new code
|
|
360
|
-
await generateText({ model: 'openai:gpt-4o', prompt: '...' });
|
|
361
|
-
await generateText({ model: 'anthropic:claude-sonnet-4-20250514', prompt: '...' });
|
|
362
|
-
await generateText({ model: 'ollama:llama3.2', prompt: '...' });
|
|
283
|
+
const result = await pipeline.run('Write a post about WebAssembly in 2026.');
|
|
284
|
+
console.log(result.text);
|
|
363
285
|
```
|
|
364
286
|
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
```typescript
|
|
368
|
-
import {
|
|
369
|
-
agent, embedText, generateImage, generateObject, streamText, streamObject,
|
|
370
|
-
} from '@framers/agentos';
|
|
371
|
-
import { z } from 'zod';
|
|
287
|
+
### 6. Multi-Agent Teams
|
|
372
288
|
|
|
373
|
-
|
|
374
|
-
const live = streamText({
|
|
375
|
-
provider: 'anthropic',
|
|
376
|
-
prompt: 'Stream a short explanation of SYN, SYN-ACK, ACK.',
|
|
377
|
-
});
|
|
289
|
+
Coordinate specialized agents with built-in strategies:
|
|
378
290
|
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
}
|
|
291
|
+
```typescript
|
|
292
|
+
import { agency } from '@framers/agentos';
|
|
382
293
|
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
294
|
+
const team = agency({
|
|
295
|
+
agents: {
|
|
296
|
+
researcher: {
|
|
297
|
+
instructions: 'Find relevant facts and data.',
|
|
298
|
+
provider: 'anthropic',
|
|
299
|
+
},
|
|
300
|
+
writer: {
|
|
301
|
+
instructions: 'Write a clear, engaging summary.',
|
|
302
|
+
provider: 'openai',
|
|
303
|
+
},
|
|
304
|
+
reviewer: {
|
|
305
|
+
instructions: 'Check for accuracy and suggest improvements.',
|
|
306
|
+
provider: 'gemini',
|
|
307
|
+
dependsOn: ['writer'], // runs after writer
|
|
308
|
+
},
|
|
309
|
+
},
|
|
310
|
+
strategy: 'graph', // dependency-based DAG execution
|
|
311
|
+
memory: { shared: true }, // agents share context
|
|
387
312
|
});
|
|
388
313
|
|
|
389
|
-
|
|
314
|
+
const result = await team.generate('Compare TCP vs UDP for game networking.');
|
|
315
|
+
console.log(result.text);
|
|
316
|
+
```
|
|
390
317
|
|
|
391
|
-
|
|
392
|
-
const { object } = await generateObject({
|
|
393
|
-
provider: 'gemini',
|
|
394
|
-
schema: z.object({ name: z.string(), age: z.number() }),
|
|
395
|
-
prompt: 'Extract: "John is 30 years old"',
|
|
396
|
-
});
|
|
318
|
+
6 strategies: `sequential`, `parallel`, `debate`, `review-loop`, `hierarchical`, `graph`.
|
|
397
319
|
|
|
398
|
-
|
|
320
|
+
### 7. Voice Pipeline
|
|
399
321
|
|
|
400
|
-
|
|
401
|
-
const structured = streamObject({
|
|
402
|
-
provider: 'groq',
|
|
403
|
-
schema: z.object({ title: z.string(), tags: z.array(z.string()) }),
|
|
404
|
-
prompt: 'Generate metadata for an article about TCP.',
|
|
405
|
-
});
|
|
322
|
+
Real-time speech-to-text and text-to-speech with streaming:
|
|
406
323
|
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
}
|
|
410
|
-
console.log('final:', await structured.object);
|
|
324
|
+
```typescript
|
|
325
|
+
import { agent } from '@framers/agentos';
|
|
411
326
|
|
|
412
|
-
|
|
413
|
-
const { embeddings } = await embedText({
|
|
327
|
+
const receptionist = agent({
|
|
414
328
|
provider: 'openai',
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
}
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
// Stateful agent session with Anthropic
|
|
422
|
-
const assistant = agent({
|
|
423
|
-
provider: 'anthropic',
|
|
424
|
-
instructions: 'You are a concise networking tutor.',
|
|
425
|
-
maxSteps: 3,
|
|
329
|
+
instructions: 'You are a friendly receptionist for a dental clinic.',
|
|
330
|
+
voice: {
|
|
331
|
+
tts: { provider: 'elevenlabs', voice: 'Rachel' },
|
|
332
|
+
stt: { provider: 'deepgram' },
|
|
333
|
+
},
|
|
426
334
|
});
|
|
427
335
|
|
|
428
|
-
|
|
429
|
-
const
|
|
430
|
-
|
|
431
|
-
console.log(await session.usage());
|
|
336
|
+
// Voice sessions stream audio in real-time
|
|
337
|
+
const call = receptionist.voiceSession('call-1');
|
|
338
|
+
await call.start(); // begins listening
|
|
432
339
|
```
|
|
433
340
|
|
|
434
|
-
|
|
435
|
-
|
|
341
|
+
### 8. Guardrails & Security
|
|
342
|
+
|
|
343
|
+
5-tier security with PII redaction, prompt injection defense, and code scanning:
|
|
436
344
|
|
|
437
345
|
```typescript
|
|
438
|
-
import {
|
|
346
|
+
import { agent } from '@framers/agentos';
|
|
439
347
|
|
|
440
|
-
|
|
348
|
+
const secureBot = agent({
|
|
441
349
|
provider: 'anthropic',
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
```
|
|
448
|
-
|
|
449
|
-
With `enabled: true`, AgentOS writes to the shared home ledger at `~/.framers/usage-ledger.jsonl` unless you provide `usageLedger.path` or one of the ledger env vars.
|
|
450
|
-
|
|
451
|
-
Built-in image providers: `openai`, `openrouter`, `stability`, and `replicate`.
|
|
452
|
-
|
|
453
|
-
Use `providerOptions` when you need provider-native controls without leaving the high-level API:
|
|
454
|
-
|
|
455
|
-
```typescript
|
|
456
|
-
const poster = await generateImage({
|
|
457
|
-
model: 'stability:stable-image-core',
|
|
458
|
-
prompt: 'An art deco travel poster for a moon colony',
|
|
459
|
-
negativePrompt: 'text, watermark',
|
|
460
|
-
providerOptions: {
|
|
461
|
-
stability: {
|
|
462
|
-
stylePreset: 'illustration',
|
|
463
|
-
seed: 42,
|
|
464
|
-
cfgScale: 8,
|
|
465
|
-
},
|
|
350
|
+
instructions: 'You are a customer support agent.',
|
|
351
|
+
security: { tier: 'strict' },
|
|
352
|
+
guardrails: {
|
|
353
|
+
input: ['pii-redaction', 'ml-classifiers'], // block PII + detect injection
|
|
354
|
+
output: ['grounding-guard', 'code-safety'], // prevent hallucination + unsafe code
|
|
466
355
|
},
|
|
467
356
|
});
|
|
468
357
|
```
|
|
469
358
|
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
### Advanced: AgentGraph and Full Runtime
|
|
473
|
-
|
|
474
|
-
Use `AgentGraph` or the full `AgentOS` runtime when you need programmatic graph
|
|
475
|
-
construction with custom edge callbacks, extensions, workflow DSL, personas,
|
|
476
|
-
chunk-level streaming events, or full runtime lifecycle control.
|
|
359
|
+
5 tiers: `dangerous` → `permissive` → `balanced` → `strict` → `paranoid`.
|
|
477
360
|
|
|
478
|
-
|
|
479
|
-
import { AgentOS, AgentOSResponseChunkType } from '@framers/agentos';
|
|
480
|
-
import { createTestAgentOSConfig } from '@framers/agentos/config/AgentOSConfig';
|
|
361
|
+
### Default Models Per Provider
|
|
481
362
|
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
See [`docs/architecture/AGENT_GRAPH.md`](./docs/architecture/AGENT_GRAPH.md) for the `AgentGraph` programmatic
|
|
497
|
-
graph builder and [`docs/orchestration/WORKFLOW_DSL.md`](./docs/orchestration/WORKFLOW_DSL.md) for the workflow
|
|
498
|
-
DSL.
|
|
363
|
+
| Provider | Default Model | Env Var |
|
|
364
|
+
|---|---|---|
|
|
365
|
+
| openai | gpt-4o | `OPENAI_API_KEY` |
|
|
366
|
+
| anthropic | claude-sonnet-4 | `ANTHROPIC_API_KEY` |
|
|
367
|
+
| gemini | gemini-2.5-flash | `GEMINI_API_KEY` |
|
|
368
|
+
| ollama | llama3.2 | `OLLAMA_BASE_URL` |
|
|
369
|
+
| groq | llama-3.3-70b | `GROQ_API_KEY` |
|
|
370
|
+
| openrouter | openai/gpt-4o | `OPENROUTER_API_KEY` |
|
|
371
|
+
| together | meta-llama/Meta-Llama-3.1-70B | `TOGETHER_API_KEY` |
|
|
372
|
+
| mistral | mistral-large-latest | `MISTRAL_API_KEY` |
|
|
373
|
+
| xai | grok-3-mini | `XAI_API_KEY` |
|
|
374
|
+
|
|
375
|
+
Automatic fallback: when a provider fails, AgentOS tries the next available API key.
|
|
499
376
|
|
|
500
377
|
---
|
|
501
378
|
|
|
@@ -909,6 +786,7 @@ type ExtensionPackResolver =
|
|
|
909
786
|
| Topicality | `@framers/agentos-ext-topicality` | `topicality-guardrail` | `check_topic` | On-topic enforcement and session drift detection |
|
|
910
787
|
| Code Safety | `@framers/agentos-ext-code-safety` | `code-safety-guardrail` | `scan_code` | Regex-based code risk scanning across fenced code and tool args |
|
|
911
788
|
| Grounding Guard | `@framers/agentos-ext-grounding-guard` | `grounding-guardrail` | `check_grounding` | RAG-source claim verification and hallucination detection |
|
|
789
|
+
| Content Policy Rewriter | `@framers/agentos-ext-content-policy-rewriter` | `content-policy-rewriter-guardrail` | — | Opt-in content policy: 8 categories (illegal_harmful, adult, profanity, violence, self_harm, hate_speech, illegal_activity, custom), keyword pre-filter + LLM judge/rewriter, 4 presets |
|
|
912
790
|
|
|
913
791
|
---
|
|
914
792
|
|
|
@@ -1046,14 +924,14 @@ See [`docs/memory/MEMORY_SCALING.md`](./docs/memory/MEMORY_SCALING.md), [`docs/m
|
|
|
1046
924
|
|
|
1047
925
|
**Location:** `knowledge/platform-corpus.json`
|
|
1048
926
|
|
|
1049
|
-
AgentOS ships with **
|
|
927
|
+
AgentOS ships with **244 pre-built knowledge entries** covering the entire platform surface area. When the QueryRouter initializes, these entries are automatically loaded alongside your project-specific documentation corpus, giving every agent instant knowledge about AgentOS capabilities with zero configuration.
|
|
1050
928
|
|
|
1051
929
|
**Coverage breakdown:**
|
|
1052
930
|
|
|
1053
931
|
| Category | Count | What it covers |
|
|
1054
932
|
|----------|-------|---------------|
|
|
1055
933
|
| Tools | 105 | Every tool and channel adapter (Discord, Telegram, LinkedIn, Bluesky, etc.) |
|
|
1056
|
-
| Skills |
|
|
934
|
+
| Skills | 80 | All curated skills from the skills registry |
|
|
1057
935
|
| FAQ | 30 | Common questions (voice setup, supported models, streaming, OCR, etc.) |
|
|
1058
936
|
| API | 14 | Core API functions (generateText, streamText, agent, agency, etc.) |
|
|
1059
937
|
| Troubleshooting | 15 | Common errors and their fixes (missing API keys, model not found, etc.) |
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CapabilityDiscoveryEngine.d.ts","sourceRoot":"","sources":["../../src/discovery/CapabilityDiscoveryEngine.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;
|
|
1
|
+
{"version":3,"file":"CapabilityDiscoveryEngine.d.ts","sourceRoot":"","sources":["../../src/discovery/CapabilityDiscoveryEngine.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAMH,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,yCAAyC,CAAC;AACjF,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,sCAAsC,CAAC;AACzE,OAAO,KAAK,EACV,yBAAyB,EACzB,yBAAyB,EACzB,oBAAoB,EACpB,sBAAsB,EACtB,qBAAqB,EACrB,0BAA0B,EAC1B,kBAAkB,EACnB,MAAM,YAAY,CAAC;AACpB,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AAYzD,qBAAa,yBAA0B,YAAW,0BAA0B;IAC1E,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAkB;IACxC,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAkB;IACxC,OAAO,CAAC,QAAQ,CAAC,SAAS,CAA6B;IACvD,OAAO,CAAC,QAAQ,CAAC,MAAM,CAA4B;IACnD,OAAO,CAAC,YAAY,CAAK;IACzB,OAAO,CAAC,WAAW,CAAS;gBAG1B,gBAAgB,EAAE,iBAAiB,EACnC,WAAW,EAAE,YAAY,EACzB,MAAM,CAAC,EAAE,OAAO,CAAC,yBAAyB,CAAC;IAiB7C;;;;;;;;;;;;;;OAcG;IACG,UAAU,CACd,OAAO,EAAE,sBAAsB,EAC/B,mBAAmB,CAAC,EAAE,kBAAkB,EAAE,GACzC,OAAO,CAAC,IAAI,CAAC;IAmBhB;;;;;;;;;OASG;IACG,QAAQ,CACZ,WAAW,EAAE,MAAM,EACnB,OAAO,CAAC,EAAE,qBAAqB,GAC9B,OAAO,CAAC,yBAAyB,CAAC;IA6DrC;;OAEG;IACH,mBAAmB,CAAC,EAAE,EAAE,MAAM,GAAG,oBAAoB,GAAG,SAAS;IAQjE;;;OAGG;IACG,YAAY,CAAC,OAAO,CAAC,EAAE,OAAO,CAAC,sBAAsB,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC;IA8B5E;;;;;;;;;;;;;;;;OAgBG;IACG,kBAAkB,CAAC,KAAK,EAAE,YAAY,EAAE,GAAG,OAAO,CAAC,MAAM,CAAC;IAwChE;;;;;OAKG;IACG,mBAAmB,CAAC,KAAK,EAAE,YAAY,EAAE,GAAG,OAAO,CAAC,MAAM,CAAC;IAwBjE,aAAa,IAAI,OAAO;IAIxB;;;;;;;;;;;;;;;;;OAiBG;IACH,iBAAiB,IAAI,MAAM;IAO3B;;;;;;;OAOG;IACH,uBAAuB,CACrB,qBAAqB,CAAC,EAAE,MAAM,EAAE,GAC/B;QAAE,MAAM,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAC;QAAC,UAAU,EAAE,MAAM,CAAA;KAAE;IAuBxD,iBAAiB,IAAI,MAAM,EAAE;IAI7B;;OAEG;IACH,SAAS,IAAI,QAAQ,CAAC,yBAAyB,CAAC;IAIhD;;OAEG;IACH,QAAQ,IAAI;QACV,eAAe,EAAE,MAAM,CAAC;QACxB,UAAU,EAAE,MAAM,CAAC;QACnB,UAAU,EAAE,MAAM,CAAC;QACnB,YAAY,EAAE,MAAM,CAAC;KACtB;IASD;;OAEG;IACH,eAAe,CAAC,MAAM,EAAE,yBAAyB,GAAG,MAAM;IAQ1D;;;;;;;;;;;;;;;;OAgBG;IACG,4BAA4B,IAAI,OAAO,CAAC,MAAM,CAAC;IAoErD,OAAO,CAAC,WAAW;CAoBpB"}
|