@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 CHANGED
@@ -25,9 +25,15 @@
25
25
 
26
26
  - [Overview](#overview)
27
27
  - [Quick Start](#quick-start)
28
- - [Multi-Agent Teams with agency()](#multi-agent-teams-with-agency)
29
- - [Single-Agent and Low-Level Helpers](#single-agent-and-low-level-helpers)
30
- - [Advanced: AgentGraph and Full Runtime](#advanced-agentgraph-and-full-runtime)
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, 5-tier guardrails 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.
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 | [![npm](https://img.shields.io/npm/v/@framers/agentos-ext-topicality?style=flat-square&logo=npm&label=)](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) | [![npm](https://img.shields.io/npm/v/@framers/agentos-ext-code-safety?style=flat-square&logo=npm&label=)](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 | [![npm](https://img.shields.io/npm/v/@framers/agentos-ext-grounding-guard?style=flat-square&logo=npm&label=)](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
- **Requirements:** Node.js 18+ and TypeScript 5.0+
163
+ Set any provider's API key and you're ready:
157
164
 
158
- **Start here:**
159
-
160
- - Use [`agency()`](./docs/orchestration/AGENCY_API.md) to coordinate a team of agents with a single call.
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
- ### Multi-Agent Teams with `agency()`
169
+ ### 1. Generate Text (Provider-First)
166
170
 
167
- `agency()` is the recommended starting point for any task that benefits from
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 { agency } from '@framers/agentos';
174
+ import { generateText, streamText } from '@framers/agentos';
173
175
 
174
- const team = agency({
175
- agents: {
176
- researcher: { instructions: 'Find relevant facts.' },
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
- | Strategy | What it does |
191
- |---|---|
192
- | `sequential` | Agents run in order; each receives the previous output as context |
193
- | `parallel` | All agents run concurrently; results are merged by a synthesis step |
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
- Add guardrails, HITL, resource controls, observability, `listen()` for voice
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
- ### Single-Agent and Low-Level Helpers
190
+ ### 2. Agent with Personality & Memory
220
191
 
221
- Use the streamlined helpers when you want AI SDK-style text generation, structured
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 { generateText, streamText, agent } from '@framers/agentos';
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
- // Works with any provider -- just change the name
241
- const result2 = await generateText({
197
+ const tutor = agent({
242
198
  provider: 'anthropic',
243
- prompt: 'Explain TCP handshakes in 3 bullets.',
244
- });
245
-
246
- // Local models via Ollama -- zero API keys
247
- const result3 = await generateText({
248
- provider: 'ollama',
249
- prompt: 'Explain TCP handshakes in 3 bullets.',
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
- #### Default Models Per Provider
257
-
258
- When you use the provider-first pattern, AgentOS resolves the default model
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
- See `src/api/runtime/provider-defaults.ts` for the full registry including image
274
- and embedding defaults.
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
- #### Multi-Provider Showcase
220
+ ### 3. Multimodal RAG
277
221
 
278
- The **same prompt** works across every supported provider -- swap one string:
222
+ Ingest documents, images, and structured data retrieve with HyDE (Hypothetical Document Embedding):
279
223
 
280
224
  ```typescript
281
- import { generateText } from '@framers/agentos';
282
-
283
- // OpenAI
284
- await generateText({ provider: 'openai', prompt: 'What is QUIC?' });
225
+ import { agent } from '@framers/agentos';
285
226
 
286
- // Anthropic
287
- await generateText({ provider: 'anthropic', prompt: 'What is QUIC?' });
288
-
289
- // Google Gemini
290
- await generateText({ provider: 'gemini', prompt: 'What is QUIC?' });
291
-
292
- // Groq (fast inference)
293
- await generateText({ provider: 'groq', prompt: 'What is QUIC?' });
294
-
295
- // Local via Ollama (no API key needed)
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
- // OpenRouter (200+ models, auto-routing)
299
- await generateText({ provider: 'openrouter', prompt: 'What is QUIC?' });
238
+ const session = analyst.session('q4-review');
300
239
 
301
- // Mistral
302
- await generateText({ provider: 'mistral', prompt: 'What is QUIC?' });
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
- // xAI (Grok)
305
- await generateText({ provider: 'xai', prompt: 'What is QUIC?' });
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
- #### Provider + Model Override
248
+ ### 4. Structured Output (Zod Validation)
309
249
 
310
- When you need a specific model instead of the default, pass both:
250
+ Extract typed data from unstructured text:
311
251
 
312
252
  ```typescript
313
- // Cheaper model for high-volume workloads
314
- await generateText({
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
- // Specific Anthropic model
321
- await generateText({
322
- provider: 'anthropic',
323
- model: 'claude-haiku-4-5-20251001',
324
- prompt: 'Summarise this paragraph.',
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
- // Specific Ollama model
328
- await generateText({
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
- #### Global Defaults via Environment Variables
270
+ ### 5. Workflows & Graphs
336
271
 
337
- AgentOS auto-detects your active provider by scanning environment variables in
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 { generateText } from '@framers/agentos';
275
+ import { workflow } from '@framers/agentos';
349
276
 
350
- // No provider or model needed -- auto-detected from env vars
351
- const result = await generateText({ prompt: 'Hello world' });
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
- #### Legacy Format
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
- #### Streaming, Structured Output, Images, and Embeddings
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
- // Streaming with Anthropic
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
- for await (const delta of live.textStream) {
380
- process.stdout.write(delta);
381
- }
291
+ ```typescript
292
+ import { agency } from '@framers/agentos';
382
293
 
383
- // Image generation with OpenAI
384
- const image = await generateImage({
385
- provider: 'openai',
386
- prompt: 'A cinematic neon city skyline reflected in rain at night.',
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
- console.log(image.images[0]?.mimeType);
314
+ const result = await team.generate('Compare TCP vs UDP for game networking.');
315
+ console.log(result.text);
316
+ ```
390
317
 
391
- // Structured output with Gemini -- Zod-validated JSON extraction
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
- console.log(object.name, object.age); // "John" 30
320
+ ### 7. Voice Pipeline
399
321
 
400
- // Streaming structured output with Groq
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
- for await (const partial of structured.partialObjectStream) {
408
- console.log('partial:', partial);
409
- }
410
- console.log('final:', await structured.object);
324
+ ```typescript
325
+ import { agent } from '@framers/agentos';
411
326
 
412
- // Embeddings -- single or batch (OpenAI)
413
- const { embeddings } = await embedText({
327
+ const receptionist = agent({
414
328
  provider: 'openai',
415
- input: ['Hello world', 'Goodbye world'],
416
- dimensions: 256,
417
- });
418
-
419
- console.log(embeddings.length, embeddings[0].length); // 2, 256
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
- const session = assistant.session('tcp-demo');
429
- const reply = await session.send('Now compare TCP and UDP.');
430
- console.log(reply.text);
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
- If you want durable helper-level usage accounting outside the full runtime, enable
435
- the opt-in usage ledger:
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 { generateText, getRecordedAgentOSUsage } from '@framers/agentos';
346
+ import { agent } from '@framers/agentos';
439
347
 
440
- await generateText({
348
+ const secureBot = agent({
441
349
  provider: 'anthropic',
442
- prompt: 'Explain HTTP keep-alive.',
443
- usageLedger: { enabled: true, sessionId: 'readme-demo' },
444
- });
445
-
446
- console.log(await getRecordedAgentOSUsage({ enabled: true, sessionId: 'readme-demo' }));
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
- Runnable examples: [`examples/high-level-api.mjs`](./examples/high-level-api.mjs), [`examples/generate-image.mjs`](./examples/generate-image.mjs)
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
- ```typescript
479
- import { AgentOS, AgentOSResponseChunkType } from '@framers/agentos';
480
- import { createTestAgentOSConfig } from '@framers/agentos/config/AgentOSConfig';
361
+ ### Default Models Per Provider
481
362
 
482
- const agent = new AgentOS();
483
- await agent.initialize(await createTestAgentOSConfig());
484
-
485
- for await (const chunk of agent.processRequest({
486
- userId: 'user-1',
487
- sessionId: 'session-1',
488
- textInput: 'Explain how TCP handshakes work',
489
- })) {
490
- if (chunk.type === AgentOSResponseChunkType.TEXT_DELTA) {
491
- process.stdout.write(chunk.textDelta);
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 **243 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.
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 | 79 | All curated skills from the skills registry |
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;AAEH,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,yCAAyC,CAAC;AACjF,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,sCAAsC,CAAC;AACzE,OAAO,KAAK,EACV,yB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