# Abacus

> A high-performance terminal coding agent built in Rust that runs on any OpenAI-compatible model endpoint, featuring recursive self-improvement, approval-gated mutations, and persistent session memory.

Abacus is a terminal coding agent built in native Rust by Empero, an independent AI research lab based in Germany. It runs as a single binary on macOS, Linux, and Windows, and connects to any OpenAI-compatible endpoint — whether a frontier API or a locally hosted model like Qwythos via Ollama. The project is open-source under a modified MIT license with an attribution requirement, and is actively developed alongside Empero's own open-weight language models.

## What It Is

Abacus is a TUI (terminal user interface) coding agent designed for the "mission-critical lane." Unlike agents tied to a single vendor's model, Abacus treats the model as a configurable knob and supports OpenAI chat-completions, the Responses API, and the Anthropic Messages API natively. Its defining design bet is that a coding agent should compound knowledge across sessions — getting better at a specific repository the longer it works there — rather than starting fresh each time.

## The Recursive Self-Improvement Loop

The core differentiator is a five-mechanism loop that persists everything learned locally under `~/.abacus/`:

- **Papercuts** record failure lessons with tripwires — distinctive strings from error output that re-inject the fix the moment the same snag reappears, with frequency-adaptive recall and a two-week decay half-life.
- **Memories** store durable architectural facts, decisions, and conventions, injected at the start of every turn.
- **Rethink** runs a bounded reflection pass after heavy turns or before rolling-summary compaction, recording only what a future session would genuinely need.
- **Tethering** snapshots session intent and runs a drift check every ~35 model steps, injecting course corrections when recent activity diverges from the stated goal.
- **The Hive** tracks delegation confidence from actual swarm outcomes, deriving a maturity tier (Probing → Swarm → Hive) that governs how the model parallelizes work across up to eight isolated git worktree subagents.

Nothing leaves the machine unless explicitly sent.

## Workflow and Safety Model

Abacus starts in AUTO mode, where the model must explicitly declare read-only PLAN or mutating BUILD intent before acting. Every file mutation is shown as a semantic per-file diff with colored additions/deletions before requiring approval. The PLAN/BUILD boundary is enforced mechanically: destructive shell commands (`rm`, `mv`, `git push`, package installs, file-writing redirects) are blocked immediately without a model call, while ambiguous commands are classified by a configurable auxiliary model.

Web access is SSRF-guarded — `read_page` refuses non-HTTP schemes and private/loopback hosts. File tools reject absolute paths, parent traversal, symlink escapes, and secret `.env` files. Writes are atomic (temp file + rename). Subagents run in detached, throwaway git worktrees so a misbehaving worker cannot corrupt the parent checkout.

## Model Compatibility and Configuration

Abacus ships client-side parsers for open-weight tool-call formats including Hermes, Qwen/Qwen3, Llama 3, Mistral, GLM (4.5/4.7), Kimi K2, DeepSeek, and a generic-JSON mode, lifting text-emitted tool calls into the same dispatch path as native calls. Setup presets cover OpenAI, xAI, OpenRouter, Groq, DeepSeek, Mistral, Together, Fireworks, Cerebras, Ollama, and local llama.cpp/vLLM servers. Scripted endpoints (YAML files in `~/.abacus/endpoints/`) handle bespoke auth flows — OAuth bearer refresh, required extra headers, forced body fields — turning any HTTP target into a normal profile.

An auxiliary model setting routes secondary calls (rethink, tether checks, command classification) to a cheaper model on the same endpoint, keeping frontier model usage focused on the main task.

## Extensibility: Skills, Plugins, and MCP

Abacus discovers Agent Skills from project-local and user-level roots, loading only name and description into initial context and fetching full instructions lazily. Skills are also slash-invokable. Plugins are declarative TOML directories that contribute skills, slash-command prompts, lifecycle/tool hooks, and MCP servers. MCP protocol `2025-11-25` is supported over stdio and Streamable HTTP, with namespaced tools and approval gating unless `auto_approve = true` is explicitly set.

## Update: v0.6.1

The latest release is v0.6.1, published on August 14, 2026, with the repository last pushed on August 22, 2026. The project was created in June 2026 and has accumulated 63 stars and 9 forks on GitHub. Empero publishes Abacus as the production environment for its own Qwythos open-weight model family, describing it as "proof that small, owned models handle real codebases." Two next-generation in-house Empero models are currently in pretraining, with Abacus serving as the primary agent harness for their evaluation.

## Features
- Recursive self-improvement loop across sessions
- Papercuts: failure lessons with frequency-adaptive tripwire recall
- Persistent memories injected at session start
- Rethink reflection pass before context compaction
- Tethering: intent snapshot and drift detection every ~35 steps
- Hive: earned delegation maturity tiers (Probing/Swarm/Hive)
- PLAN/BUILD/AUTO workflow modes with mechanical enforcement
- Approval-gated semantic per-file diffs before any mutation
- Parallel subagents in isolated git worktrees (up to 8)
- Native Rust binary for macOS, Linux, and Windows
- OpenAI chat-completions, Responses API, and Anthropic Messages API support
- Client-side tool-call parsers for Hermes, Qwen3, Llama 3, Mistral, GLM, Kimi K2, DeepSeek
- Agent Skills discovery and lazy loading
- Declarative plugin system with lifecycle hooks
- MCP protocol 2025-11-25 over stdio and Streamable HTTP
- Scripted endpoints for bespoke auth flows (YAML)
- Auxiliary model routing for secondary calls
- Scheduled cron jobs with daemon mode
- Training traces captured as JSONL for fine-tuning
- Web search (SearXNG, Brave, Bing) with SSRF protection
- Context compaction: microcompaction + rolling summary
- Ralph loop for iterative prompt execution until completion promise
- Headless and CI mode with --always-approve flag
- Atomic file writes (temp + rename)
- Session persistence, resume, fork, and repair
- Terminal-native Markdown rendering with LaTeX Unicode math
- Vim keybindings and configurable TUI theme

## Integrations
OpenAI, xAI (Grok), OpenRouter, Groq, DeepSeek, Mistral, Together AI, Fireworks, Cerebras, Ollama, llama.cpp, vLLM, Anthropic Claude, Kimi K2, SearXNG, Brave Search, Bing, MCP servers (stdio and HTTP), Agent Skills (agentskills.io), Git / git worktrees, launchd / systemd / Windows Task Scheduler

## Platforms
WINDOWS, MACOS, LINUX, WEB, API, CLI

## Pricing
Open Source

## Version
v0.6.1

## Links
- Website: https://empero.org
- Documentation: https://github.com/empero-org/abacus
- Repository: https://github.com/empero-org/abacus
- EveryDev.ai: https://www.everydev.ai/tools/abacus-agent
