Runtime Lifecycle
Every message you send in Kognisant goes through a 5-phase execution pipeline. Understanding these phases helps you interpret the status lines, debug slow responses, and know when to intervene.
The 5 Phases
User Message│
▼
┌─ Bootstrap ──── Model selection, capabilities, health check
│
├─ Plan ────────── Classify, build prompt, estimate tokens
│
├─ Execute ─────── API call, streaming, tool execution
│
├─ Reflect ─────── Validate outcome, update reliability
│
└─ Persist ─────── Save session, update memory atomically
---
Phase 1: Bootstrap
What happens:
Output line:
⚡ gemma4:latest | valence: +22 | 8 skills, 4 tools
Breaking this down:
⚡ - Bootstrap phase indicatorgemma4:latest - Active model namevalence: +22 - System mood score (-100 to +100). Green if positive, red if negative8 skills, 4 tools - Loaded capabilities countSpecial cases:
First execution ever:
⚡ Welcome - first execution. Using gemma3:1b (configured default). No history yet.
Auto-switch (circuit breaker tripped):
⚡ Switching → llama-3.3-70b-versatile⚠️ gemma3:1b circuit breaker OPEN; using llama-3.3-70b-versatile (reliability: 0.89)
Local model unreachable:
⚡ ⚠️ Ollama server not reachable at http://localhost:11434
---
Phase 2: Plan
What happens:
Classifications:
| Type | Meaning | Context Loaded | Tools |
| :--- | :--- | :--- | :--- |
| SIMPLE | Quick factual answer | Minimal | No |
| CONTEXT | Needs project awareness | Memory + files | No |
| COMPLEX | Needs tools and full context | Everything | Yes |
| AUTONOMOUS | Multi-step, delegated to swarm | Agent dispatch | N/A |
📋 COMPLEX → ~2,100 tokens input (sys: 800 + tools: 600 + hist: 400 + msg: 300)
Breaking this down:
📋 - Plan phase indicatorCOMPLEX - Classification result~2,100 tokens input - Estimated total input tokens(sys: 800 + tools: 600 + hist: 400 + msg: 300) - Token breakdown by sourceFor AUTONOMOUS:
📋 AUTONOMOUS → delegating to agent swarmDetected multi-step task requiring parallel execution
---
Phase 3: Execute
What happens:
Output during execution:
Thinking display:
💭 Thinking...1. Analyze the current middleware structure.
2. JWT verification needs to happen before route handlers.
💭 Thought for 8.3s
Tool call boxes:
┌─ Read auth/middleware.py ────────────────────────────────────────────┐│ ✓ 2ms | 3.2KB read │
└──────────────────────────────────────────────────────────────────────┘
┌─ Accepted edits to auth/middleware.py ──────────────────────────────┐
│ ✓ 4ms | 3 edits applied │
└──────────────────────────────────────────────────────────────────────┘
Streaming: The final text response streams to your terminal in real-time. You see words appear as the model generates them.
---
Phase 4: Reflect
What happens:
Reflection levels:
| Level | Frequency | What it does |
| :--- | :--- | :--- |
| HOT | Every turn | Update valence, model stats, tool stats |
| WARM | Every 3rd | Check for patterns (consecutive failures, low reliability warnings) |
| COLD | Every 20th | Full health report (success rates, response times, valence trend) |
🔍 18.2s | 2,100 in > 420 out | valence: +27 (+5) | 3 tool(s)
Breaking this down:
🔍 - Reflect phase indicator18.2s - Total wall-clock time for this execution2,100 in > 420 out - Input tokens sent, output tokens receivedvalence: +27 (+5) - New valence score and the delta from this execution3 tool(s) - Number of tool calls madeWARM advisory (when triggered):
⚠️ 3 consecutive failures. Consider /model to switch.
COLD health report (when triggered):
📊 Health Report:Total executions: 40
Success rate: 92%
Avg response time: 8.3s
gemma4:latest: 35s/3f (rel: 0.92, avg: 7.1s)
deepseek-chat: 5s/0f (rel: 0.86, avg: 12.4s)
Valence trend: Good (+22)
---
Phase 5: Persist
What happens:
.kognisant/history/context.md if significant changes were made~/.kognisant_core/self_model.jsonNo output line - Persist is silent unless there is an error.
If persist fails (disk full, permissions), the error is logged but does not affect your response. Your answer was already displayed during Execute.
---
Timeouts
By classification and model type
| Classification | Local Model | Cloud Model |
| :--- | :--- | :--- |
| SIMPLE | 120s | 30s |
| CONTEXT | 180s | 60s |
| COMPLEX | 300s | 120s |
Adaptive behavior
If a model consistently responds within a certain time range, the timeout is adequate. If it times out, the reflect phase records a -15 valence hit and increments the failure counter.
What happens on timeout
---
Retry Strategy
Retryable errors get up to 3 attempts before failure:
What is retryable:
What is NOT retryable:
Retry behavior:
There is no exponential backoff between retries. The goal is fast recovery for transient issues.
---
Rollback on Failure
If execution fails (after retries are exhausted or on a non-retryable error):
This means a failed execution never corrupts your project state. The worst case is lost time, never lost data.
---
The Full Picture
Here is a complete execution flow for a COMPLEX message:
You > refactor the auth module to use JWT⚡ gemma4:latest | valence: +22 | 8 skills, 4 tools
📋 COMPLEX → ~2,100 tokens input (sys: 800 + tools: 600 + hist: 400 + msg: 300)
💭 Thinking...
1. Read the current auth module to understand the structure.
2. The bcrypt-based session system needs to be replaced with JWT.
3. I'll need to update the middleware, login route, and tests.
💭 Thought for 12.4s
┌─ Read auth/middleware.py ────────────────────────────────────────────┐
│ ✓ 2ms | 3.2KB read │
└──────────────────────────────────────────────────────────────────────┘
┌─ Accepted edits to auth/middleware.py ──────────────────────────────┐
│ ✓ 4ms | 3 edits applied │
└──────────────────────────────────────────────────────────────────────┘
┌─ Created auth/jwt_utils.py ─────────────────────────────────────────┐
│ ✓ 1ms | created (1.8KB) │
└──────────────────────────────────────────────────────────────────────┘
Kognisant >
Done. I've replaced the session-based auth with JWT:
auth/jwt_utils.py with token generation and verification🔍 18.2s | 2,100 in > 420 out | valence: +27 (+5) | 3 tool(s)
Each line tells a story. Learn to read them, and you will never wonder what Kognisant is doing.