Introducing demon

demon

AI that watches, and acts on its own judgment, instead of waiting to be called.

$ npm i -g @josharsh/demon-cli copy
A new primitive

Parallel to the agent, not a version of it.

Since LLMs arrived, one shape wrapped them: the agent, a function you invoke. demon is the other shape, a process that runs on its own. Two primitives, for two kinds of work.

established
agent
invoke → run → return
A function. Best when you already know what to ask.
vs
new
demon
watch → judge → act
A process. Best for what you'd never think to ask in time.
Live · running in your browser

This page is a demon.

The same engine the CLI runs, watching you right now, and mostly doing nothing. On purpose.

demon · site-sentinel awake , watching you 0s acted 0

The bars are real: each one is a decision it just made. You can't type here, that's the idea.

The cycle

Observe, judge, act, or wait.

Every cycle, the process does one thing. The LLM is a subroutine it calls only when an observation warrants reasoning, not the orchestrator that drives the run.

Observe
Judge
Act / Wait
The idea

To call an agent, you must already know that you need it. The problems that matter are the ones nobody notices until they've compounded.

The error rate creeping up after a deploy. The customer who went quiet before renewal. The contributor's first pull request, unreviewed for twelve days, about to give up.

An agent could analyze any of these perfectly, if you thought to ask. You didn't, because you didn't know. The value was never in the reasoning, it was in noticing, and noticing needs something always present, allowed to act on its own judgment.

An agent waits to be called. That is the one thing it cannot stop doing.

Agents vs demons

Same LLM underneath. A different shape around it.

Agent

  • you trigger it
  • driven by a task
  • finishes and exits
  • starts fresh each time
  • the LLM runs the show

Demon

  • it triggers itself
  • driven by a purpose
  • runs continuously
  • accumulates memory
  • the process calls the LLM

An agent is a consultant you hire for a project. A demon is a chief of staff embedded in your work for six months. Both are valuable. They are not the same job.

Memory

It remembers what changed, and when.

When a fact stops being true, a demon doesn't erase it, it closes that fact's validity interval and opens a new one. History is preserved; nothing drifts. This is a real bi-temporal record, the approach verified across the research.

Below: a PR's CI state across cycles. passing was closed when the demon observed failing, both are kept.

entity: PR #564 · relation: ci
passing
failing
cycle 1cycle 2now
For the skeptic

"Isn't this just an agent with a while-loop?"

It's the right question. The answer is no, and the difference is structural, not cosmetic.

the demon noticed you came back to this part

You can't get process semantics from function semantics by adding a loop. An agent borrows your call stack and returns. A demon owns its own, a real process with a PID, signal handling, crash recovery, and memory that accumulates across weeks. The LLM stops being the orchestrator and becomes a subroutine the process calls only when something observed warrants reasoning. Inversion of control. That's the whole thing.

A car is a horse-carriage with an engine, too. The components were all there. Building the new thing deliberately is what changes what you can do with it.

What a demon is

Four properties no wrapped agent has together.

  • Always running, never invokedA real OS process, PID, signals, survives the terminal, restarts on crash.
  • Constituted by purpose, not taskNo completion state. It doesn't return. It keeps being true to what it watches.
  • Accumulates identity over timeBi-temporal memory that compounds. A month-old demon is worth more than one started today.
  • Judgment as its primary modeEvery cycle asks one question: does anything warrant acting? Usually the answer is no.
Get started

One process. Watching. With a purpose.

terminal
$ npm install -g @josharsh/demon-cli

$ demon start "watch open PRs on my-org/repo and flag what needs attention"
$ demon ps
$ demon logs my-demon --follow

On first run it asks once which provider powers your demons, Anthropic, OpenAI, OpenRouter, Groq, Gemini, Mistral, or a local model via Ollama. Then it's quiet until something matters.