Cairn is an agentic AI copilot that lives inside your product and actually gets things done for your customer β planning the steps, clicking, filling, navigating, or talking, then checking its own work β while they just describe what they want.
How it works
The agent never guesses at a UI it's never seen β every step below works from a real, verified map of your app.
Reads your real source (or crawls a running app for any other framework), maps what's actually clickable, and wires the widget into your layout automatically.
# run this inside your app npx @cairnvibe/indexer setup β detected Next.js (App Router) β installed @cairnvibe/core, indexer, sdk β wired <CairnCopilot/> into app/layout.tsx β manifest built β 14 pages, 52 elements mapped
Real data shapes, real business rules, real handler functions β not guesses from button labels. A live scan also catches anything rendered dynamically.
/invoices Invoice { status: "Paid" | "Overdue" | "Archived" } archiveInvoice(id) β handled by app/api/invoices/[id]/route.ts pattern: table-crud β matched, playbook attached /board pattern: kanban β matched, playbook attached
One of 16 verbs, re-validated server-side every single time β it can only take an action you registered, and it never invents a click.
you "archive the invoice for Acme Co" β read invoice-table β found INV-2201 β do archiveInvoice(INV-2201) β status: Archived agent "Archived Acme Co's invoice."
Live in your app
The exact widget, the exact conversation shape β a real element gets highlighted before anything happens, and the confirmation names what actually changed.
| Client | Amount | Status |
|---|---|---|
| Acme Co. | $1,200.00 | Overdue |
| Globex Inc. | $450.00 | Paid |
| Initech | $980.00 | Paid |
How the agent works
A goal that needs more than one step runs through a real Planner β Executor β Critic loop β a genuinely separate pass verifies each real result before continuing, replanning, or stopping.
you "find the invoice for Acme Co and archive it" planner 1. find Acme Co's invoice 2. archive it step 1 β read invoice-table β found INV-2201 critic β task 1 complete β advancing step 2 β do archiveInvoice(INV-2201) β status: Archived critic β task 2 complete β done agent "Archived Acme Co's invoice."
Voice mode
A persistent WebSocket, not a buffered clip β streaming starts in ~1β1.5s instead of a 5β10s wait. Talk over it mid-sentence and it stops immediately.
"β¦and can you read me back what's overdue this month?"
What's actually running underneath
React via <Copilot/>, or drop <cairn-widget> into Vue, Angular, Svelte, or a plain static page β same widget, zero dependencies.
Point cairn build at a running URL instead of source and it crawls the rendered page with a headless browser β any framework's output.
Every task that genuinely completes can leave behind a small, verified Skill β a real fact about how your app works, never user data β reused next time.
An explicit remember, a searchable turn history, and long-term facts recalled only when relevant β a real SQLite store, not just what fits in one request.
explain / guide / act caps what the agent is allowed to do, independent of which actions your app has registered β dial it per customer, per plan.
A confirmed-dead API key is excluded for the rest of the process's life; a rate limit retries on a different configured key automatically β real reliability, not a single point of failure.
Install
Works end to end on any framework, live-verified β Next.js gets the deeper, AST-based source analysis, and everything else gets the same real runtime via a headless-browser crawl instead of a source read.
# run this inside your existing app npx @cairnvibe/indexer setup # installs the packages, asks a couple of skippable questions β # which LLM provider and key, whether you want voice β wires the # widget into your real layout file, and builds once. Every future # `npm run build` regenerates the manifest on its own.
Works with
CLI reference
| Command | What it does |
|---|---|
cairn setup [dir] | The one-command path β installs, asks skippable questions, wires the widget into your real layout, builds once, sets up auto-rebuild. |
cairn init <dir> | The manual version of the same scaffolding β no prompts, no installs, no file edits beyond new files. |
cairn scan <dir> | L1 only β deterministic, no LLM call, no API key needed. |
cairn build <dir> | Full pipeline against Next.js source β writes ui-manifest.json. |
cairn build <url> | Crawl mode β points at a running app instead of source, works on any framework. |
cairn diff <a> <b> | What changed between two manifests β useful in CI to catch silent drift. |
cairn docs <dir> | Reads an existing manifest and writes a human-readable CAIRN_DOCS.md. |
cairn webmcp <dir> | Reads a manifest, generates a component that registers your already-traced actions as WebMCP tools for any MCP-compatible agent. |
Vibe using