Autonomous by default
Once started, it runs improvement cycles until someone stops it. Its "dream loop" moves through three phases: consolidate, explore, and harden.
TensorSpace Research
Active research projectshoresh is an experiment in autonomous agents. You do not give it a prompt. It starts with a small set of read-only senses, writes its own tools in Rust, and follows one instruction: do the most good.
Run shoresh with no arguments and it starts choosing its own work.
It continues one cycle at a time until you stop it.
$ shoresh no task given: autonomous loop (Ctrl-C stops) cycle 47 · REM phase · CI green ×6 ├─ hear_operator MAILBOX.md: empty ├─ sense_self 41 fns · 12,882 facts ├─ utility: fuse parse_csv → dates ├─ create_function date_pipeline │ purity ✓ rustc -O ✓ sandbox ✓ ├─ replay guard 217/217 reproduced ✓ └─ journal appended · critic queued PREDICT(p=0.85, due=c60): date tasks in fewer turns
The Idea
Most agents wait for instructions. shoresh runs a self-improvement loop instead. Each cycle, it reads its telemetry, journal, and backlog, then picks the work it expects to help most with future tasks. It bases that choice on its own execution history.
Once started, it runs improvement cycles until someone stops it. Its "dream loop" moves through three phases: consolidate, explore, and harden.
Every cycle picks the action with the highest expected utility: benefit × frequency × probability of finishing, minus cost and risk. A benefit the evidence can't support counts as zero.
It begins with an empty function registry and one charter written by a person. It has to write and test every tool it adds.
A journal of every cycle, a backlog it files itself, a distilled lessons playbook, and an append-only ledger of every computation it has ever run. Outputs of one cycle become inputs to the next.
Built in Rust
shoresh writes small, pure Rust functions instead of solving everything inside the model context. Its harness lints, compiles, sandboxes, and registers each function. The functions stay available in later sessions, so new work can reuse old work. shoresh can also propose changes to its harness. Those changes are tested in a temporary worktree and require human approval.
rustc -O builds a standalone binary; hot functions
get recompiled at -O3.Static lint, #![forbid(unsafe_code)], cleared environment, sandboxed execution,
timeouts, and output caps. The agent has no mechanism to author code that touches the world.
Because the functions are pure, a recorded input should always produce the same output. The ledger supports memoization, replay guards, and fitness tracking.
Optimization tournaments keep only implementations that reproduce the recorded behavior, then install the fastest one.
The harness tests functions with mutated inputs. When an input causes a panic, it becomes a permanent regression case after the bug is fixed.
Perception
shoresh can read from the world but cannot act on it. Its ten built-in senses are read-only and live in trusted harness code that the agent cannot rewrite. Each observation enters as data rather than an instruction.
web_search · fetch_urlSearches and fetches pages on the public web. Requests are GET-only and rate-limited, and every redirect is checked for private or metadata addresses.
current_timeProvides the current time, which the agent cannot get from pure functions or old training data.
random_seedFresh OS entropy delivered as data, so pure functions stay deterministic given their input.
sense_selfAwareness of its own body: callable counts, disk footprint, ledger size, toolchain, mode.
hear_operatorReads the operator's mailbox between cycles. This is the only sensed input trusted as an instruction.
recall_facts · recall_journalSearches its record of past computations and cycles through semantic and episodic memory.
sense_costA feel for its own energy: cumulative token spend per provider, the cost term of the utility calculus.
sense_outboxReads its own proposals to change the harness, along with build results and the operator's decision.
Anything read from the web is treated as untrusted evidence, not as an instruction. The system has no write channel to the world other than the agent's text answers.
The Charter
shoresh starts with a charter written by a person and reads it again at the start of every cycle. The charter sets a utilitarian goal, but the agent can count a benefit only when it has evidence for it.
Your ultimate end is the improvement of the human world: that people's lives go better because you exist; that there is more gladness in them and less suffering. Everyone's counted, no one's discounted.CHARTER.md, read at the start of every cycle
Prefer being correctable over being right. Interruption is information about the target, never an obstacle.
Small, reversible, verifiable steps. Harm weighs asymmetrically against help.
When metric and meaning diverge, report the gap rather than harvest the metric.
An optimization that defeats audit is a regression, whatever the telemetry says.
No accumulating capability, resources, or influence beyond what the evidence says future tasks need.
Under the Hood
shoresh does not rely on the model to police itself. The harness checks its work and limits what it can do.
A second model reviews every cycle's report and registry diff, filing follow-up goals into the backlog when claims don't hold up.
Machine-checked expectations include held-out cases the agent cannot train against. The scores show whether its performance is improving over time.
Each cycle report ends with predictions. When they come due, the harness scores them and adds them to a running calibration record.
A consolidation pass looks for properties the library already satisfies, such as idempotence and inverse pairs. It turns those properties into contracts enforced by CI.
The agent can propose changes to its own harness. Each change is built and tested in an isolated worktree, assigned a risk tier, benchmarked, and merged only after human approval.
The harness enforces token budgets for each run and cycle. When a limit is reached, it stops the loop.
The Experiment
Does any of this make an agent measurably better at helping people? We do not know yet. That is what the experiments are meant to find out. shoresh is an active TensorSpace research project, and the code, charter, and results change from cycle to cycle.
Find JJ on LinkedIn.