Full language reference, compiler architecture, and quick start guides.
Skills Compiler — compile agent skills into optimized runtime modules.
Agent benchmark suite — measure and compare autonomous agent performance.
Evolutionary context management — genetic algorithms for optimal context windows.
GitHub organization with all Nexa projects and repositories.
Owen — creator of the Nexa language and Harness Native methodology.
Nexa is the first Harness Native Agent Language — where agent safety is enforced by the compiler, not by runtime frameworks. Write flows, not glue code.
// Nexa — Harness Native Agent Language agent BugFixer(issue: string) { system `Fix: #{issue}` // Harness C: Context policy context_policy { max_tokens: 100000, on_overflow: summarize } // Harness E: Autonomous loop autoloop max_steps: 50 exit_when: "resolved" { // Harness L: AI-native error recovery try_agent { step(); } catch_correction(e: ToolError) { reflect `Error: #{e}. Retry.` } } }
Every other "agent framework" is a library bolted onto a general-purpose language. Nexa is built from the ground up with the Harness Native methodology — agent safety, context management, and autonomous execution as first-class language constructs.
Agents, tools, protocols, and flows are first-class citizens — not library wrappers. The Harness six-tuple (E, T, C, S, L, V) is enforced at the language level.
26 Harness Validator rules check your code at compile time. Missing exit conditions, untyped tools, context overflow risks — caught before a single line runs.
Native fork, merge, pipeline, and conditional branch operators. Compose complex agent workflows as directed acyclic graphs with zero boilerplate.
From forgiving to strict — choose your safety level. Structural types, semantic types, Option/Result types, and compile-time protocol verification.
Battle-tested across 16+7 major features. v1.x: Design by Contract, Error Propagation, Pattern Matching, ADTs, Background Jobs, HTTP Server, Database, Auth. v2.0: Harness Native Runtime with autoloop, @tool, with_context, snapshot, reflect, verify, Actor. v2.1: optional Anthropic SDK adapter, hardened runtime (shell=False, path allowlist, safe_eval), and grammar fixes for semantic_if fast_match colon form.
A Rust-powered Agent Virtual Machine with WASM sandboxing, COW memory, context paging, and work-stealing scheduler — 20× faster than Python transpilation.
In Nexa, the Harness six-tuple (E, T, C, S, L, V) is enforced at the language level. The compiler verifies exit conditions, context policies, and error recovery — before a single line runs.
// Nexa — Harness Native Agent Language @tool("Search codebase with regex") fn grep(pattern: string, path: string = "."): string { return std.shell.exec("grep -rn #{pattern} #{path}"); } agent BugFixer(issue: string) uses grep { system `You are an expert engineer. Fix: #{issue}` // Harness C: compiler verifies eviction strategy exists context_policy { max_tokens: 100000, on_overflow: summarize } // Harness E: compiler verifies exit condition exists autoloop max_steps: 50 exit_when: "issue is resolved" { // Harness L: AI-native error self-correction try_agent { step(); } catch_correction(e: ToolError) { reflect `Error: #{e}. Retry.` } } }
context_policy block is compiler-verified. If you forget to specify max_tokens or an on_overflow strategy, the Harness Validator rejects your code at compile time — before a single token is sent to the LLM. No more silent context window overflows that degrade model performance mid-task.autoloop is a first-class language construct, not a while-loop with manual bookkeeping. The compiler enforces that every loop has an exit_when condition or max_steps limit. Infinite agent loops are caught at build time, not discovered at 3 AM when your cloud bill arrives.try_agent + catch_correction implements AI-native error recovery. When a tool fails, the error is automatically fed back to the LLM via reflect — triggering self-correction instead of crash-and-burn. Traditional try-catch walks away; Harness L teaches the agent to try again, smarter.# Python + LangGraph — manual glue code from langgraph.graph import StateGraph, END from langchain.chat_models import ChatOpenAI from langchain.tools import tool import subprocess, json # Manual tool schema — must match OpenAI format exactly @tool def grep(pattern: str, path: str = ".") -> str: """Search codebase with regex""" r = subprocess.run(["grep","-rn",pattern,path],capture_output=True) return r.stdout.decode() # Manual context management — no auto-eviction def manage_context(messages, max_tokens=100000): total = sum(len(m["content"])//4 for m in messages) if total > max_tokens * 0.8: return messages[:5] + messages[-3:] # crude truncation return messages # Manual ReAct loop — no exit condition verification def bug_fixer(issue: str, max_steps=50): model = ChatOpenAI(model="minimax-m2.5") messages = [{"role":"system","content":f"Fix: {issue}"}] for step in range(max_steps): response = model.invoke(messages, tools=[grep]) messages.append({"role":"assistant","content":response.content}) if response.tool_calls: for tc in response.tool_calls: try: result = tc.execute() messages.append({"role":"tool","content":result}) except Exception as e: messages.append({"role":"tool","content":f"Error: {e}"}) messages = manage_context(messages) if "resolved" in response.content.lower(): break return messages[-1]["content"] # No Harness Validator. No sandbox. No trace. No HITL.
Multi-agent DAG orchestration that takes 40+ lines of Python takes just 8 lines of Nexa — with compiler-verified topology.
// Nexa — declarative DAG orchestration agent Researcher { prompt: "Research the given topic." } agent Analyst { prompt: "Analyze findings quantitatively." } agent Writer { prompt: "Synthesize into a report." } agent Reviewer { prompt: "Review for accuracy." } flow main(topic: string) { // Fork: parallel research + analysis → Merge: review → Pipeline: write result = topic |>> [Researcher, Analyst] &>> Reviewer >> Writer; print(result); }
|>> [A, B]&>> Cconcat (append all), vote (majority selection), consensus (LLM-mediated agreement), or summarize (intelligent compression). The compiler verifies the merge target exists.>> D# Python + LangGraph — manual DAG construction from langgraph.graph import StateGraph, END from langchain.chat_models import ChatOpenAI from typing import TypedDict import concurrent.futures model = ChatOpenAI(model="minimax-m2.5") class State(TypedDict): topic: str; research: str; analysis: str; review: str; report: str def research_node(state: State) -> State: state["research"] = model.invoke(f"Research: {state['topic']}") return state def analysis_node(state: State) -> State: state["analysis"] = model.invoke(f"Analyze: {state['topic']}") return state def review_node(state: State) -> State: combined = state["research"] + "\n" + state["analysis"] state["review"] = model.invoke(f"Review: {combined}") return state def writer_node(state: State) -> State: state["report"] = model.invoke(f"Write report: {state['review']}") return state # Manual graph construction — 15+ lines of wiring graph = StateGraph(State) graph.add_node("research", research_node) graph.add_node("analysis", analysis_node) graph.add_node("review", review_node) graph.add_node("writer", writer_node) graph.add_edge("research", "review") graph.add_edge("analysis", "review") graph.add_edge("review", "writer") graph.set_entry_point("research") graph.add_edge("writer", END) app = graph.compile() result = app.invoke({"topic": "Quantum Computing"}) # No compile-time topology verification
Nexa compiles through a multi-stage pipeline with Harness validation — ensuring safety before a single line runs.
Harness Native DSL
Earley Algorithm
Desugaring + Scoring
Compile-time Safety
Python / AVM / WASM
The Harness six-tuple is not a framework — it's syntax, enforced by the compiler.
autoloop max_steps: 10, exit_when: "resolved" { ... }
Autonomous ReAct loop with compiler-enforced exit conditions. No more infinite agent loops.
@tool("description") fn my_tool(x: string): string { ... }
Zero-cost tool binding. Compiler auto-generates OpenAI function calling schema from type signature.
with_context max_tokens: 50000, strategy: sliding_window { ... }
Importance-weighted context paging. Silent context overflow degraded performance — eliminated at language level.
snap = snapshot(); ... restore(snap);
COW state snapshots with fork/merge for Tree-of-Thoughts exploration. Roll back decisions as a primitive.
before_step { ... }; reflect "What went wrong?";
Compiler-enforced lifecycle hooks + AI-native self-reflection. Agents learn instead of crashing.
verify result satisfies ExpectedOutput;
Compile-time + runtime output verification with multi-model routing. Quality is a language property.
Join us in making agent programming safe, declarative, and beautiful — with the Harness Native methodology.