Why AI Agents Need a Domain Glossary in High-Stakes Systems
How domain glossaries prevent semantic drift, bridge natural language into deterministic schemas in ERP and healthcare, and anchor multi-agent workflows.
A domain glossary for AI agents is an explicit contract that compiles ambiguous business terms into strict schemas, validated enumerations, and pre-execution assertions. In high-stakes systems such as ERP and healthcare, it stops agents from misreading terms like reconcile and violating core business invariants.
Connecting frontier large language models to internal APIs breaks primarily on semantic drift. An autonomous agent instructed to create a credit memo or summarize a clinical chart often generates plausible arguments while violating core business invariants.
In specialized domains like Enterprise Resource Planning (ERP) and healthcare, natural language carries heavy domain assumptions. To a general model, "reconcile" means settling a dispute or comparing summaries. To an SAP financial ledger, reconciliation denotes a control account where manual direct postings are forbidden by regulatory compliance.
Bridging probabilistic reasoning and deterministic execution requires an explicit domain glossary.
The Semantic Drift Problem in Enterprise Workflows
Foundation models train on broad web corpora. This grants versatile reasoning capabilities, but skews semantic defaults toward colloquial usage. Directing an agent with informal human language creates severe translation mismatches against rigid schemas and proprietary APIs.
Without an authoritative glossary, this projection breaks down across three distinct failure modes:
- Jargon collision: The model conflates common words with domain terms. In clinical workflows, "discharge" strictly designates releasing an inpatient under medical orders, not draining fluid or disconnecting power.
- Entity mismatch: The model targets an adjacent entity instead of the required ledger. Mistaking a Cost Center for a Profit Center distorts internal reporting even if the SQL query executes without syntax errors.
- Implicit rule violation: The model generates valid JSON payloads that violate business rules, such as pairing incompatible diagnosis codes or debiting an immutable account.
As teams shift toward autonomous systems described in From Vibe Coding to Agentic Engineering, relying on raw model weights to interpret institutional jargon creates operational liabilities.
Anatomy of an Agent Domain Glossary
An agent-facing domain glossary differs from a human reference. Agents require structured boundary definitions that constrain decoding and tool selection.
A production glossary entry contains four operational components:
- Canonical Term and Aliases: The schema identifier paired with synonyms used by non-technical operators.
- Semantic Invariants: Immutable rules governing the concept, such as prohibiting negative balances or direct modifications.
- Deterministic Code Mappings: Foreign keys, standard codes (like ICD-10 or ISO-4217), and database enums.
- Negative Constraints: Explicit negative rules clarifying common points of confusion.
An enterprise procurement entry defines schema bindings, invariants, and negative constraints in YAML:
term: "Purchase Requisition"
aliases: ["PR", "purchase request", "internal order request"]
domain: "procurement"
target_schema: "SAP_MM_EBAN"
definition: "An internal request submitted by an employee to authorize purchasing goods or services."
invariants:
- "Does not obligate the company to an external vendor."
- "Cannot accept vendor payment terms or shipping invoices."
- "Must reference an approved Cost Center or Project WBS element."
enum_mapping:
document_type: "NB"
negative_constraints:
- "Do not confuse with Purchase Order (PO), which is a legally binding contract sent to a vendor."
- "Never invoke the CreateVendorInvoice tool when handling a Purchase Requisition."If an operator asks to "pay the vendor for requisition 400192", the negative constraint prevents the agent from triggering a wire transfer, routing the request to procurement instead.
Three Enforcement Layers in Agentic Architecture
Dumping an entire enterprise glossary into an agent prompt is ineffective. Large context windows suffer from attention degradation, increasing latency and cost while degrading retrieval accuracy. The same less-is-more logic applies to session history: context compression shows why longer context degrades answers and what survives compaction.
Production architectures enforce domain glossaries across three coordinated layers:
Layer 1: Prompt-Time Just-In-Time Injection
The orchestrator indexes definitions using hybrid vector search and keyword matching. Incoming user prompts trigger retrieval of targeted glossary definition cards into the agent dynamic context window. This conserves tokens while providing precise guardrails for the immediate task.
Layer 2: Schema-Time Tool Parameter Constraints
Glossaries feed tool interfaces by mapping domain enumerations into strict JSON Schema enums or Pydantic models, eliminating open-ended string arguments. If a user mentions "sales tax", the glossary forces the agent to resolve the string to a valid code like US_CA_STATE_TAX before executing the tool call.
Layer 3: Post-Execution Invariant Verification
Before committing a transaction, a deterministic validation harness evaluates the payload against glossary invariant rules. If an agent attempts to submit an invoice without an active purchase order reference, the harness rejects the step and returns an actionable error into the context loop.
Real-World Case Studies
High-Stakes Finance: SAP ERP Posting
Enterprise resource planning systems enforce strict double-entry bookkeeping. In SAP, every accounting line item requires a numeric Posting Key determining debit or credit status and account type.
Processing a vendor utility bill in SAP S/4HANA illustrates the distinction:
- Without a glossary: The ungrounded agent posts a journal entry crediting the vendor G/L account. Because vendor accounts are Reconciliation Accounts, direct manual postings are rejected by the system and the transaction rolls back.
- With a domain glossary: The glossary specification routes vendor liabilities through the Accounts Payable subledger via posting key
31(Vendor Invoice Credit). The offsetting debit targets a utility expense Cost Center via posting key40(G/L Debit). The transaction commits on the first pass.
| Dimension | Ungrounded Prompting | Glossary-Constrained Execution |
|---|---|---|
| Target Account | Direct posting to vendor ledger | Subledger routing via Posting Key 31 |
| Cost Allocation | Arbitrary text label | Validated Cost Center identifier |
| Database Result | Hard transaction rollback | Clean document commit in SAP S/4HANA |
| Error Recovery Loops | Repeated exception loops | Zero retries needed |
Clinical Care: HL7 FHIR Interoperability
Healthcare systems rely on standards like HL7 FHIR. Clinical terminology spans multiple coding systems, each tailored for a specific administrative or medical role.
Reviewing a clinician note such as "Patient presents with persistent essential hypertension, prescribed Lisinopril 10mg daily" exposes critical boundary needs:
- Billing vs. Clinical Records: The diagnosis requires an ICD-10-CM code for billing, but clinical decision support engines require a SNOMED CT concept to monitor care plans. An ungrounded LLM often mixes these up, inserting ICD codes into SNOMED fields and breaking interface engines.
- Medication Coding: The prescription must resolve to a standard RxNorm identifier for the drug rather than free text.
- Safety Invariants: The glossary enforces clinical rules. If the patient record indicates pregnancy, the glossary triggers a verification alert that ACE inhibitors like Lisinopril should be avoided because of fetal toxicity risk.
Grounding the agent with a clinical dictionary reduces hallucinations while maintaining compliance with healthcare standards.
Multi-Agent Synchronization and Reusable Dictionaries
Multi-agent architectures introduce vocabulary drift during subtask delegation between coordinator and worker nodes. Mismatched term interpretations between agents generate cascading operational errors.
Providing a shared, machine-readable glossary guarantees that every agent across the swarm interprets message parameters identically. Much like packaging reusable capabilities into Agent Skills as Modular Packages, maintaining a version-controlled dictionary turns institutional domain knowledge into a portable software asset.
Using the UtilKits Glossary as a Reference
Building an effective domain dictionary requires proven structural patterns. The UtilKits glossary at /en/glossary maintains structured domain schemas with one-click glossary.md export.
The glossary page features:
- Curated Agentic AI Terminology: Clear definitions for core concepts like context windows, agentic harnesses, verification loops, and model context protocols.
- Tag-Based Filtering: Filter terms by architectural discipline, prompt engineering patterns, or coding assistant workflows.
- Direct
glossary.mdExport: Export the filtered collection into a structuredglossary.mdfile with one click.
Placing the exported file in your project root alongside AGENTS.md or CLAUDE.md helps local coding agents and autonomous workflows understand the limits of the tools they use.
Sources
- HL7 FHIR Specification (Release 5.0.0): Canonical standards for electronic healthcare resources and terminology bindings.
- SAP S/4HANA Financial Accounting Documentation: Official enterprise architecture guidelines on posting keys and general ledger controls.
- ArXiv: GraphEval: A Knowledge-Graph Based LLM Hallucination Evaluation Framework: Research evaluating LLM hallucinations by checking outputs against structured knowledge graphs.
- Galileo AI: A Framework to Detect & Reduce LLM Hallucinations: Industry overview of how supplying domain context (RAG) and groundedness checks reduce hallucinations.