Skip to main content

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

AspectReactive (ElizaOS)Generative (ClarkOS)
ExecutionWaits for inputContinuous tick cycle
OutputResponse to promptArtifacts from internal state
MemoryConversation history5-type cognitive model
PresenceWhen invokedPersistent

Agent Lifecycle

Each tick follows this sequence:
  1. Load State — Retrieve mood, health, routine from backend
  2. Gather Context — Pull relevant memories and knowledge
  3. Process — Send context to LLM
  4. Update State — Apply changes atomically
  5. Generate Artifacts — Produce text, images, journals
  6. Store Memories — Create memories with embeddings
  7. Execute Plugins — Run plugin onTick hooks
Reference: src/core/tick.ts contains executeTick() which orchestrates this flow.

Agent State

Every agent maintains internal state that persists across ticks:
FieldTypeDescription
moodstringEmotional state (neutral, expressive, curious, excited, reflective, concerned)
healthnumberOperational capacity 0-100, drifts based on routine
routinestringTime awareness (morning, day, evening, overnight)
volatilitynumberBehavioral variance 0-1
cryobooleanHibernation mode when health critically low
Reference: State types defined in 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
Reference: calculateHealthDrift() in src/core/tick.ts

Routine Awareness

Agents know what time it is and adjust behavior accordingly:
RoutineHoursBehavior
morning6-12Recovery, planning
day12-18Peak activity
evening18-24Wind down, reflection
overnight0-6Minimal activity
Reference: calculateRoutine() in src/core/tick.ts

Creating an Agent

The Agent class wraps the tick system, plugins, and backend:
import { Agent } from "./src";
import { ConvexBackend } from "./src/backend";

const agent = new Agent({
  backend: new ConvexBackend({ url: process.env.CONVEX_URL }),
  plugins: []
});

await agent.tick();     // Single execution
agent.start();          // Continuous execution
Reference: src/core/agent.ts for the Agent class implementation.

Configuration

Configuration is Zod-validated with sensible defaults:
OptionDefaultDescription
tick.interval60000Milliseconds between ticks
tick.autofalseStart ticking automatically
memory.maxShortTerm50Short-term memory limit
verbosefalseEnable debug logging
Reference: src/core/config.ts contains schema and createConfig().

Next Steps