XRAPH/Work/Agent runtime
Go · since 2026

Cortex

An agent framework that describes an agent the way you would describe a colleague: what they can do, how they think, how they talk, what they notice, and what they habitually do when something happens. Runs, steps and tool calls are tracked end to end, checkpoints pause a run for human approval, and memory is scoped per agent per tenant.

Language
Go
Category
Agent runtime
Since
2026
Stars
0
Repository Docs
01

Anatomy

4 modules
01

Primitives

Skills, traits, behaviours, cognitive and communication styles, perception.

02

Personas

A switchable identity composing the other six.

03

Run state

Runs, steps and tool calls, each transition recorded.

04

Checkpoints

Human-in-the-loop gates at declared decision points.

02

Why it exists

Design notes

#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.

03

Signals

GitHub
Stars
0
Language
Go
Since
2026
Adopters
00

Shipping something on Cortex? Nobody is listed here yet. Tell me what you built and you will be the first.

Get listed