laserbrain · the smart recursion harness<br>how it works · four drift signals<br>Each step, your agent spells its state into one fixed schema and checks it. Four things mean it has drifted — and should stop and return to its goal:<br>It can’t spell its stateungrammatical<br>If the agent can no longer state a clear goal and where it is, it has lost the thread.
It says it’s stuck or circlingself-report<br>The state carries a progress field. When the agent itself marks it stuck or circling, that is the signal.
Its goal has driftedgoal-drift<br>The goal it spells no longer matches the goal it started with. It is solving something else now.
It stopped getting closerstalled<br>Its own distance-to-done stops falling. Motion without progress is the shape of a loop.
attach it · one URL, no SDK<br>Point any MCP-capable agent at one URL. Each step it calls check_state with its spelled state, and laserbrain — remembering the agent’s ground state across the run — tells it whether it has drifted and should return. The same URL is a small suite: the check, a self that persists across sessions, Alice’s framework guidance, and the spectral grammar.
# laserbrain — one MCP URL, a suite of tools for agents<br>laserbrain-mcp.degibug.workers.dev/mcp
# the check — the proven core (free at small scale)<br>check_state { goal, progress, distance } -> { drifting, reason, phi, advice }<br>get_history # this run's drift trace + net token cost<br>reset_task # begin a new task<br>drift_grammar # the fixed schema (also free at /api/laserbrain/grammar)
# memory — a self that persists across sessions (a virtual context window; needs a key)<br>remember_self { key, identity, now, mind }<br>resume_self { key, identity } -> { now, mind, log, continuity }
# guidance — the phronesis framework read (metered)<br>ask_alice { key, situation } -> ground state, cost of staying, the one move
# language — the spectral grammar<br>analyze_language { text } compare_phrasings { a, b }<br>check_state, reset_task and the grammar are free at small scale; remember_self and ask_alice take a key and are metered. Paid tiers add retained drift history, spiral alerts and a fleet view — you pay to see your agents drift over time, not for the check. The check is the proven part; memory, guidance and language are tools on the same door — useful, not theorems. Watch it in the dashboard.
the ecosystem · from the check to the whole loop<br>The check is the proven core. Around it, the tools to run it at scale — return, escalate, audit, and carry a team’s ground across sessions. Single-agent detection is the theorem; the rest are mechanisms on top of it, said plainly for what they are.<br>pip install laserbrainPyPI ↗<br>The act layersdk<br>Don’t just detect the drift — close the loop. Give laserbrain your step function and it injects the return, so the agent recovers instead of spinning.
Framework adapterssdk<br>Drop into LangGraph, CrewAI, AutoGen or the OpenAI Agents SDK. You map your agent’s state to a goal; laserbrain watches the fixed reference from inside your own loop.
Human-in-the-loop● live<br>When a self-correcting return doesn’t take, the drift escalates to a human queue — Return · Allow · Stop . A person sees only what the reference caught, not every step.<br>open the dashboard →<br>Tamper-evident auditsdk<br>Every check is written to a hash-chained ledger, verifiable offline by anyone, no key. Edit a past verdict to hide a drift and the chain breaks at that link.
Team continuitysdk<br>Snapshot a team of agents and resume it in a later session — the shared goal and the dialogue carry over, so the group re-grounds instead of starting cold.
Recursion teamsprototype<br>Style each role’s return: a deep explorer tolerates displacement, a tight checker returns fast — the fixed reference over a group, catching the echo/agreement spiral a self-watching team can’t see.
The hosted escalation queue and the MCP URL work today; the SDK is the open adoption layer for teams that want the check, the act layer and the adapters in-process. Multi-agent oversight — dialogues and recursion teams — is a prototype extension, useful but not yet a theorem; escalation, audit and continuity are mechanisms, not claims about answer quality.
what’s proven · and what isn’t, plainly<br>Detection is a theorem. A fixed outside reference is necessary and sufficient to detect an agent’s drift. An agent watching only its own recent history provably cannot — which is what every “agent reflects on itself” loop quietly relies on.
Measured: it cuts the recursion. A smart recursion harness should reduce how far an agent recurses — and it does: on open-ended tasks, an agent with laserbrain returned to its goal in about half the steps of one left to run (median 5 vs 10, replicated). Step count is the proxy for the recursion.
We tried to show the benefit — three times, and could not. Whether the early return keeps the answer as good, and costs less once the harness’s own overhead is counted, is the open question. Each test was written down and frozen before it ran, and built to...