Noureddine RAMDI / Loong: a modular Rust infrastructure for vertical AI agents with governed kernel architecture

Created Sat, 23 May 2026 20:41:14 +0000 Modified Sat, 23 May 2026 20:41:27 +0000

loongclaw-ai/loongclaw

Loong’s approach to AI agent infrastructure stands out by its architectural rigor and modularity. Instead of the typical monolithic Python frameworks, it uses Rust’s strengths to enforce strict dependency boundaries and a governed kernel that cleanly separates key concerns such as contracts, security, execution, and orchestration. This design supports complex, long-horizon workflows and compound task execution with a transparent runtime structure.

Loong’s architecture and core functionality

At its core, Loong is a Rust-based vertical AI agent infrastructure designed to provide a secure and extensible foundation for building AI agents. The project is organized as a 7-crate workspace, each crate serving a specific purpose within a strictly enforced acyclic dependency graph. This ensures clean separation of concerns and prevents dependency cycles that could complicate maintenance and extendability.

The architecture revolves around a governed kernel that separates contracts (interfaces and specifications), security policies, execution logic, and orchestration mechanisms. This kernel acts as a central coordinator, managing how providers, channels, tools, memory, approvals, policies, and audit logging interact at runtime.

Loong supports over 42 built-in providers and 25 channels, enabling it to connect with a wide range of AI models and communication platforms. It explicitly distinguishes between the assistant logic, the gateway interface, and the channels, providing clear runtime boundaries. The layered execution model ranges from L0 to L9, representing different levels of workflow complexity and task delegation.

Compatibility with configurations from OpenClaw, Claude Code, Codex, and OpenCode showcases its adaptability to various AI agent paradigms and ecosystems.

Technical strengths and design tradeoffs

What sets Loong apart is its disciplined workspace structure with strict acyclic dependencies across seven crates. This enforced modularity improves maintainability and makes the codebase less prone to tangled dependencies and hidden side effects.

The governed kernel architecture is a deliberate design choice to separate contracts (defining interfaces and expectations), security (access control, approvals, policies), execution (running tasks, provider selection), and orchestration (workflow management, audit). This separation means each area can evolve independently and be audited or extended without risking system-wide regressions.

By isolating runtime boundaries between assistant, gateway, and channels, Loong achieves transparency and control over AI agent interactions. This explicit boundary management supports long-running workflows and compound tasks that require coordination across multiple providers and channels.

However, this strict architecture comes with tradeoffs. The complexity of managing explicit boundaries and layered execution means a steeper learning curve for new contributors or users. It also may introduce overhead in orchestrating tasks compared to simpler monolithic implementations.

The choice of Rust as the implementation language brings performance, safety, and concurrency advantages but may limit adoption among teams unfamiliar with Rust. Still, for projects needing robust, secure, and extensible AI agent infrastructure, these tradeoffs are justified.

Quick start

Loong uses loong as the only supported command-line entrypoint.

Linux or macOS:

curl -fsSL https://raw.githubusercontent.com/eastreams/loong/dev/scripts/install.sh | bash -s -- --onboard

Windows PowerShell:

$script = Join-Path $env:TEMP "loong-install.ps1"
Invoke-WebRequest https://raw.githubusercontent.com/eastreams/loong/dev/scripts/install.ps1 -OutFile $script
pwsh $script -Onboard

From source:

Ensure your system has a C linker (required by Rust):

# Or install via Cargo only (without onboard setup)
cargo install --path crates/daemon

First successful flow

loong                        # Open the main TUI; if config is missing, first-run setup stays in that shell

loong ask --message "Summarize this repo in one sentence."  # Single-turn query to verify config
loong onboard                # Reopen the deeper guided setup flow when you want to tune provider or tooling
loong chat                   # Explicit alias for the interactive conversation surface
loong doctor --fix           # Check environment and auto-fix common issues
loong update                 # Replace this install with the latest stable GitHub release

loong update always targets the latest stable release and never installs pre-releases.

verdict

Loong is a technically disciplined AI agent infrastructure suited for Rust-savvy teams looking for a modular, secure, and extensible foundation. Its governed kernel and strict crate dependencies provide a clear architecture that scales to complex workflows and supports multiple providers and channels.

The tradeoff is a steeper learning curve and the need to understand Rust and layered execution models. For projects needing a robust vertical AI agent framework with explicit runtime boundaries and governance, Loong offers a promising foundation. It’s less suited for quick prototyping or teams unfamiliar with Rust.

Overall, this repo is worth exploring if you want to build AI agents that require clear security boundaries, auditability, and extensible orchestration beyond typical monolithic frameworks.


→ GitHub Repo: loongclaw-ai/loongclaw ⭐ 639 · Rust