MCPcopy Index your code
hub / github.com/OrlojHQ/orloj

github.com/OrlojHQ/orloj @v0.17.0

Chat with this repo
repository ↗ · DeepWiki ↗ · release v0.17.0 ↗ · + Follow
4,868 symbols 20,820 edges 468 files 737 documented · 15%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

Orloj

Agents are infrastructure.

Orloj is the full stack for agentic systems.

Build, run, govern, and observe multi-agent systems from one declarative stack: agents, tools, models, memory, schedules, webhooks, approvals, policies, workers, traces, metrics, and deployment primitives.

Quickstart | Docs | Stack | How It Works | Screenshots

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

Orloj task lifecycle animation

What Is Orloj?

Orloj is the open-source full stack for developing and operating agentic systems.

An agent system is no longer just a prompt and a loop. It has model routing, tool permissions, credentials, memory, retries, human approvals, schedules, webhooks, workers, traces, logs, metrics, and deployment topology. Orloj treats those pieces the way infrastructure platforms treat services: as versioned resources with desired state, status, controllers, leases, workers, runtime policy, and operational visibility.

If agents are services Orloj gives them manifests, runtime bounds, credentials, routing, observability, and lifecycle management.
If agent teams are distributed systems Orloj gives them durable handoffs, fan-out, fan-in, retries, idempotency, dead-letter states, and worker ownership.
If tools are production access Orloj gives them isolation, authorization, approval gates, retry policy, secrets, and audit-friendly traces.

The Orloj Agent Stack

Orloj is not a single runtime component. It spans the layers teams need to develop, run, govern, and observe agentic systems.

The Orloj Agent Stack

Stack Layer What Orloj Provides
Interfaces YAML manifests, orlojctl, REST API, SDKs, Kubernetes CRDs, and web console.
Agent Definitions Agent, AgentSystem, prompts, graph topology, roles, execution contracts, and runtime bounds.
Execution Runtime Sequential and message-driven execution, workers, leases, heartbeats, retries, idempotency keys, and dead-letter states.
Model & Context Layer ModelEndpoint, ContextAdapter, provider routing, fallback models, secrets, token budgets, and Memory.
Tool & Integration Layer HTTP, gRPC, external services, webhook callbacks, McpServer discovery, CLI, WASM, A2A interop, auth, isolation, timeouts, and retries.
Governance & Human Review AgentPolicy, AgentRole, ToolPermission, ToolApproval, and TaskApproval.
Observability & Operations Traces, logs, messages, task history, watch streams, events, Prometheus metrics, OpenTelemetry spans, and UI views.
State & Deployment Substrate In-memory and Postgres state, NATS JetStream messaging, Docker Compose, VPS deployments, Kubernetes paths, and CRD GitOps.

How The Stack Operates

Declare: Write YAML resources for agents, systems, tools, model endpoints, memory, tasks, secrets, evaluations, and policy. Reconcile: Controllers validate resources, update status, discover MCP tools, manage schedules, and drive state forward. Schedule: Tasks target an AgentSystem and are assigned to workers based on capacity and requirements.
Claim: Workers claim tasks with leases, renew heartbeats, and allow takeover when ownership expires. Execute: Bounded agent loops route model calls, invoke tools, use memory, and pass messages through the graph. Govern: Policies, roles, tool permissions, ToolApprovals, and TaskApprovals fail closed during runtime.
Observe: Every run records trace events, task history, messages, logs, metrics, and optional OpenTelemetry spans. Scale: Start local with an embedded worker, then move to Postgres, NATS JetStream, and distributed workers. Operate: Use the CLI, REST API, watch streams, web console, Prometheus metrics, and standard deployment targets.

Orloj Is Right For You If

You are moving from agent demos to systems that need owners, policies, retries, credentials, and traces.
You want agents, tools, models, and workflows in version-controlled manifests instead of scattered scripts.
You need multiple agents to hand off work through pipelines, hierarchies, fan-out, fan-in, loops, or delegated review.
You need tool calls to be authorized, isolated, approved, retried, and observable.
You want to develop locally in one process and keep the same resource model when you scale to workers and durable messaging.

Problems Orloj Solves

Without Orloj With Orloj
Agent scripts, prompts, tool configs, and credentials drift across repos and machines. Agents, tools, models, memory, triggers, workers, and policy are declared as resources and applied through one API.
Multi-agent handoffs are hidden in custom code and hard to inspect after the run. AgentSystem graphs define the routing, while Task status records messages, branches, joins, delegation, trace, and history.
A failed process can leave work half-owned, duplicated, or silently lost. Workers claim tasks with leases and heartbeats. Retries, idempotency keys, and dead-letter phases make failure visible.
Tool access is whatever the prompt or script happens to allow. Tool execution passes through policies, roles, permissions, operation rules, isolation modes, timeouts, retries, and approvals.
Switching model providers means editing every agent or duplicating config. Agents reference ModelEndpoint resources, with provider-specific config, secrets, and fallback routing centralized.
Recurring and event-driven agent work needs separate cron jobs, webhook glue, and dedupe logic. TaskSchedule and TaskWebhook resources create Tasks from templates with concurrency, signature verification, and idempotency.
Debugging requires reading scattered logs and guessing what each agent did. Task traces capture model calls, tool calls, errors, token usage, latency, approvals, retries, messages, and output.

What Is In The Stack

Layer Resources and Runtime Behavior
Agents Agent resources define prompts, model refs, fallback models, tools, roles, memory access, execution contracts, and bounds.
Systems AgentSystem resources compose agents into graphs with edges, conditional routing, fan-out, fan-in, delegation, and human review checkpoints.
Tasks Task resources execute an AgentSystem and track phase, output, attempts, leases, messages, joins, delegation, trace, history, and blockers.
Models ModelEndpoint resources route calls to OpenAI, Anthropic, AWS Bedrock, Azure OpenAI, Ollama, mock, and OpenAI-compatible providers.
Context ContextAdapter resources sanitize or transform raw task input before an AgentSystem starts.
Tools Tool resources support HTTP, external services, gRPC, webhook callbacks, MCP, CLI, WASM, and A2A with runtime policy and auth.
Integrations McpServer resources connect external MCP servers and materialize discovered tools.
Memory Memory resources back task-scoped and persistent memory through in-memory, pgvector, or HTTP providers.
Secrets Secret resources hold runtime credentials, while SealedSecret resources support git-safe encrypted secret manifests.
Triggers TaskSchedule and TaskWebhook resources create Tasks from cron schedules and signed HTTP events.
Governance AgentPolicy, AgentRole, ToolPermission, ToolApproval, and TaskApproval enforce model, tool, and review controls at runtime.
Evaluation EvalDataset and EvalRun resources test agent systems against golden data and compare runs.
Workers Worker resources declare capacity, region, supported models, GPU support, heartbeat, and current task load.

Example: An Agent System As Code

Define an agent:

apiVersion: orloj.dev/v1
kind: Agent
metadata:
  name: research-agent
spec:
  model_ref: openai-default
  prompt: |
    You are the research stage.
    Produce concise, verifiable findings for the writer.
  tools:
    - web_search
  allowed_tools:
    - web_search
  limits:
    max_steps: 6
    timeout: 30s

Bind it to a model endpoint:

apiVersion: orloj.dev/v1
kind: ModelEndpoint
metadata:
  name: openai-default
spec:
  provider: openai
  base_url: https://api.openai.com/v1
  default_model: gpt-4o
  auth:
    secretRef: openai-api-key

Wire agents into a graph:

apiVersion: orloj.dev/v1
kind: AgentSystem
metadata:
  name: report-system
spec:
  agents:
    - planner-agent
    - research-agent
    - writer-agent
  graph:
    planner-agent:
      edges:
        - to: research-agent
    research-agent:
      edges:
        - to: writer-agent

Run it as a task:

apiVersion: orloj.dev/v1
kind: Task
metadata:
  name: weekly-report
spec:
  system: report-system
  input:
    topic: enterprise AI copilots
  retry:
    max_attempts: 2
    backoff: 2s
  message_retry:
    max_attempts: 2
    backoff: 250ms
    max_backoff: 2s
    jitter: full

Governance Built Into The Runtime

Governance in Orloj is not a documentation convention. It is evaluated while work is being executed.

AgentPolicy Constrains allowed models, blocked tools, token budget, child depth, and child task creation.
AgentRole Grants named permissions to agents.
ToolPermission Defines what permissions or operation rules are required for a tool invocation.
ToolApproval Pauses risky tool calls until a reviewer approves or denies them.
TaskApproval Pauses graph nodes or final output for human review, denial, or request-changes loops.

Unauthorized actions fail closed and appear in the task trace.

How It Works

Component Responsibility
orlojd

Extension points exported contracts — how you extend this code

Core symbols most depended-on inside this repo

Shape

Function 2,805
Method 1,196
Struct 648
Interface 206
FuncType 6
TypeAlias 5
Class 2

Languages

Go90%
TypeScript9%
Python1%

Modules by API surface

store/resource_stores.go152 symbols
resources/resource_types.go121 symbols
runtime/agent_message_consumer.go117 symbols
frontend/src/api/types.ts106 symbols
controllers/task_controller.go96 symbols
api/server.go69 symbols
frontend/src/api/hooks.ts63 symbols
cli/orlojctl.go62 symbols
api/a2a_test.go57 symbols
resources/graph_test.go55 symbols
store/sql_backend.go53 symbols
crds/deepcopy.go51 symbols

Datastores touched

orlojDatabase · 1 repos
memoriesDatabase · 1 repos
dbDatabase · 1 repos

For agents

$ claude mcp add orloj \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact

Ask about this repo answers extend the page