v0.1.0 — Published on npm

The language built
for AI agents

Kode uses 48% fewer tokens than Python. Full-stack. Built-in agents, memory, and state machines.

-- A complete web API in 6 lines
lt db = db.open("sqlite:app.db")

web.route("GET", "/api", |req| ->
  web.json(db.query("select * from users"))
)
web.serve(3000)

48% fewer tokens than Python

Less tokens means lower API costs, more logic per context window, and faster agent execution.

TaskPythonJavaScriptKodeSavings
Web search agent340285185-46%
Multi-agent collab420310195-54%
Web API + database380320215-43%
Error handling310250155-50%
Data pipeline290245155-47%
Total17401410905-48%

7 features nobody else has

Purpose-built for AI agents. Every feature solves a real problem.

@recover

Self-Healing Code

Auto-captures context and retries on failure. No more silent crashes.

budget

Cost Awareness

Track token spend, estimate costs before execution, enforce budgets per agent.

allow/deny

Agent Sandboxing

Fine-grained allow/deny permissions per agent. Prevent unauthorized access.

ensure

Intent-Based

Declare what you want, not how. The runtime figures out the steps.

pre/post

Built-in Contracts

Pre/post conditions validate every function call. Catch 60-80% of bugs.

mem.w/s/e/p

4-Type Memory

Working, semantic, episodic, procedural memory built into the language.

web + db

Full-Stack

Web server, SQLite database, HTML, JSON API — all built into one language.

Clean, minimal syntax

2-char keywords. Zero boilerplate. Every character earns its place.

-- Variables and functions
lt name = "Kode"
vr count = 0

fn add(a, b) { rt a + b }
fn double(x) -> x * 2

-- Lambdas
lt sq = |x| -> x * x

-- Control flow
if x > 0 { io.out("positive") }
ef x == 0 { io.out("zero") }
el { io.out("negative") }

Multi-agent by default

Spawn agents, pass messages, build pipelines. No frameworks needed.

3-agent pipeline
ag Researcher {
  on "search" (p) {
    em "Writer" @{type|"write"
      data|"Found: " + p.query}
  }
}

ag Writer {
  on "write" (p) {
    em "Reviewer" @{type|"review"
      article|"Article: " + p.data}
  }
}

ag Reviewer {
  on "review" (p) {
    io.out("APPROVED: " + p.article)
  }
}

lt r = sp Researcher
lt w = sp Writer
lt v = sp Reviewer
em r @{type|"search" query|"AI agents"}
ag

Define Agents

Agents have their own state, event handlers, and memory.

sp

Spawn Instances

Create agent instances that run independently.

em

Pass Messages

Agents communicate via typed messages with TOON payloads.

st

State Machines

Built-in state machines for workflow tracking.

Build complete apps

Web server, database, HTML, API — all in one language. No Python. No JavaScript. Just Kode.

complete todo app — ~20 lines
lt store = db.open("sqlite:todos.db")
store.exec("create table if not exists todos
  (id integer primary key autoincrement,
   title text, done integer default 0)")

web.route("GET", "/api/todos", |req| ->
  web.json(store.query("select * from todos"))
)

web.route("POST", "/api/todos", |req| {
  store.exec("insert into todos (title) values (?)",
    @[req.body.title])
  rt web.json(@{ok|tr}, 201)
})

web.route("POST", "/toggle/:id", |req| {
  store.exec("update todos set done =
    case when done=0 then 1 else 0 end
    where id = ?", @[req.params.id])
  rt web.json(@{ok|tr})
})

web.serve(3000)
Web Server
SQLite DB
HTML Pages
JSON API

35+ modules built in

No npm install. No pip install. Everything you need, out of the box.

io
I/O
math
Math
str
Strings
lst
Lists
mp
Maps
json
JSON
csv
CSV
yaml
YAML
web
HTTP Server
db
SQLite
fs
Files
env
Env Vars
proc
Shell Exec
net
HTTP Client
crypto
Hashing
enc
Encoding
uuid
UUID
re
Regex
url
URL Parse
log
Logging
time
Time
set
Sets
stream
Streams
ai
LLM Gateway
mem.w
Working Mem
mem.s
Semantic Mem
mem.e
Episodic Mem
mem.p
Procedural Mem
kode
Self-Modify
179
Tests Passing
35+
Stdlib Modules
48%
Fewer Tokens
2.3
Avg Keyword Length
30
Wiki-Style Docs
5
MCP Tools

Start writing Kode

One command. Zero config. Ready in seconds.

$ npm install -g kode-langClick to copy
$ kode hello.kd
Hello from Kode!
fib(10) = 55