@josharsh/demon
v0.1.1
Published
The portable demon engine — a persistent reasoning process with purpose. Runs in Node, the browser, and at the edge.
Maintainers
Readme
@josharsh/demon
The portable engine behind demon — a persistent reasoning process that watches a domain and acts on its own judgment, instead of waiting to be called.
This package is the platform-neutral core: the judgment loop, three-layer memory (event log + bi-temporal facts + compressed narrative), reasoning, and a fetch-based LLM layer. No native dependencies — it runs in Node, the browser, and at the edge. Host packages supply the Clock / Logger / Storage implementations via the platform seam.
If you just want to run demons, install the CLI instead:
npm install -g @josharsh/demon-cliEmbed the engine
npm install @josharsh/demonimport { runLoop, createLLMProvider, createMemoryKV } from '@josharsh/demon'
await runLoop({
manifest, // name, purpose, watch, interval, actions, model, action_mode
watchers, // your Watcher[] — observe a domain
llm: createLLMProvider('claude-sonnet-4-6', { ANTHROPIC_API_KEY: key }),
actions, // Map<string, ActionProvider>
credentials: new Map(),
logger, clock, // inject your platform's Logger + Clock
storage: createMemoryKV(), // or a durable KVStore (fs / IndexedDB)
})You bring the watchers, actions, storage, and clock; the engine runs the observe → judge → act loop and keeps the memory.
MIT licensed. See the main repo for docs, the CLI, and the concept (agents vs demons).
