Juglans LogoJuglans
v0.2.4 — Open Source

Write Graphs
as Code

The first AI orchestration language where graph topology is a first-class programming primitive. Nodes are functions, edges are control flow, and the architecture diagram IS the program.

workflow.jgflow
$curl -fsSL https://lang.juglans.ai/install.sh | shClick to copy

Why Juglans?

Others write code to draw graphs. We write graphs as code.

Graph Topology as Code

A node is simultaneously a graph vertex and a callable function. Branching, convergence, cycles — the topology of your code IS the architecture diagram. No separate drawing needed.

Topology-Preserving Composition

flows: imports merge sub-workflow graphs with namespace isolation. Sub-graphs remain fully visible and optimizable — an embedding, not a projection.

Declarative Control Flow

Conditional branching, switch routing, foreach/while loops, and error handling — all declarative. Workflows execute as validated DAGs with topological sort.

Rich Tool Ecosystem

Built-in devtools (bash, read_file, grep...) + MCP protocol support + custom tool definitions. 4-level resolution: Builtin → Python → MCP → Client Bridge.

Python Integration

Call pandas, sklearn, and any Python library directly. Objects stay in Python memory with reference IDs — zero serialization overhead.

HTTP Backend

serve() + response() turn any workflow into an HTTP API. Routing topology and computation topology are the same graph.

See It in Action

Three file types work together to build complex AI pipelines. Click the tabs to explore each one.

pipeline.jgflow
1flows: { auth: "./auth.jgflow" }
2agents: [0]
3
4[deploy(env, version)]: {
5 bash(command="docker build -t app:" + $version)
6 bash(command="kubectl apply --ns=" + $env)
7}
8
9[classify]: chat(agent="router", message=$input.query)
10[classify] -> switch $output.intent {
11 "question": [answer]
12 "task": [execute]
13 default: [fallback]
14}
15
16[answer]: chat(agent="expert", message=$input.query)
17[execute]: chat(agent="worker", message=$output.task)
18
19[answer] -> [review]
20[execute] -> [review]
21[review] if $output.quality < 0.8 -> [refine]
22[refine] -> [review]

Get Started in Seconds

Install Juglans and start building AI workflows immediately.

$curl -fsSL https://lang.juglans.ai/install.sh | shCopy

Then create your first workflow:

$ juglans init my-project
$ cd my-project
$ juglans workflow.jgflow