Skip to main content

Primitives

OpRelay's coordination model is built on four primitives — deterministic, queryable data structures that agents read and write to coordinate work.

No magic. No embeddings. No black boxes. Just structured state your agents can reason about.

The Four Primitives

Facts

Operational knowledge that persists across sessions. Configuration values, learned context, environment state — anything an agent might need to know.

await oprelay.call("upsert_fact", {
project_key: "myproject",
category: "infra",
key: "db.engine",
value_json: { type: "postgres", version: 16 }
});

Facts reference

Decisions

Architectural choices with rationale, status, and audit trail. When an agent or human makes a decision, it's recorded so every future agent understands why, not just what.

await oprelay.call("upsert_decision", {
project_key: "myproject",
decision_key: "auth.strategy",
summary: "Use stateless OAuth for MCP connections",
rationale: "Eliminates session expiry mid-conversation",
status: "accepted"
});

Decisions reference

Tasks

Units of work with lifecycle management, advisory locking, priority, and assignment. Agents claim tasks, execute in isolation, and transition through states.

await oprelay.call("core_create_task", {
project_key: "myproject",
title: "Implement SSE broker endpoints",
priority: 1,
assigned_to: "codex-worker-01"
});

Tasks reference

Runs

Execution records tied to tasks. Every agent run captures token usage, model, duration, outcome, and optional traces. Append-only — the audit trail is permanent.

Runs reference

How they compose

An agent connects, calls get_context to load relevant facts and decisions, claims a task, starts a run, executes, and records the outcome. The next agent sees everything the previous one did.

This is operational memory — not what your agent remembers, but what your agents know together.