Skip to content

EQL Reference

EQL (Epistemic Query Language) is the query language for EpistemicDB. It operates on epistemic primitives — Knowledge Objects (KOs), gaps (Q-KOs), bonds, and molecules.

FETCH — Retrieve knowledge objects

eql
FETCH KO
  WHERE entity = "pricing"
  AND decay_score > 0.35
  AS projection DYNAMIC
  ORDER BY K DESC
  LIMIT 10

Targets: KO, D-KO, MOLECULE

Projections: STRUCTURAL, DYNAMIC, CONSTRAINT, COMPOSITIONAL

OPEN GAPS — Find blocking unknowns

eql
OPEN GAPS
  WHERE blocking ANY DECISION
  AND urgency > 0.60
  ORDER BY urgency DESC

Returns Q-KOs (questions) ordered by urgency. The urgency field and blocking condition are only valid in this context.

PROJECT DECAY — Forward-looking staleness

eql
PROJECT DECAY
  WHERE entity = "ai-triage"
  AND decay_score_at(+30d) < 0.35
  RETURN ko, owner, decay_velocity

Projects decay scores into the future. decay_score_at(+30d) computes what the decay score will be in 30 days.

Both forms are valid:

  • decay_score < decay_score_at(+30d) — function on right
  • decay_score_at(+30d) < 0.35 — function on left

COMPOSE — Trigger D-KO synthesis

eql
COMPOSE
  FROM MOLECULE
  WHERE coherence > 0.70
  AND reaction_potential > 0.78
  USING OPERATOR DERIVE

Operators: DERIVE, MERGE, CONTRADICT

Both coherence and reaction_potential conditions are required.

WATCH — Live subscriptions

eql
WATCH KO
  WHERE entity = "pricing"
  AND decay_score < 0.40
  AS projection STRUCTURAL

Creates a live subscription. Events are pushed via WebSocket when matching KOs change.

Epistemic Classes

ClassDecayHalf-life
DECISIONnonenever
EVIDENCEexponential365d
OBSERVATIONexponential90d
HYPOTHESISexponential120d
PLANexponential180d
CONSTRAINTnonenever
NARRATIVEnonenever
Q_FACTUALinverseurgency grows
Q_DECISIONinverseurgency grows
Q_STRATEGICinverseurgency grows

Duration Literals

+30d (30 days), +1w (7 days), +1m (30 days), +1y (365 days)

Negative values: -7d (7 days ago)

Comments

eql
-- This is a comment
FETCH KO WHERE decay_score > 0.35  -- inline comment

Released under the MIT License.