Skip to content

LumenThe AI-Native Programming Language

Build deterministic agent workflows with static types, first-class AI primitives, and markdown-native source files.

Lumen

Quick Start

bash
# Install (One-liner)
curl -fsSL https://raw.githubusercontent.com/alliecatowo/lumen/main/scripts/install.sh | sh

# Or via Cargo
cargo install lumen-lang

Set up your editor with the VS Code extension.

bash
# Create your first program
cat > hello.lm.md << 'EOF'
cell main() -> String
  return "Hello, World!"
end
EOF

# Run it
lumen run hello.lm.md

Why Lumen?

Building AI systems today means juggling Python notebooks, API clients, prompt templates, and orchestration frameworks. Lumen unifies this into one language:

  • Tools are typed interfaces with policy constraints
  • Grants enforce safety limits (tokens, timeouts, domains)
  • Agents encapsulate behavior with scoped capabilities
  • Processes provide structured workflows (pipelines, state machines, memory)
  • Effects make side effects explicit and auditable
  • Pipes chain transformations with |> for readable data flow

Language Highlights

lumen
# Optional types with T? sugar
cell find_user(id: Int) -> User?
  # ...
end

# Labeled loops with filters
for @outer item in items if item.active
  for sub in item.children
    if sub.done
      break @outer
    end
  end
end

# Floor division, shifts, and bitwise ops
let page = offset // page_size
let flags = 1 << 3 | 1 << 5

# Destructuring let
let (x, y) = get_coordinates()

# Defer for cleanup
defer
  close(handle)
end

# Type tests and casts
if value is String
  let s = value as String
end

Try It Now

Head to the Playground to run Lumen code directly in your browser -- no installation required.

Example: AI Chat Agent

lumen
use tool llm.chat as Chat

grant Chat
  model "gpt-4o"
  max_tokens 1024
  temperature 0.7

bind effect llm to Chat

agent Assistant
  cell respond(message: String) -> String / {llm}
    role system: You are a helpful assistant.
    role user: {message}
    return Chat(prompt: message)
  end
end

cell main() -> String / {llm}
  let bot = Assistant()
  return bot.respond("What is pattern matching?")
end

Community

Docs StatusOpen VSXCrates.io

MIT Licensed