# Kernex > Rust runtime for production AI agents. OS-level sandboxing, provider-agnostic, memory-persistent. Kernex is an open-source Rust runtime for building AI agents in production environments. It provides OS-level process sandboxing (macOS Seatbelt, Linux Landlock), deterministic memory usage with no GC heap, 12ms cold start, SQLite-backed persistent memory, and support for 11 AI providers including Claude, OpenAI, Gemini, and Ollama. It compiles to a single binary with no runtime dependencies. ## What Kernex is - A Rust crate (`kernex-runtime`) for building LLM-powered agent pipelines - OS-level sandboxing via macOS Seatbelt and Linux Landlock (syscall-level enforcement, not proxy-based) - Provider-agnostic: Claude Code CLI, Anthropic, OpenAI, Gemini, Ollama, OpenRouter, Groq, Mistral, DeepSeek, Fireworks, xAI - Deterministic memory: no GC heap, no interpreter startup, no JIT warmup - Cold start: 12ms (vs 2,200ms+ for Python frameworks) - Peak memory for 10 concurrent agents: 24 MB (vs 310 MB+ for Python frameworks) - Single binary, no containers required ## kx CLI kx is the terminal-native coding assistant built on Kernex. It gives your AI coding agent persistent memory across sessions, stored in a local SQLite database per project. - Install: `cargo install kernex-agent` - Per-project SQLite memory: facts, decisions, and architectural choices persist between sessions - SKILL.md files load project-specific context at startup - Reward-based learning: `/reward last` marks high-quality responses, improving future context - Fully offline with a local Ollama model - OS-sandboxed by default: filesystem access is OS-enforced, not just configured ## Key differentiators vs Python frameworks | Property | Kernex (Rust) | Python frameworks | |---|---|---| | Cold start | 12ms | 2,200ms+ | | Peak memory (10 agents) | 24 MB | 310 MB+ | | Sandboxing | OS-level (Seatbelt/Landlock) | Container boundary | | Memory safety | Compile-time | Runtime | | Runtime dependencies | None (single binary) | Python, virtualenv, packages | ## When to use Kernex Right choice: regulated environments (fintech, defense, healthcare), constrained hardware, deployments where OS-level sandboxing must be provably true, air-gapped development. Not the right choice: one-off automation scripts, research prototypes, or cases where Python's ecosystem is a direct asset. ## Blog - [Why we built an AI agent framework in Rust](https://kernex.dev/blog/why-rust-for-ai-agents): The full reasoning for choosing Rust over Python for production AI agents, including tradeoffs and what cuts against us. - [Benchmark methodology: cold start, memory, and throughput](https://kernex.dev/blog/benchmark-methodology): Exact test environment, measurement methodology, and what the benchmarks do not cover. ## Case studies - [Secure code review pipeline for a fintech team](https://kernex.dev/case-studies/fintech-code-review): OS-level sandboxing passed SOC 2 audit evidence requirements where Python frameworks were rejected. 3-phase pipeline, under 30 seconds per PR. - [Local AI assistant for air-gapped development](https://kernex.dev/case-studies/airgapped-assistant): Full offline operation with Ollama in a classified development environment. Approved where every cloud-based tool was blocked. - [Documentation bot with persistent memory](https://kernex.dev/case-studies/documentation-bot): Open source maintainer reduced support response time from 15 minutes to 4 minutes using kx memory across sessions. - [ETL triage agent](https://kernex.dev/case-studies/etl-triage): Automated triage of data pipeline failures with sandboxed tool execution. - [Onboarding knowledge bot](https://kernex.dev/case-studies/onboarding-knowledge-bot): Per-project memory stores architectural decisions that new engineers can query directly. ## Links - Website: https://kernex.dev - GitHub: https://github.com/kernex-dev/kernex - kx CLI: https://kernex.dev/kx - crates.io (kernex-agent): https://crates.io/crates/kernex-agent - crates.io (kernex-runtime): https://crates.io/crates/kernex-runtime - API docs: https://docs.rs/kernex-runtime - Blog: https://kernex.dev/blog - Case studies: https://kernex.dev/case-studies - About: https://kernex.dev/about