ARCHITECTURE

Explicit layers, clear authority

Karnelian separates identity, session state, memory, model access, execution, and persistence so every authority boundary remains visible and replaceable.

Karnelian's connected agent architecture from soul to persistent memory
THE AGENT PIPELINE

From soul to durable state

A request passes through a deliberate sequence. Identity and current session state shape context; policy governs model and tool use; outcomes return to memory and the event ledger.

01

Soul

The agent identity defines role, values, behavior, and relationship to the operator.

02

Session

A durable working thread carries goals and live state across turns.

03

Memory

Relevant knowledge is retrieved rather than dumping an entire history into context.

04

Context

Mantras, memories, skills, and current state assemble into a bounded prompt.

05

Model router

Policy chooses an eligible local or hosted model path.

06

Tool execution

Approved capabilities enter isolated specialist runtimes.

07

Persistence

Results, events, and compacted context become durable state.

Karnelian's connected agent architecture from soul to persistent memory
SYSTEM LAYERS

Infrastructure, not a toy agent loop

INTERFACES

CLI, REST /v1, and WebSocket /v1/events/ws expose one coherent control plane.

RUST ORCHESTRATOR

Axum, Tokio, and SQLx coordinate tasks, scheduling, sessions, and durable event state.

TRUST SERVICES

Policy, approvals, memory, BLAKE3 ledger chaining, and MAGIC entropy remain separate concerns.

WORKER RUNTIMES

Node.js, Python, WebAssembly, and trusted native Rust operations execute declared skills.

MODEL GATEWAY

A provider-neutral path supports local inference and policy-selected hosted providers.

MACHINE LAYER

KRNL OS is the planned Linux-rooted service architecture beneath the shipping Harness.

MEMORY + ELIXIRS

Knowledge must earn permanence

Elixirs are retrieval-backed knowledge objects with a proposal and approval workflow, quality scoring, mantra links, and context assembly.

  • Retrieval supplies relevant context
  • Approval controls what becomes durable knowledge
  • Quality scoring helps rank useful material
  • Mantra links connect knowledge to agent behavior
EVENT PRIORITIES

Observable without becoming noise

The event stream carries task, approval, execution, and system state. High-frequency heartbeat events are sampled so important operator signals remain readable.

  • WebSocket delivery for live system state
  • HeartbeatTick telemetry sampled at ten percent
  • Durable task state remains queryable
  • Interfaces consume the same underlying event model