Qleph
Qleph
Qleph is a relational micro-language — a formal symbolic language for expressing and computing relationships between concepts. It gives your AI characters a compact, precise notation for reasoning about causality, structure, conditions, and patterns that natural language handles ambiguously.
Qleph is patent pending.
Why Qleph Exists
Natural language is powerful but imprecise. When an AI analyses a complex system — a CI/CD pipeline, a diagnostic chain, a decision tree — the reasoning gets buried in paragraphs of prose. Qleph gives characters a way to express structural relationships in a notation that is:
- Compact — "Server crashed from a memory leak" becomes
D>F>S!(structure caused flow caused negated state) - Computable — expressions can be evaluated, inverted, and compared by the engine
- Unambiguous — every symbol has one meaning, no interpretation needed
- Zoomable — collapse complex expressions into single glyphs, expand them to see internals
Qleph is not a replacement for natural language. Characters mix Qleph expressions freely with English — using symbolic notation for the structural reasoning and natural language for everything else.
The Alphabet
Qleph has 30 primitives organized into 5 categories:
Roots — The Building Blocks
8 root types represent the fundamental concepts in any relational expression:
| Symbol | Name | Meaning | Example |
|---|---|---|---|
E |
Entity | A thing, actor, or agent | A user, a server, a character |
P |
Process | An action or operation | Build, deploy, analyse, send |
S |
State | A condition or measurement | Health, status, temperature, load |
R |
Pattern | A recurring structure | Error pattern, usage trend, signal |
B |
Boundary | A limit, threshold, or constraint | Deadline, budget, rate limit |
F |
Flow | Movement or transfer | Data flow, shipment, message routing |
D |
Structure | A system, architecture, or container | Database, pipeline, network |
T |
Reference | A pointer or link | URL, document, citation |
Roots take numeric IDs to distinguish instances: S1 (first state), S2 (second state), E1 (first entity).
Bonds — How Things Connect
7 bond types express the relationship between two roots:
| Symbol | Name | Reads As | Example |
|---|---|---|---|
> |
Causal | causes, leads to | E>P — entity causes process |
@ |
Contains | holds, includes | D@E — structure contains entity |
<> |
Equivalent | same as, mirrors | R1<>R2 — patterns are equivalent |
>< |
Opposes | conflicts with | S1><S2 — states oppose each other |
>> |
Sequence | then, followed by | P1>>P2>>P3 — process chain |
: |
Type-of | is a kind of | E1:E — entity1 is a type of entity |
|= |
Requires | depends on, needs | P|=D — process requires structure |
Shades — Modifiers
6 shade symbols modify any root:
| Symbol | Name | Effect | Example |
|---|---|---|---|
+ |
Intensify | Stronger, more | S+ — intensified state |
- |
Diminish | Weaker, less | F- — diminished flow |
! |
Negate | Opposite, failed | S! — negated state (failure) |
? |
Conditional | Maybe, if | D? — conditional structure |
* |
Plural | Multiple | E* — multiple entities |
# |
Certain | Confirmed, locked | S# — certain state |
Logic — Combining Conditions
| Symbol | Name | Meaning |
|---|---|---|
. |
And | Both conditions |
; |
Or | Either condition |
=> |
Therefore | If condition, then result |
Compare — Measurements
| Symbol | Name | Example |
|---|---|---|
= |
Equals | S1=5 — state equals 0.5 |
> + digit |
Greater than | S1>8 — state exceeds 0.8 |
< |
Less than | S1<3 — state below 0.3 |
<- |
Assigns | S1<-S+ — assign intensified state |
Number convention: Single digits represent tenths.
7= 0.7,3= 0.3,8= 0.8.
Reading Qleph — Examples
Simple Statements
| English | Qleph | Reading |
|---|---|---|
| "Thanks, that was helpful" | E>S+# |
Entity causes intensified certain state |
| "First build, then test, then deploy" | P>>P>>P |
Process sequence of three steps |
| "Server crashed from a memory leak" | D>F>S! |
Structure caused flow caused negated state |
| "Fatigue causes errors" | S1>S2 |
State1 causes state2 |
| "These two patterns are equivalent" | R1<>R2 |
Pattern1 equivalent to pattern2 |
Conditional Molecules
Molecules are Qleph's if-then rules — a condition in parentheses, =>, then a consequence:
| English | Qleph | Reading |
|---|---|---|
| "If value is low, reduce flow" | (S1<3)=>F<-F- |
If state1 below 0.3, assign diminished flow |
| "If error rate exceeds 0.3, lock" | (R!>3)=>B<-B# |
If negated-pattern above 0.3, assign certain boundary |
| "When load > 0.8 and memory > 0.9, negate status" | (S1>8.S2>9)=>S3<-S! |
If state1 > 0.8 AND state2 > 0.9, assign negated state3 |
| "If we added caching, throughput would intensify" | (D?)=>F>S+ |
If conditional structure, then flow causes intensified state |
Zoom — Collapsing and Expanding
Lambda (L) is the zoom operator. It collapses any expression into a single glyph for higher-level reasoning:
| Level | Qleph | What You See |
|---|---|---|
| Zoomed out (broad view) | L1>>L2>>L3 |
Three collapsed stages in sequence |
| Zoomed in on L1 | L1=(P1|=D1.S1#)>>P2 |
L1 expands to: process1 requires structure1 AND certain state1, then process2 |
This lets characters reason at different abstraction levels — zoom out to see the pipeline, zoom in to debug a specific stage.
Mixed Language
Qleph expressions are wrapped in <QLEPH> tags and mixed freely with natural language:
The build failed because <QLEPH>P1>S!</QLEPH> and the test
suite needs data <QLEPH>P2|=D1</QLEPH>.
English stays outside the tags. Qleph stays inside. No mixing.
Domain Headers — Custom Vocabularies
Domain headers let you bind roots to domain-specific labels, making expressions readable in context:
[S1=cpu-load S2=memory S3=status B1=threshold E1=service]
With this header, (S1>8.S2>9)=>S3<-S! reads as: "If cpu-load > 0.8 AND memory > 0.9, then status becomes negated."
Example Domains
Monitoring:
[S1=cpu-load S2=memory S3=status B1=threshold E1=service]
(S1>8.S2>9)=>S3<-S!
CI/CD Pipeline:
[P1=build P2=test P3=deploy S1=ready B1=gate]
P1>>P2>>P3|=(S1#.B1!)
Reads: Build, then test, then deploy — requires ready-confirmed AND gate-negated (open).
Decision Making:
[E1=option-a E2=option-b S1=cost S2=benefit B1=budget P1=select]
(S2>S1.S1<B1)=>P1<-E1
Reads: If benefit exceeds cost AND cost is within budget, select option-a.
Root Cause Analysis:
[E1=source P1=cause S1=symptom S2=severity R1=pattern B1=threshold]
(E1>P1>S1.S2>8)=>R1<-R#
Reads: If source causes symptom AND severity > 0.8, pattern is confirmed.
Game Mechanics:
[E1=player S1=health S2=stamina P1=attack P2=defend B1=armor]
(S1<2.S2<1)=>P1<-P!.P2<-P#
Reads: If health < 0.2 AND stamina < 0.1, negate attack AND lock defence.
The Five Operations
Qleph is a stateless computation engine. Every call is independent — no memory, no side effects. Five operations manipulate expressions:
Validate
Check if an expression is syntactically correct. Returns parsed AST or error with position.
Input: P>S+
Result: Valid — chain of process, causal bond, intensified state
Input: P>+
Result: Error — missing root after bond at position 2
Evaluate
Given rules (molecules) and variable bindings, compute which rules fire and what they produce. Pure forward evaluation.
Rules: (S1>8)=>S2<-S!
Bindings: {S1: 9}
Result: Rule fires → S2 = S! (negated state)
Supports conflict strategies when multiple rules assign to the same variable: last-write-wins (default), first-write-wins, or error-on-conflict.
Invert
Find the inverse of a relationship. Useful for reasoning about reversal, undo, and counterfactuals.
Input: E>S+
Invert: E>S- (intensified → diminished)
Input: (S1>8)=>B<-B#
Invert: (S1<8)=>B<-B! (condition and consequence both inverted)
Zoom
Collapse or expand lambda expressions. Zoom out to see the big picture, zoom in to see detail.
Zoom out: P1>>P2>>P3 → L1
Zoom in: L1 → P1>>P2>>P3
Resonate
Find structural analogies between expressions by stripping instance IDs and comparing skeletons. Two expressions from completely different domains may have the same underlying structure.
Domain A (error escalation): S1+>S2><>S3>>P1
Domain B (thermal runaway): S5+>S6><>S7>>P3
Skeleton (both): S+>S><>S>>P
→ Resonance detected — structurally identical pattern
This is how Qleph discovers that an error cascade in software and a thermal runaway in hardware follow the same relational pattern.
Using Qleph in QUI
In Qui Anima
Add the Qleph node to your character's canvas in the Visual Builder. The character gains the Qleph dictionary in its context and can use trigger patterns to invoke operations:
[TRIGGER:qleph:validate:(S1>8)=>B<-B#]
[TRIGGER:qleph:evaluate:rules=...&bindings=...]
[TRIGGER:qleph:invert:E>S+]
In ThinkThing
Two dedicated nodes:
- Qleph Dictionary — Fetches the full dictionary and injects it into the Anima preprompt, so the connected character understands Qleph notation
- Qleph Engine — Validates, evaluates, inverts, zooms, or resonates expressions within a workflow
When to Use Qleph
Qleph is a specialized tool. Enable it on characters that need:
- Formal relational reasoning — expressing causality, dependencies, and conditions precisely
- Cross-domain pattern detection — finding structural analogies between different systems via resonance
- Conditional rule evaluation — defining if-then rules and computing outcomes from variable bindings
- Multi-level abstraction — zooming between high-level pipeline views and detailed component analysis
- Diagnostic reasoning — tracing root causes through causal chains
Most characters don't need Qleph. It's designed for characters working with systems analysis, formal logic, decision frameworks, or any domain where structural precision matters more than conversational fluency.