What is CLARK?
Continuously Learning Agentic Realtime Knowledgebase OS ClarkOS agents are generative, not reactive. Instead of waiting for user input, they run on continuous tick cycles—thinking, learning, and producing output independently.Reactive vs Generative
| Aspect | Reactive (ElizaOS) | Generative (ClarkOS) |
|---|---|---|
| Execution | Waits for input | Continuous tick cycle |
| Output | Response to prompt | Artifacts from internal state |
| Memory | Conversation history | 5-type cognitive model |
| Presence | When invoked | Persistent |
Agent Lifecycle
Each tick follows this sequence:- Load State — Retrieve mood, health, routine from backend
- Gather Context — Pull relevant memories and knowledge
- Process — Send context to LLM
- Update State — Apply changes atomically
- Generate Artifacts — Produce text, images, journals
- Store Memories — Create memories with embeddings
- Execute Plugins — Run plugin
onTickhooks
src/core/tick.ts contains executeTick() which orchestrates this flow.
Agent State
Every agent maintains internal state that persists across ticks:| Field | Type | Description |
|---|---|---|
mood | string | Emotional state (neutral, expressive, curious, excited, reflective, concerned) |
health | number | Operational capacity 0-100, drifts based on routine |
routine | string | Time awareness (morning, day, evening, overnight) |
volatility | number | Behavioral variance 0-1 |
cryo | boolean | Hibernation mode when health critically low |
src/core/types.ts
Health Drift
Health naturally drifts toward 75 (equilibrium) with routine-based modifiers:- Morning: +0.5 recovery
- Day: -0.2 light drain
- Evening: -0.3 more drain
- Overnight: +1.0 rest recovery
calculateHealthDrift() in src/core/tick.ts
Routine Awareness
Agents know what time it is and adjust behavior accordingly:| Routine | Hours | Behavior |
|---|---|---|
| morning | 6-12 | Recovery, planning |
| day | 12-18 | Peak activity |
| evening | 18-24 | Wind down, reflection |
| overnight | 0-6 | Minimal activity |
calculateRoutine() in src/core/tick.ts
Creating an Agent
TheAgent class wraps the tick system, plugins, and backend:
src/core/agent.ts for the Agent class implementation.
Configuration
Configuration is Zod-validated with sensible defaults:| Option | Default | Description |
|---|---|---|
tick.interval | 60000 | Milliseconds between ticks |
tick.auto | false | Start ticking automatically |
memory.maxShortTerm | 50 | Short-term memory limit |
verbose | false | Enable debug logging |
src/core/config.ts contains schema and createConfig().