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.

View Source

Main repository

Live Demo

See ClarkOS in action

Reactive vs Generative

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: 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: Reference: calculateRoutine() in src/core/tick.ts

Creating an Agent

The Agent class wraps the tick system, plugins, and backend:
Reference: src/core/agent.ts for the Agent class implementation.

Configuration

Configuration is Zod-validated with sensible defaults: Reference: src/core/config.ts contains schema and createConfig().

Next Steps

Memory System

How agents store and retrieve memories.

Tick System

Deep dive into continuous execution.