Agenti che delegano, ricordano e portano a termine il lavoro.

Astreus è un framework TypeScript open source per agenti IA autonomi: sub-agenti, workflow a grafo, memoria persistente e strumenti MCP dietro una sola API tipizzata.

npm install @astreus-ai/astreus

Legge la dashboard che leggeresti tu alle 3 di notte.

Un agente riceve l’allarme e lo screenshot di Grafana e dice al canale degli incidenti cosa si è rotto.

import { Agent, Graph } from '@astreus-ai/astreus';const oncall = await Agent.create({  name: 'OnCall',  model: 'gpt-6-astra',  systemPrompt: 'On-call engineer for the payments API',  vision: true,  memory: true});await oncall.ask('Checkout p95 alert. What broke?', {  attachments: [    { type: 'image', path: './grafana-checkout.png' }  ],  stream: true,  onChunk: (chunk) => process.stdout.write(chunk)});
Documentazione degli agenti

Poi controlla quello che controlleresti tu.

GitHub per l’ultimo deploy, Sentry per gli errori, Postgres per il carico. Ognuno è un server MCP che il modello chiama da solo.

await oncall.addMCPServers([  {    name: 'github',    command: 'npx',    args: ['-y', '@modelcontextprotocol/server-github']  },  {    name: 'postgres',    command: 'npx',    args: [      '-y', '@modelcontextprotocol/server-postgres',      'postgresql://replica.internal/payments'    ]  },  { name: 'sentry', url: process.env.SENTRY_MCP_URL }]);await oncall.ask(  'What shipped in the last hour, and what broke after?');
Documentazione MCP

Tre indagini insieme.

Un agente di triage affida log, deploy e database a tre specialisti e unisce ciò che trovano.

const logs = await Agent.create({  name: 'LogAnalyst', model: 'llama3.3',  systemPrompt: 'Find the first error in the logs.'});const deploys = await Agent.create({  name: 'DeployAuditor', model: 'gpt-6-astra',  systemPrompt: 'Audit what shipped in the last hour.'});const database = await Agent.create({  name: 'DbInspector', model: 'gpt-6-astra',  systemPrompt: 'Find slow queries and lock waits.'});const triage = await Agent.create({  name: 'Triage', model: 'claude-fable-5-1',  systemPrompt: 'Split the work, merge the findings.',  subAgents: [logs, deploys, database]});const cause = await triage.ask('Why is checkout slow?', {  useSubAgents: true,  delegation: 'auto',  coordination: 'parallel'});
Documentazione dei sub-agenti

L’intero incidente, come un grafo.

Diagnostica mentre la pagina di stato viene aggiornata, fa rollback solo dopo la diagnosi, verifica, poi scrive il postmortem.

const incident = new Graph({  name: 'Incident response',  maxConcurrency: 3,  retryAttempts: 2,  subAgentAware: true}, triage);const diagnose = incident.addTaskNode({  prompt: 'Find the root cause', useSubAgents: true});const status = incident.addTaskNode({  prompt: 'Post an update to the status page'});const rollback = incident.addTaskNode({  prompt: 'Roll back the deploy', dependencies: [diagnose]});const verify = incident.addTaskNode({  prompt: 'Confirm p95 < 400 ms', dependencies: [rollback]});incident.addTaskNode({  prompt: 'Write the postmortem',  dependencies: [verify, status]});await incident.run();
Documentazione dei grafi

Ha già visto questo incidente.

I runbook sono la sua conoscenza, gli incidenti passati la sua memoria, e un thread di quattro ore si comprime invece di traboccare.

const oncall = await Agent.create({  name: 'OnCall',  model: 'gpt-6-astra',  systemPrompt: 'On-call engineer for the payments API',  embeddingModel: 'text-embedding-3-small',  memory: true,  knowledge: true,  autoContextCompression: true,  preserveLastN: 5});await oncall.addKnowledgeFromDirectory('./runbooks');await oncall.addMemory(  'Incident 214: checkout latency, pool exhausted.');const seen = await oncall.searchMemoriesBySimilarity(  'checkout latency spike',  { similarityThreshold: 0.7, limit: 3 });
Documentazione della memoria

Il modello giusto per ogni compito.

Un modello locale ripulisce i log così nulla esce dalla tua rete, uno più grande diagnostica, un altro scrive il report.

const rawLogs = await readFile('./checkout.log', 'utf8');// Scrub raw logs locally. Nothing leaves your network.const scrubbed = await oncall.ask(rawLogs, {  model: 'llama3.3'});// A larger model finds the causeconst cause = await oncall.ask(scrubbed, {  model: 'claude-fable-5-1'});// Another one writes it upconst report = await oncall.ask('Write the postmortem', {  model: 'gpt-6-astra'});
Documentazione dei provider

I dati dei clienti restano sotto chiave.

Un’impostazione cifra ogni trascrizione, prompt e frammento di runbook nel tuo database con AES-256-GCM.

// .env// ENCRYPTION_ENABLED=true// ENCRYPTION_MASTER_KEY=<openssl rand -hex 32>// DB_URL=postgresql://...// KNOWLEDGE_DB_URL=postgresql://...const oncall = await Agent.create({  name: 'OnCall',  model: 'gpt-6-astra',  systemPrompt: 'On-call engineer for the payments API',  memory: true,  knowledge: true});// Stored encrypted: the prompt, the incident thread,// every memory and every runbook chunkawait oncall.ask('Which customers were affected?');
Docs sulla sicurezza

Prima di installare.

Node.js 22 o successivo, un database e un modello. Astreus salva agenti e ricordi in SQLite o PostgreSQL e comunica con OpenAI, Claude, Gemini o un modello Ollama locale. Si installa con npm install @astreus-ai/astreus.

Sì. Assegna a un agente un modello Ollama come llama3.3 e girerà sulla tua macchina. Il codice dell'agente resta lo stesso.

Sì. Un sub-agente è un agente normale, creato con il proprio modello, prompt e capacità, poi passato al coordinatore in subAgents. La delega può essere automatica, manuale o sequenziale.

Un nodo parte appena sono terminati tutti i nodi da cui dipende. Imposta maxConcurrency sul grafo per far girare insieme i nodi indipendenti. Per impostazione predefinita vengono eseguiti uno alla volta.

Qualsiasi server che puoi avviare con un comando e degli argomenti, o raggiungere tramite URL. Aggiungili a un agente con addMCPServers e i loro strumenti diventano disponibili per il modello.

Sì. Astreus ha licenza MIT: puoi usarlo, modificarlo e distribuirlo in progetti commerciali.

© 2026 pzzaworks

© 2026 pzzaworks