展示 HN: Orloj – 基础设施即代码(YAML 和 GitOps)
Show HN: Orloj – agent infrastructure as code (YAML and GitOps)

原始链接: https://github.com/OrlojHQ/orloj

## Orloj:多智能体AI编排 Orloj是一个运行时环境,旨在为多智能体AI系统带来生产级别的可靠性和治理,灵感来源于布拉格天文钟Orloj。目前正处于积极开发中,它通过提供结构化、编排的方法来解决管理AI智能体的问题——目前通常由临时脚本处理。 主要特性包括**代码即智能体**(用YAML定义)、用于复杂工作流的**基于DAG的编排**,以及在OpenAI和Ollama等提供商之间灵活的**模型路由**。Orloj还提供强大的**工具隔离**(容器、WASM等)和通过策略和权限实现的内置**治理**。 它提供诸如任务所有权、重试机制和用于监控的Web控制台等生产特性。用户可以通过预构建的蓝图和简单的安装过程(通过`orlojd`服务器和`orlojctl` CLI)快速上手。 可扩展性通过消息驱动模式和分布式工作者以及Postgres持久化来实现。 更多详细信息、文档和示例请访问[docs.orloj.dev](docs.orloj.dev)。

## Orloj:AI 智能体的基础设施即代码 Orloj (https://orloj.dev) 是一款新的开源(Apache 2.0)运行时,旨在为多智能体 AI 系统带来结构和可靠性。针对当前智能体编排的“狂野西部”现状,Orloj 允许用户使用声明式 YAML 清单定义智能体、工具和工作流程——本质上,这是 AI 的基础设施即代码。 主要特性包括强大的**治理**,通过运行时策略(而不仅仅是提示指令)控制智能体行为和工具访问,以及内置的**可靠性**功能,如任务所有权、重试和死信处理。它支持各种模型提供商(OpenAI、Ollama 等),并提供可配置的**工具隔离**——从直接执行到沙盒和容器——基于风险等级。 Orloj 采用服务器/工作者架构,并包含常见智能体模式的入门蓝图。团队正在积极开发操作工作流模板,从事件响应和合规性开始。目前版本为 v0.1.0,他们欢迎来自社区的反馈和贡献。
相关文章

原文

Orloj

Named after the Prague Orloj, an astronomical clock that has coordinated complex mechanisms for over 600 years.

Release CI Docs Go Report Card Go Reference License

An orchestration runtime for multi-agent AI systems.

Declare your agents, tools, and policies as YAML. Orloj schedules, executes, routes, and governs them so you can run multi-agent systems in production with the same operational rigor you expect from infrastructure.

Status: Orloj is under active development. APIs and resource schemas may change between minor versions before 1.0.

Running AI agents in production today looks a lot like running containers before container orchestration: ad-hoc scripts, no governance, no observability, and no standard way to manage an agent fleet. Orloj provides:

  • Agents-as-Code -- declare agents, their models, tools, and constraints in version-controlled YAML manifests.
  • DAG-based orchestration -- pipeline, hierarchical, and swarm-loop topologies with fan-out/fan-in support.
  • Model routing -- bind agents to OpenAI, Anthropic, Azure OpenAI, Ollama, and other endpoints. Switch providers without changing agent definitions.
  • Tool isolation -- execute tools in containers, WASM sandboxes, or process isolation with configurable timeout and retry.
  • Governance built in -- policies, roles, and tool permissions enforced at the execution layer. Unauthorized tool calls fail closed.
  • Production reliability -- lease-based task ownership, idempotent replay, capped exponential retry with jitter, and dead-letter handling.
  • Web console -- built-in UI with topology views, task inspection, and live event streaming.

Download orlojd (server) and orlojctl (CLI) for your platform from GitHub Releases, extract them, and run:

# Start the server with an embedded worker
./orlojd --storage-backend=memory --task-execution-mode=sequential --embedded-worker

Open http://127.0.0.1:8080/ to explore the web console, then apply a starter blueprint. The example manifests live in this repo -- clone it or browse them on GitHub:

# Apply a starter blueprint (pipeline: planner -> research -> writer)
./orlojctl apply -f examples/blueprints/pipeline/

# Check the result
./orlojctl get task bp-pipeline-task

Or build from source (requires Go 1.25+):

go build -o orlojd ./cmd/orlojd
go build -o orlojctl ./cmd/orlojctl

When you are ready to scale, switch to message-driven mode with distributed workers and Postgres persistence. See the Quickstart guide for details.

┌─────────────────────────────────────────────────────┐
│                  Server (orlojd)                     │
│                                                     │
│  ┌──────────────┐   ┌────────────────┐              │
│  │  API Server   │──►│ Resource Store  │             │
│  │   (REST)      │   │ mem / postgres  │             │
│  └──────┬───────┘   └────────────────┘              │
│         │                                           │
│         ▼                                           │
│  ┌──────────────┐   ┌────────────────┐              │
│  │   Services    │──►│ Task Scheduler │              │
│  └──────────────┘   └───────┬────────┘              │
└─────────────────────────────┼───────────────────────┘
                              │
                              ▼
┌─────────────────────────────────────────────────────┐
│                 Workers (orlojworker)                │
│                                                     │
│  ┌──────────────┐   ┌───────────────┐               │
│  │  Task Worker  │──►│ Model Gateway │               │
│  │              │   └───────────────┘               │
│  │              │──►┌───────────────┐               │
│  │              │   │  Tool Runtime  │               │
│  │              │   └───────────────┘               │
│  │       ◄──────┼───┌───────────────┐               │
│  │              │──►│  Message Bus   │               │
│  └──────────────┘   └───────────────┘               │
└─────────────────────────────────────────────────────┘

Server (orlojd) -- API server, resource store (in-memory or Postgres), background services, and task scheduler.

Workers (orlojworker) -- claim tasks, execute agent graphs, route model requests, run tools, and handle inter-agent messaging.

Governance -- AgentPolicy, AgentRole, and ToolPermission resources enforced inline during every tool call and model interaction.

Persistence is backed by Postgres (or in-memory for local dev). Message-driven mode uses NATS JetStream for durable agent-to-agent messaging.

Orloj manages 15 resource types, all defined as declarative YAML with apiVersion, kind, metadata, spec, and status fields:

Core

Resource Purpose
Agent Unit of work backed by a language model
AgentSystem Directed graph composing multiple agents
ModelEndpoint Connection to a model provider
Tool External capability with isolation and retry
Secret Credential storage
Memory Vector-backed retrieval for agents
McpServer MCP server connection that discovers/syncs MCP tools

Governance

Resource Purpose
AgentPolicy Token, model, and tool constraints
AgentRole Named permission set bound to agents
ToolPermission Required permissions for tool invocation
ToolApproval Approval record for gated tool invocations

Scheduling & Triggers

Resource Purpose
Task Request to execute an AgentSystem
TaskSchedule Cron-based task creation
TaskWebhook Event-triggered task creation
Worker Execution unit with capability declaration

Browse docs.orloj.dev.

  • Getting Started -- install, quickstart
  • Concepts -- architecture, agents, tasks, tools, model routing, governance
  • Guides -- deploy a pipeline, configure routing, build tools, set up governance
  • Deploy & Operate -- local, VPS, Kubernetes, remote CLI access
  • Reference -- CLI, API, resource schemas
  • Security -- control plane API tokens, secrets, tool isolation
  • Examples -- per-kind YAML under examples/resources/, starter blueprints/, and use-cases/ (in this repo)

Run the full stack (Postgres + server + 2 workers) with Docker Compose:

docker compose up --build -d
docker compose ps

The Compose images include the server and workers only. To drive the API from your machine, install orlojctl from GitHub Releases (CLI-only tarball) or build from this repo; see Deploy & Operate.

See CONTRIBUTING.md for development setup and guidelines.

Apache License 2.0. See LICENSE and NOTICE.

联系我们 contact @ memedata.com