#What it is
Cortex is a Go framework for building agents that are described the way you would describe a colleague, rather than as a single long system prompt. An agent is composed from primitives that can be versioned, swapped and evaluated independently.
#The human model
- Skill: what it can do. Tool bindings, knowledge references, proficiency levels.
- Trait: who it is. Bipolar personality dimensions with influences on behaviour.
- Behaviour: what it habitually does. Trigger-action patterns with priorities.
- Cognitive style: how it thinks. Phase chains, strategies, transition rules.
- Communication style: how it speaks. Tone, formality, verbosity, adaptation.
- Perception: what it notices. Attention filters and context windows.
- Persona: a composition of the six, reusable across agents.
The reason for the decomposition is maintenance. A 900-line system prompt cannot be tested, nobody can say which paragraph is load-bearing, and fixing one behaviour reliably breaks another. Each primitive here can be evaluated against a Sentinel suite on its own.
#Execution and state
Runs, steps and tool calls are tracked through a state machine with full observability. Memory is split into conversation history, bounded working memory and summaries, scoped per agent per tenant. Checkpoints are human-in-the-loop approval gates that pause a run until someone acts.
Identifiers are TypeIDs: twelve type-prefixed, UUIDv7-based and K-sortable, so an id in a log line tells you what it refers to and roughly when it was created.
#Extending it
Sixteen lifecycle hooks with type-cached dispatch, so an unimplemented hook costs nothing. Two extensions ship in-tree: Prometheus-compatible metrics with eleven counters, and a structured audit trail covering eighteen actions across eight resource types.
Storage is a composite interface of eight sub-interfaces. A production PostgreSQL store using bun with embedded migrations, and an in-memory store for tests, both satisfy it.
#Where it fits
Cortex handles the episode. KGKit handles what survives it. At episode close, conclusions are emitted as typed claims carrying the observations they rest on, and written into the graph as revisable edges. Weave supplies retrieval, Nexus routes the provider traffic, Shield scans input and output, and Sentinel evaluates the result.