Openkoi
Executive Function as a Service. AI agent that thinks before it acts.
Install / Use
/learn @openkoi-ai/OpenkoiREADME
OpenKoi
Executive Function as a Service. Stop babysitting your AI. OpenKoi thinks before it acts, deliberates internally, and iterates until the code is right.
AI coding tools generate a first draft and leave you to fix it. You review, correct, re-prompt — and become the AI's QA department. OpenKoi is different. It follows a Plan-Execute-Evaluate-Refine loop, iterating on its own output until results meet your quality standards. The agent is its own reviewer.
Ships as a single static binary. Zero runtime dependencies. Works with any model.

Three Steps
# 1. Install
brew tap openkoi-ai/openkoi
brew install openkoi
# or
cargo install openkoi
# or
curl -fsSL https://openkoi.ai/install.sh | sh
# 2. Think — OpenKoi deliberates before it acts
openkoi think "Refactor the auth module to use JWT tokens"
# 3. Ship — it iterates until the code passes its own review
# [SOVEREIGN] "Direct, test-driven, security-conscious"
# [PARLIAMENT] Guardian=APPROVE Economist=APPROVE Scholar=APPROVE+
# [EXEC] Rewriting token.rs, middleware.rs, handlers.rs
# [EVAL] correctness=9.2 safety=9.5 style=8.8
# [REFN] Style below 9.0 — tightening error types
# [EVAL] correctness=9.4 safety=9.5 style=9.3
# [LEARNED] "JWT refresh tokens need constant-time comparison"
# ✓ Done. 3 iterations. 4 files changed.
No config file needed. No setup wizard. OpenKoi detects your API keys from environment variables, existing CLI tools, and local model servers — and picks the best available model.
What Changes
| Before OpenKoi | With OpenKoi |
|----------------|--------------|
| agent run "do X" → output | openkoi think "do X" → deliberation → parliament → output |
| You see the result | You see how it decided, not just what it decided |
| You manually review every AI output | The agent evaluates its own work against rubrics |
| You re-prompt corrections 3-5 times | Automatic iteration, stops when quality threshold is met |
| Learnings vanish between sessions | Sessions persist with transcripts; resume any chat; patterns and skills improve over time |
| Memory is hidden | World model is inspectable: openkoi world, openkoi mind |
| Locked to one provider | Switch providers with a flag; different models per role |
| Data on someone else's cloud | Everything stays on your machine |
| 500ms startup, 100MB memory | <10ms startup, ~5MB idle, ~20MB binary |
Features
- Self-iteration — Plan, execute, evaluate, refine. The agent is its own reviewer.
- 8+ providers — Anthropic, OpenAI, Google, Ollama, AWS Bedrock, Groq, DeepSeek, Moonshot/Kimi, MiniMax, and any OpenAI-compatible endpoint.
- Dynamic model discovery — Probes provider APIs for available models, caches results locally. Fuzzy validation with "did you mean?" suggestions for typos.
- Role-based models — Assign different models to executor, evaluator, planner, and embedder roles. Auto-resolves a small/fast model for cost-sensitive internal tasks.
- Automatic retry — Rate limits, server errors, and timeouts are retried with exponential backoff and jitter. Context overflow is detected and handled separately.
- Real-time progress — Structured progress output on stderr showing plan, iterations, scores, tool calls, and costs. Suppress with
--quiet. - Live task monitoring —
openkoi status --livepolls the running task every second with a progress bar, score, cost, and recent history. - Session lifecycle — Every task and chat creates a tracked session with status (active/paused/ended), transcript, and per-task output files. Browse with
openkoi session list, resume chats withopenkoi chat --resume <id>. - Task output persistence — Task outputs are saved to
~/.local/share/openkoi/sessions/<session-id>/<task-id>.md. Replay any past output withopenkoi task replay <id>. - Task state persistence — Current task state written to
~/.openkoi/state/last-task.json; completed tasks appended totask-history.jsonlwith auto-rotation. - HTTP API — Localhost REST API (port 9742) for submitting tasks, querying status, and reading cost data. Optional Bearer token auth.
- Webhooks — Fire HTTP callbacks on
task.complete,task.failed, andbudget.warningevents. - Smart truncation — Tool outputs exceeding 2000 lines or 50KB are truncated with the full output saved to
~/.openkoi/tool-output/. - Context overflow handling — Detects overflow errors from all major providers and prunes context instead of failing.
- Persistent memory — SQLite + vector search. Learnings persist across sessions.
- Pattern mining — Observes your usage, proposes new skills to automate recurring workflows.
- Skill system — OpenClaw-compatible
.SKILL.mdformat. Write once, use with any provider. - Rich messaging — Slack, Discord, and Telegram integrations send structured task results with fields, colors, and thread support.
- 3-tier plugins — MCP (external tools), WASM (sandboxed), Rhai (scripting).
- 10 integrations — Slack, Discord, MS Teams, GitHub, Jira, Linear, Notion, Google Docs, Telegram, Email.
- TUI dashboard — Real-time view of tasks, costs, learnings, plugins, and config.
- Soul system — Optional personality that evolves with your interaction patterns.
- Cognitive CLI —
thinkreplacesrun: deliberation before execution. Inspect the Parliament, World Map, Trust levels, and Reflection loops from the terminal. - Society of Mind — Five agencies (Guardian, Economist, Empath, Scholar, Strategist) deliberate on every task. View verdicts with
openkoi mind. - World model — Tool Atlas tracks reliability and failure modes. Domain Atlas captures learned expertise. Human Atlas models your preferences.
- Trust & delegation — Grant autonomous action per domain, revoke anytime, audit every decision the agent made on its own.
- Reflection loops — Daily, weekly, and deep self-assessment. Epistemic honesty audit shows where the agent was wrong and what it learned.
- Sensitive information redaction — Enterprise-ready preprocessor that scans and redacts secrets (API keys, passwords, PII, private keys, connection strings) before content reaches AI providers, then restores them in responses. Opt-in via
--redactflag or config.
CLI
Core
openkoi "task" # Run a task (default 3 iterations)
openkoi think "task" # EFaaS pipeline: Sovereign → Parliament → Execute → Learn
openkoi think "task" --simulate # Simulate futures without executing
openkoi think "task" --verbose # Show full parliamentary deliberation
openkoi chat # Interactive REPL
openkoi chat --resume abc1 # Resume a previous chat session
openkoi learn # Review proposed skills (interactive picker)
openkoi status # Show costs, memory, active models
openkoi status --live # Watch the running task in real-time
openkoi setup # First-time setup, diagnostics, provider connections
openkoi dashboard # TUI dashboard for tasks, costs, learnings, plugins
openkoi disconnect # Interactive picker: choose from connected providers
openkoi update # Self-update
Sessions & Tasks
openkoi session list # List recent sessions with status, cost, task count
openkoi session show abc1 # Show session details and tasks (prefix match)
openkoi session resume abc1 # Resume an ended chat session
openkoi session delete abc1 # Delete a session and its data
openkoi task list # List recent tasks across all sessions
openkoi task list --session abc1 # Filter tasks by session
openkoi task show abc1 # Show task details and output preview
openkoi task replay abc1 # Replay full task output to stdout (pipeable)
Cognitive Commands
Introspect the agent's mind. Every command works with no arguments (shows overview) or with a subcommand for detail.
# Soul — Sovereign identity
openkoi soul show # Display current SOUL.md + Value Model + Trajectory
openkoi soul evolve # Trigger soul evolution check from accumulated learnings
openkoi soul diff # Show proposed changes with evidence
openkoi soul history # Show evolution timeline
# Mind — Society of Mind introspection
openkoi mind parliament # Show last parliamentary deliberation
openkoi mind agencies # List active agencies + recent verdicts
openkoi mind dissent # Show cases where agencies disagreed
openkoi mind calibrate # Review agency prediction accuracy vs. outcomes
# World — World model inspection
openkoi world tools # Tool Atlas: reliability, failure modes, call history
openkoi world tools <name> # Drill into a specific tool
openkoi world domains # Domain Atlas: learned domain knowledge
openkoi world human # Human Atlas: what the agent knows about you
openkoi world map # Full World Map overview
# Reflect — Feedback loops & self-assessment
openkoi reflect today # Tight loop: today's tasks, decisions, outcomes
openkoi reflect week # Medium loop: weekly patterns and behavioral trends
openkoi reflect growth # Deep loop: maturity stage and unlock progress
openkoi reflect honest # Epistemic audit: wher
