Files
krang/docs/DESIGN.md
T
lotherk fb6f97ba8e krang: autonomous agent daemon on libsplinter
One fixed session, born once, kept and compacted forever. The daemon wakes on
its own impulse, works on a persistent goal, detects repeated failures,
reflects, changes approach, and records everything. It starts as root, builds
a debootstrap chroot, then drops to an unprivileged uid and applies Landlock
and seccomp. Dashboard, HTTP API and MCP expose the same snapshot; the event
log is root-owned and append-only. Offline suites cover the engine, the daemon,
both sandbox layers and the dashboard/MCP sockets; a root-only script covers
debootstrap, chroot, uid drop and plugin loading.
2026-11-21 17:00:12 +00:00

3.7 KiB

Design notes

krang is an experiment in self-generated continuation. The question is not whether a model can answer, but what it does when nobody supplies the next turn. The implementation borrows four published patterns and leaves out the parts that need infrastructure this experiment does not have.

Prior art checked

Titles and identifiers were read from the arXiv abstract pages on 2026-11-21:

work id what krang takes
Generative Agents: Interactive Simulacra of Human Behavior 2304.03442 a memory stream, retrieval, and periodic reflection
Reflexion: Language Agents with Verbal Reinforcement Learning 2303.11366 verbal self-reflection after failure, kept in the same context
Voyager: An Open-Ended Embodied Agent with Large Language Models 2305.16291 a growing library of reusable procedures (skills)
ReAct: Synergizing Reasoning and Acting in Language Models 2210.03629 reason/act/observe as one loop, driven by tool results

How it maps

Memory stream. The one session log is the stream: every impulse, tool observation and external message is appended. The working conversation is the retrieved set; journal_search is the explicit way back into what compaction dropped. The goal is the importance signal: it is re-injected every impulse, so the remembered past is read against the current intention.

What is missing: embedding-based relevance and an importance score. The conversation plus THREADS.md plus journal_search is deliberately simpler and auditable.

Reflection. The daemon, not the model, notices repeated calls, repeated errors, no observable change and a goal that does not advance. It then runs a self-check turn with the failed observations and the last error, and changes the prompt from "find your mistake" to "change the approach" as attempts accumulate. This is Reflexion reduced to a bounded ladder with a visible state on the dashboard.

Skill library. The model can write files under workspace/skills/; the splinter skill_search/skill_load tools read them. The prompt tells it to put reusable procedures there rather than relearn them. A self-authored prompt extension lives at workspace/self/SYSTEM.md and is read before the next impulse. The sandbox makes this safe to allow: the skill library is inside the chroot and cannot change the launcher or the policy.

ReAct. The engine already runs the reason/act/observe loop: a reply with a tool call, the observation, the next request. krang does not reimplement it; it adds the impulse and the goal around it.

Observability. None of the four papers is an experiment platform. krang's dashboard, HTTP API and MCP server read one append-only event log and one state snapshot, so the run can be inspected from outside without trusting the model's self-report. The event log is root-owned and written through an inherited descriptor; the session log is the model's memory.

The difference

The published agents are driven by a task, a game, or a conversation. krang is driven by a clock: the impulse is the independent variable. It is born once, keeps one session forever, and is expected to act when nothing arrives. That is the part being tested; the four patterns are how it stays coherent while it does.

Deliberate simplifications

  • One agent, not a society of agents.
  • No vector database; a log search and a working-notes file.
  • No reinforcement learning; reflection is text in the same session.
  • No benchmark game; the sandbox is the environment.
  • No hidden second context for external chat; every channel is the same session.