Build a semantic ontology to power AI assistants on AWS – Part 1

AMAZON ·

Are your artificial intelligence (AI) assistants struggling to find relevant data across thousands of enterprise tables and unstructured documents? You’re not alone. Many teams face this challenge when scaling large language model (LLM) applications beyond simple demos. In this post, we show you how to build a semantic ontology that helps your AI assistants navigate enterprise data efficiently. You’ll learn how to structure a property graph store for data relationships, set up vector indexing for semantic search, and implement an automated fact-learning layer that improves use. This bottom-up approach grounds your ontology in the data that exists, building abstractions from observed patterns rather than theoretical models. As LLMs started gaining mainstream traction, one of the first enterprise use cases that emerged was applying them to data analysis. Business users could describe what they needed in plain language, and the model handled the technical translation. Text-to-SQL became the standard example of this pattern. You feed the model a database/table schema, let it generate a query, run it, and return results. For single databases with clean, well-documented schemas, this pattern delivered real value and represented a meaningful improvement in how teams accessed data. The temptation then began to scale what worked. Enterprise data teams looked at their sprawling data lakes, sometimes comprising hundreds or thousands of tables across multiple query engines. They asked the reasonable question: why not feed all the schemas and let the model figure it out? Context windows expanded rapidly, reaching millions of tokens. But raw schemas lack the semantic relationships and business context that models need to reason effectively, and no amount of technical metadata compensates for missing meaning. In practice, this approach breaks down. Have you noticed your accuracy getting worse as you add more context? Here’s why that happens: LLM performance drops significantly as context length increases, even when the model can technically ingest the tokens. Every additional token competes for the model’s attention budget. When relevant information gets buried among thousands of table definitions, the model struggles to surface what matters. You end up with hallucinated joins, incorrect aggregations, and queries that run successfully but return meaningless results. The following diagram illustrates how dumping an entire data catalog into an LLM’s context leads to degraded performance. Context overload pattern showing how flooding an LLM with raw schema metadata leads to attention dilution and poor query generation. This is where a semantic layer becomes essential. An ontology provides a structured, queryable representation of concepts and their relationships, disambiguating terms, encoding business rules, and capturing logic across domain entities. This semantic grounding reduces the likelihood of hallucinated results by giving the model’s attention layers precise, meaningful context rather than raw metadata. A side effect of this targeted retrieval is more efficient use of the context window. It translates raw schemas into business concepts and captures relationships and rules that live nowhere in the technical metadata. It also supports targeted retrieval, so only the context needed for the task at hand gets pulled. The bottleneck is no longer model intelligence, but how you structure the information these models consume. The traditional path to building ontologies is top-down: you assemble domain experts, conduct workshops, define business concepts and hierarchies, then map these constructs down to the underlying data assets. This approach produces well-formed ontologies with clear domain alignment, but it carries practical risks. It often takes months or years, requires continuous stakeholder alignment, and can result in conceptual models that drift from how data exists. The more compelling path is to automate the foundational 80%. You use bottom-up extraction to build a data-grounded starting point, then guide users toward a well-formed ontology through LLM-guided conversation. This conversation surfaces the right questions, proposes relationships for validation, and induces ontological structure from expert responses rather than requiring experts to build it from scratch. The bottom-up approach starts with what exists: the schemas in your data catalog, the data distributions in your storage layers, the relationships that live in the data but not in the documentation. You use the same LLM capabilities that will consume the ontology to help construct it. These capabilities parse schemas, interpret patterns, and surface connections that would take analysts weeks to catalog manually. This approach produces an ontology grounded in reality: how data relates, not how you wish it would. We chose bottom-up precisely because it aligns with how agentic systems operate. An agent exploring your data estate benefits from an ontology that reflects actual data structures, not a theoretical model of how the business should be organized. The goal is practical utility rather than perfection: a semantic layer that facilitates efficient navigation, surfaces ambiguity where it exists, and supports targeted retrieval of the right context for the task at hand. The system you’ll build has three distinct but complementary components. The following diagram illustrates the relationship between the graph store, vector index, and facts layer, along with how they’re populated from catalog and profiling data. The three-layer architecture shows how graph storage, vector indexing, and learned facts work together to create a queryable semantic layer. The ontology is the structural foundation, consisting of concepts (tables, columns, datasets, business terms) and their relationships (joins, hierarchies, implementations). This layer is relatively stable and represents the shape of your data landscape. Property graphs provide the natural structure for representing entities and their relationships in a way that you can traverse programmatically. The vector index sits alongside the graph and supports semantic search, letting you find relevant entities by meaning, not only by exact name matches. When someone asks about “customer churn,” the system retrieves related concepts even if they’re labeled “attrition” or “cancellation rate” in the underlying data. The facts layer operates on top of this foundation. It stores learned assertions as structured facts with confidence scores and provenance. Examples include “column X decodes column Y,” “metric Z is calculated as A/B,” and “table P is preferred over Q for this use case.” Ontology makes commitments about what kinds of things exist and how they relate — the conceptual structure. The facts layer captures learned assertions about specific instances within that structure. The signals layer (which feeds the facts layer through usage patterns and feedback) tells you what to learn next. You construct the semantic layer through an automated pipeline. Here’s how each step works and why it matters. Data catalogs contain technical metadata (schemas, tables, columns, data types) but it’s flat. The catalog lacks hierarchical structure, explicit join relationships, and business context. You need a graph that you can traverse. To solve this, you extract metadata from your catalog and load it into a graph store as a property graph with explicit hierarchical relationships. The following diagram illustrates the hierarchy from enterprise down to individual columns. Hierarchical organization of data assets in the property graph, from enterprise level down to individual columns. This hierarchy provides navigational context. Instead of 10,000 flat columns, you get a traversable structure: “Show me customer data → customer accounts → tables → columns.” The graph structure makes exploration tractable. Extract metadata from your data catalog, including schema names, table definitions, column names, and data types. Create nodes in your graph to store for each entity with properties such as name, description, and data_type . Create directed edges for relationships ( CONTAINS , DEFINES_STRUCTURE , BELONGS_TO ) to establish the hierarchy. Set up event-driven updates triggered by catalog changes, so that when schemas change, you incrementally update the graph rather than rebuild everything. Schema metadata tells you status_code is a VARCHAR , and status_description is a VARCHAR , but it doesn’t tell you they’re semantically related, or that one decodes the other. These implicit relationships are critical for understanding data and finding them requires profiling actual data to gather statistics, then using an LLM to identify semantic connections. Start by profiling the data. For each table, run queries to gather row counts, distinct value counts per column, sample values, data distributions, and cardinality patterns. Low cardinality suggests codes or categories. Next, identify relationship candidates by looking for column pairs within the same table that might be related. Both columns might contain similar keywords, such as “status,” “code,” or “description.” One might have low cardinality that matches the other’s cardinality. Alternatively, one might appear to be a code (short, uppercase) while the other reads as a description (longer, mixed case). Then use LLM-powered relationship identification. For each candidate pair, send profiles to an LLM with a structured prompt: Analyze these two columns from the same table: Column A: status_code - Sample values: ["SHIP", "CANC", "COMP", "PEND"] - Distinct count: 4 - Pattern: Short uppercase codes Column B: status_description - Sample values: ["Shipped", "Cancelled", "Completed", "Pending"] - Distinct count: 4 - Pattern: Full words, title case Question: Are these columns semantically related? If yes, specify the relationship type: - describes: B provides human-readable description of A - names: B provides the name/label for A - measures: B quantifies what A represents - validates: B indicates validity of A Provide confidence score (0.0-1.0) and reasoning. The LLM responds with structured output: { "are_related": true, "relationship_type": "describes", "confidence": 0.95, "reasoning": "status_code contains abbreviated codes while status_description contains the full text descriptions. The cardinality matches exactly, and sample values show clear 1:1 mapping: SHIP→Shipped, CANC→Cancelled, etc." } Finally, store the relationships you identified by creating relationship edges in the graph with properties including relationship type, confidence score, reasoning, and verification status. This step uncovers the “Rosetta Stone” mappings that decode cryptic codes into human-readable descriptions. When status_code = “SHIP” appears, the relationship edge leads to “Shipped” from the related column. In production, this typically uncovers 200–300 semantic relationships per 1,000 columns, knowledge that would take analysts weeks to document manually. Technical column names like rgn_code , region_identifier , and territory_id all represent the same business concept, but the schema alone provides no way to know that. You need a consistent business vocabulary that maps multiple technical columns to unified business terms. The approach is to use an LLM to generate business terms, then deduplicate semantically using vector similarity. For term generation, provide comprehensive context for each column: Generate a business-friendly term for this column: Column: rgn_code Table: crm.accounts (Customer account records) Sample Values: ["NE", "SE", "MW", "SW", "WE"] Distinct Count: 45 Related Columns (discovered in Step 2): - rgn_name (describes): ["Northeast", "Southeast", "Midwest", ...] Existing Terms in This Table: - "Account Number" (from account_id column) - "Account Description" (from account_desc column) Task: Propose a business term that uses clear language, is consistent with existing terms, and reflects actual content. Provide: term_name, definition, domain, synonyms, confidence. The LLM responds: { "term_name": "Sales Region Code", "definition": "Unique identifier for geographic sales regions in customer management.", "domain": "Sales", "synonyms": ["Region Identifier", "Territory Code", "RGN Code"], "confidence": 0.88 } Before you create a new business term node, check if an equivalent term already exists through semantic deduplication. Query for exact name matches first. If you find none, generate an embedding for the proposed term and perform a nearest-neighbor search. If cosine similarity exceeds your threshold (typically 0.85), ask the LLM to verify equivalence. If the terms are equivalent, link the column to the existing term. If no match exists, create a new term node. This approach achieves 30–50% term reuse. The same business concept emerges naturally from different technical columns across tables. You get consistent vocabulary without manual curation. In parallel processing environments, race conditions can create duplicates. You can address this with optimistic locking, configuring index refresh intervals, implementing retry logic, and using coordinator-worker patterns. You need to find relevant entities by meaning, not only exact names. Someone asking about “customer churn” should find tables labeled “attrition” or cancellation_rate . Vector embeddings indexed for nearest-neighbor search make this possible. Start by creating a searchable text. For each entity, combine the relevant fields: Sales Region Code. Unique identifier for geographic sales regions. Synonyms: Region Identifier, Territory Code. Domain: Sales Then generate and index embeddings. Create vector embeddings and configure hybrid search that combines keyword matching (BM25) with vector similarity (k-NN). Semantic search bridges the gap between how you describe what you need (“customer churn”) and how data is actually labeled ( cancellation_rate , attrition_flag ). The timing for semantic layers isn’t coincidental. Three shifts have converged to make this approach both possible and necessary. Agentic systems have crossed a capability threshold. Modern agentic systems can plan, iterate, course-correct, and maintain context across extended interactions. The bottleneck is no longer whether models can reason through complex tasks, but whether they have the right information architecture to do so efficiently. Context windows are large but not infinite. Models can ingest millions of tokens, which created the illusion that you could dump everything into context. Performance degrades as context length increases. The solution isn’t bigger context windows. It’s smarter retrieval. An ontology supports targeted context loading. Enterprise data has become too complex for static documentation. Hundreds of data sources, thousands of tables, constantly evolving schemas, and tribal knowledge scattered across teams. Traditional documentation can’t keep pace. A self-learning semantic layer builds understanding incrementally, learning from actual usage rather than requiring someone to write it all down. In this post, we showed you how to build a semantic ontology that helps AI assistants navigate enterprise data efficiently using a bottom-up approach. You walked through a four-step pipeline: populating a graph store from your data catalog, profiling columns to find hidden relationships, generating deduplicated business terms, and indexing everything for semantic search. You also learned how a self-learning facts layer keeps your ontology current by extracting and verifying knowledge from every interaction. In Part 2, we go deeper into the fact extraction mechanism and the self-learning loop that keeps your semantic layer accurate over time. You’ll see how to harvest chat sessions between users and AI assistants to extract candidate facts. We also cover the verification pipeline that validates those facts before promoting them to trusted status. Finally, we explain the feedback signals that decide which knowledge rises in prominence and which fades.

AI 시장 분석

AWS has provided guidelines for building a lexical ontology for AI assistants. This highlights the difficulty of many AI assistants to navigating corporate data.

상승 영향

하락 영향

DYAX 전담 분석

AI assistants face significant challenges when trying to navigate corporate data. With the rise of digital transformation, corporate data is becoming increasingly complex. However, AWS' guidelines offer a promising solution to these challenges.

Building a lexical ontology for AI assistants can help to standardize and organize corporate data, making it easier to navigate and analyze. By structuring corporate data in a graph-based store, AI assistants can quickly and efficiently access the information they need to make informed decisions.

This approach also enables AI assistants to better understand the context and meaning of corporate data, improving their ability to provide accurate and relevant responses to user queries.

Furthermore, the use of lexical ontologies can help to reduce the complexity of corporate data, making it easier to integrate with other systems and applications. This can lead to improved collaboration and knowledge sharing between teams and departments.

AI가 생성한 분석으로 투자 자문이 아닙니다.

DYAX Investor Sentiment

Bullish (Long) 49% · Bearish (Short) 51%

510 participants

Related News

원문 보기 — AMAZON