任せて、覚えて、最後までやり遂げるエージェント。
Astreus は自律型 AI エージェントのためのオープンソース TypeScript フレームワークです。サブエージェント、グラフワークフロー、永続メモリ、MCP ツールを、型付きの単一 API で扱えます。
npm install @astreus-ai/astreus午前3時にあなたが見るダッシュボードを、代わりに読みます。
1つのエージェントがアラートとGrafanaのスクリーンショットを受け取り、何が壊れたかをインシデントチャンネルに伝えます。
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)});エージェントのドキュメントそして、あなたが確認するものを確認します。
直近のデプロイはGitHub、エラーはSentry、負荷はPostgres。どれもモデルが自分で呼び出すMCPサーバーです。
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?');MCP のドキュメント3つの調査を同時に。
トリアージエージェントがログ、デプロイ、データベースを3人の専門エージェントに渡し、結果をまとめます。
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'});サブエージェントのドキュメントインシデント全体を、1つのグラフに。
ステータスページを更新しながら診断し、診断の後にだけロールバックし、検証してからポストモーテムを書きます。
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();グラフのドキュメントこのインシデントは、前にも見ています。
ランブックがナレッジ、過去のインシデントがメモリ。4時間のスレッドも溢れずに圧縮されます。
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 });メモリのドキュメント仕事ごとに、最適なモデルを。
ローカルモデルがログを匿名化するので何もネットワークの外に出ません。大きなモデルが診断し、別のモデルが報告書を書きます。
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'});プロバイダーのドキュメント顧客データは施錠されたまま。
設定1つで、データベース内のすべての記録、プロンプト、ランブックの断片を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?');セキュリティのドキュメントインストールの前に。
Node.js 22 以降、データベース、そしてモデルです。Astreus はエージェントとメモリを SQLite または PostgreSQL に保存し、OpenAI、Claude、Gemini、またはローカルの Ollama モデルと連携します。インストールは npm install @astreus-ai/astreus で行います。
はい。エージェントに llama3.3 などの Ollama モデルを指定すれば、手元のマシンで動作します。エージェントのコードは変わりません。
はい。サブエージェントは通常のエージェントです。それぞれのモデル、プロンプト、能力で作成し、subAgents としてコーディネーターに渡します。委任は自動、手動、順次から選べます。
ノードは、依存するすべてのノードが完了した時点で開始されます。グラフに maxConcurrency を設定すると、独立したノードを同時に実行できます。既定では 1 つずつ実行されます。
コマンドと引数で起動できるサーバー、または URL で到達できるサーバーであれば接続できます。addMCPServers でエージェントに追加すると、そのツールをモデルが利用できるようになります。
はい。Astreus は MIT ライセンスなので、商用プロジェクトで利用、改変、配布できます。
© 2026 pzzaworks