Ambient Awareness
How Chalie stays aware of the world — the world-state snapshot and the background services that feed it into every turn.
Chalie keeps a lightweight, in-process picture of “what’s going on right now” and folds it into context on every turn. That picture is world state. It does two jobs: it renders a short telemetry block into the system prompt the model sees, and it drives the idle gate that decides when the background cognition loop is allowed to run (see Memory & Cognition). This page explains what’s in world state and the services that feed it.
The world-state snapshot
A handful of typed facts about the live session, written by internal code. There are four recognised kinds; anything else is silently ignored, so the snapshot is forward-compatible.
| Fact | Written by | Captures |
|---|---|---|
user_message |
The chat turn pipeline | When the user last spoke — persisted durably so it survives a restart |
heartbeat |
The client heartbeat | Last contact from a connected device |
device |
The client heartbeat | Current device class (phone, desktop, …) |
local_time |
The client heartbeat | The client’s reported local time |
The one that matters most is the last-user-message timestamp: the background cognition jobs read it to enforce their idle gate, each firing only once the user has been quiet long enough.
How world state reaches the model
On each turn, world state renders to a compact telemetry block that’s dropped into the system prompt — device, timing, and location, grouped into bulleted lines.
This is the same pattern the whole runtime uses: rather than relying on a provider’s native multi-turn format, Chalie assembles exactly the text it wants the model to see. The world-state block is one more deliberately-rendered piece of that context.
Location privacy by design
When the client reports GPS, world state resolves it to a place name — and only the name reaches the model. The telemetry block surfaces something like location_name: Valletta, Malta, never the raw latitude/longitude. The coordinates stay internal, consumed directly by features that genuinely need them — weather lookups, a departure advisory, locale resolution, and the background geo-pattern pass that clusters location-tagged history into place-based habits. The chat model only ever sees the resolved scalar.
Background cognition keeps world state alive
World state and the cognition loop are kept alive by background work supervised alongside the rest of the runtime (see Architecture). Background cognition isn’t one worker but a set of independent jobs — consolidation, fact extraction, decay, pattern matching, reflection, and proactive research — each gated on idleness, checked every 5 minutes, and firing only after 30+ minutes of quiet. Detailed in Memory & Cognition.
Everything here degrades gracefully: a failed step is logged and skipped rather than surfaced as an error. Ambient awareness is meant to be a soft background hum, not a load-bearing dependency.
Where to read next
- Memory & Cognition — the background cognition loop the idle gate guards, and how awareness turns into durable memory.
- Architecture — the single-process, worker-based runtime that hosts these services.
- Message Flow — how the world-state block fits into a turn’s assembled context.
- Threads — the foreground conversation surfaces this background loop runs independently of.