Build enterprise agents that ship to production.
Kortex is a composable runtime for AI agents. Memory, tools, guardrails, multi-agent coordination — all in one loop.
The Core Loop
One loop. Everything is a tool.
Each iteration drains events, compacts context, calls the LLM, checks guardrails, executes tools, and loops back. Three exit paths.
re-inject identity
Architecture
13 modules. Zero coupling.
Swap providers, add tools, or replace memory without touching the core.
Memory & Context
Remember everything. Forget nothing useful.
3-layer memory persistence meets 3-layer context compaction. The agent learns across sessions.
Memory Hierarchy
project.md. Updated by agent via update_memory.Context Compaction
[Previous: name -> preview]. Preserve recent N. Selective read_file retention.compact Context Ledger
Every artifact loaded into a run is tracked: skills, MCP prompts, bootstrap files, memory. Records source, type, byte size, timestamp.
context_provenance chart
---
SOUL.md 2.1k |#### |
RULES.md 0.8k |## |
skill:review 1.4k |### |
memory 0.6k |# | Agent Definition
Agent as Code.
Portable agent.yaml defines identity, permissions, knowledge, and evolution strategy. Versioned in Git. Reviewed in PRs.
name: code-reviewer extends: base-agent model: claude-sonnet-4-6 permissions: tools: allow: [read_file, grep_search, glob_search] deny: [write_file, exec] exec: read-only network: deny knowledge_config: always: [RULES.md] on_demand: [review/SKILL.md] deny: [deploy/SKILL.md]
Agents inherit from base definitions. Deep merge for config, tools, permissions. Override what you need.
Multi-source resolution: project ./agents/ > user ~/.kortex/agents/ > builtin. First match wins.
Run any agent: kortex --agent code-reviewer "review this". Permissions enforced as guardrail rules.
Self-Evolution
Every run makes the next one better.
Trajectory recording, post-run evaluation, adaptive effort tuning, and cross-session pattern learning. Fully automatic.
Built-in Evaluators
Recent 10 evaluations: avg score: 0.62 iter pass: 0.45 trend: -0.03/run Adjustments: maxIterations: 16 -> 24 (low pass rate) temperature: 0 -> 0.1 (negative trend) Injecting 3 learned patterns...
Evolution CLI
Inspect scores, replay trajectories, diff runs, rollback bad patterns. Full observability.
$ kortex evolution status
$ kortex evolution history
$ kortex evolution rollback pat_03
$ kortex --replay traj_xxx.json Multi-Agent
Agents that work as a team.
JSONL message bus, idle-poll-claim autonomy, git worktree isolation. Each agent runs in its own lane.
Append-only JSONL inbox per agent. Drained before each LLM call.
Idle agents scan unclaimed tasks and auto-claim work. Autonomous loop.
Each teammate gets its own git worktree. Parallel, conflict-free execution.
Correlated request_id FSM with TTL expiry. Structured cross-agent calls.
spawn_teammate role=reviewer task="Review auth module" -> worktree created: .worktrees/reviewer-a1b2 -> agent loop started (background) spawn_teammate role=worker task="Fix login validation" -> worktree created: .worktrees/worker-c3d4 -> agent loop started (background) read_inbox [reviewer] 2 issues found in auth/login.ts [worker] Fix applied. Tests passing. list_team reviewer completed 2 iterations worker completed 4 iterations
Tool System
The agent's only interface.
Schema + validation + workspace guard.
Skills
Teach, don't hardcode.
Skills evolve from simple instructions to validated workflows.
Instructions
A SKILL.md with rules and guidance.
- Check for bugs
- Verify tests
+ Examples
Few-shot input/output pairs.
Review login.ts
### Output
2 issues found
+ Validator
Executable quality checks.
# exit 0 = pass
Declarative Routing
Skills declare triggers. The router auto-suggests based on the user's prompt.
triggers: review, check, audit
exclusions: implement, build
priority: 10 Safety
Ternary permissions.
Every tool call passes through a guardrail engine with 9 rules.
Allow
Read-only. git status, file reads.
Ask
Writes, execution, network access.
Block
sudo, rm -rf, force push.
Quick Start
Three commands.
From zero to running agent in under a minute.
Install
$ npm install -g @kortex-ai/runtime Configure
$ kortex onboard # sets up provider, model, API key
Run
$ kortex -- "Fix the login bug" ✓ Done in 3 iterations (4.2s, $0.02)
Start building.
One command to install. No vendor lock-in.
Get notified about releases