Skip to content

How it works

Tapplack is deliberately small. A handful of concepts explain almost all of its behavior.

your input
│
▼
intent gate ──► chat / meta / vague ──► local answer, no model call
│
▼
orchestrator ──► agent(s) ──► provider + tools ──► artifacts in runs/
  1. Intent gate. A local, dependency-free heuristic classifies input as chat, meta, question, vague, or task. Cheap requests are answered without spending tokens.
  2. Orchestrator. For a task, it creates a run directory, invokes the configured agent(s), and writes stage artifacts and a final report.
  3. Agent. An agent has a title, division, provider, fallback chain, model, temperature, token budget, and a list of tools. It loops: ask the provider, run any requested tools, feed results back, repeat until it produces a final answer or hits a limit.
  4. Provider. The agent’s primary provider is tried first; on rate limits, server errors, or timeouts the request is retried with backoff, then the next provider in the fallback chain is tried.
  5. Artifacts. Everything lands in runs/<run-id>/, plus a session transcript for interactive use.

mode is the top-level switch.

  • single (default) runs one agent — singleAgent, which defaults to assistant. The assistant has the full tool set and is the fastest, cheapest way to get work done.
  • multi runs workflowOrder sequentially, then optionally a finalAgent. The default pipeline is ceo → cto → senior_engineer → qa_reviewer, with ceo as the final synthesis agent.

Multi-agent mode is opt-in. A multi-agent run passes a brief from each stage to the next, and the final agent synthesizes the result. See Workflows.

An agent is a named entry under agents in the config. Built-in ids are assistant, ceo, researcher, cto, senior_engineer, and qa_reviewer, but you can add any id that matches ^[a-z][a-z0-9_-]*$.

Each agent controls:

Field Purpose
provider Primary provider id.
fallback Ordered providers to try when the primary fails.
model Model override; otherwise the provider’s configured model is used.
temperature, maxTokens Sampling and budget.
tools Which tools this agent may call.
reportsTo Used in prompts to describe the org chart.
skills, skillMode Which skills are loaded and how.
autoApply Whether side-effecting tools run without a human gate.

See Agents.

Agents can call a fixed set of tools:

Tool Side effect Purpose
read_file No Read a file in the workspace.
write_file Yes Create or overwrite a file.
delete_file Yes Delete a file.
rename_file Yes Move or rename a file.
list_dir No List a directory.
run_command Yes Run a whitelisted binary inside the workspace.
web_search Network Search the web.
web_fetch Network Fetch a URL.

write_file and run_command are the actions gated by human approval when autoApply is off. delete_file and rename_file are always workspace-confined and are not separately gated.

The agent can only touch files under workspaceDir (default ./workspace), resolved from where you launched the CLI. Path escapes — .., absolute paths outside the root — are rejected by the tool layer, not just discouraged in the prompt.

Run output goes to runsDir (default ./runs). Each run is self-contained, so you can archive or delete it without touching configuration.

See Safety and permissions and Runs and artifacts.

Each provider has an id, an API key (except Ollama), a default model, and a base URL. The active agent’s chain is its provider followed by fallback.

On a failure the provider factory retries the same provider with exponential backoff (retryAttempts, retryBaseDelayMs, retryMaxDelayMs), then moves down the chain. The agent records which provider actually answered, so reports are honest about failover.

See Providers and models.

Skills are Markdown instruction packs. They can be inline, file-backed, or discovered from .tapplack/skills/<id>/SKILL.md.

Agents use one of three modes:

  • off — no skills.
  • manual — pinned skills are preloaded up front. Predictable and cheap. Setting manual also turns autoApply off.
  • auto — the model sees a catalogue and calls a use_skill tool on demand. Convenient, but each load is an extra round and may cost more. Setting auto turns autoApply on.

See Skills.

If an agent has autoApply: false, a write_file or run_command call is intercepted. The exact action is held pending; the run stops and the agent explains what it wants to do. You can inspect the preview and either apply that exact action or keep it pending for /apply.

Applying does not re-run the agent — it executes the reviewed action only. This is what makes the gate trustworthy. See Human approval.

For every setting the resolution order is:

  1. Process environment, when explicitly set.
  2. ~/.tapplack/config.json (or the file named by TAPPLACK_CONFIG).
  3. Built-in defaults.

The JSON file is created on first use and is never silently replaced if it is invalid. .env files are not loaded automatically — use real environment variables or the JSON file.

See Configuration and Config file.