Hybrid Symbolic-Neural Routing
also known as Neuro-Symbolic Routing, Symbolic/Neural Hybrid, ハイブリッド・シンボリック・ニューラル
Per query, route between a symbolic path (rule engine, knowledge graph) and a neural path (LLM), using the LLM for interpretation and the symbolic layer for exact constraints.
This pattern helps complete certain larger patterns —
- specialisesRouting★★— Classify an incoming request and dispatch it to the specialist (lane / agent / model) best suited to handle it.
Context
An agent serves a mixed workload: some queries are inherently logical (tax rules, dosage limits, schema validation, eligibility checks) where a wrong answer is unacceptable; other queries are inherently interpretive (free-text intent, summarization, ranking) where exact rules do not exist. Sending everything to the LLM costs accuracy on the logical queries; sending everything to a rule engine is impossible for the interpretive ones.
Problem
LLMs are bad at exact constraint satisfaction at scale — they confabulate edge cases, lose track of conjunctions, and silently round numbers. Rule engines are bad at interpretation — they cannot handle free text. Yet most real workloads need both. A single path forces one of two losses: confabulated rule violations from the LLM path, or brittle template-only coverage from the symbolic path. Recent practitioner write-ups (Japanese Qiita, Anthropic-style architecture posts) and the Nov 2025 arXiv preprint 'Bridging Symbolic Control and Neural Reasoning in LLM Agents' converge on per-query routing as the resolution: estimate complexity, decide where the query belongs, and only blend the two when neither pure path suffices.
Forces
- Hard rules need verifiable execution; LLMs cannot give that guarantee without external enforcement.
- Interpretive queries need free-text understanding; rule engines cannot give that.
- Per-query routing is itself a model — a bad router collapses to either pure-LLM or pure-symbolic.
- Maintaining two stacks (LLM + symbolic) doubles the surface for drift; the routing decision is also the boundary that has to be kept current.
Example
A medication-recommendation assistant takes free-text clinician queries. The router classifies each query: 'is amoxicillin contraindicated with X?' → symbolic path (drug-interaction graph, deterministic answer). 'Summarize this patient's last three visits' → neural path (LLM with retrieval). 'Patient is allergic to penicillin and on warfarin — what should I avoid?' → hybrid: LLM proposes candidate drugs, symbolic layer validates each against allergy + interaction rules and returns the filtered set. Router accuracy is tracked weekly; a regression on hard-rule queries triggers a rule-base refresh.
Diagram
Solution
Therefore:
Build three first-class components: (a) a symbolic path holding the rules, ontologies, and constraint solvers; (b) a neural path holding the LLM with retrieval, tools, and synthesis; (c) a router that estimates per-query complexity and resource needs and dispatches. For genuinely hybrid queries, the LLM proposes a plan that the symbolic layer validates and executes — the LLM never asserts the answer alone. Track router accuracy as a first-class metric; treat boundary drift as a regression.
What this pattern forbids. Forbids the LLM from asserting outputs that fall under the symbolic path's jurisdiction without symbolic validation. The router and symbolic layer together restrict the LLM's freedom to ungoverned interpretive and synthesis tasks.
The smaller patterns that complete this one —
- usesKnowledge Graph Memory★— Persist agent memory as entities and relations in a structured graph so symbolic queries (path, neighbour, type) become possible.
- generalisesMRKL Systems (Modular Neuro-Symbolic)★★— Route each request through an LLM dispatcher to specialized symbolic or neural expert modules (calculator, knowledge base, code executor) rather than asking one LLM to do everything; integrate the modules' results for the final response.
And the patterns that stand alongside it, or against it —
- complementsMulti-Model Routing★★— Send each request to the cheapest model that can handle it well.
- complementsDeterministic-LLM Sandwich★— Bracket every LLM call with deterministic checks on both sides.
- complementsWorld Model as Tool·— Let a planning agent invoke a generative world model as a tool to roll out hypothetical futures before committing to an action, treating the world model as a callable simulator rather than a training target.
- complementsPolicy-as-Code Gate★— Evaluate every proposed agent action against externally-managed machine-readable policies before dispatch, so compliance authorship lives outside the prompt and outside the agent code.
- complementsHybrid HTN + Generative Agent★— Hierarchical Task Network decomposition provides the procedural backbone; the generative LLM is invoked only at leaf nodes for the parts of the task that are genuinely open-ended.
- complementsBPMN/DMN Deterministic Shell Around Agent★— BPMN processes and DMN decision tables form the deterministic spine; LLM-driven agents are invoked only at explicit 'unstructured problem' nodes inside the process.
Neighbourhood
Click any neighbour to follow the language. Scroll to zoom, drag to pan.