Engineering

What Building a Knowledge Layer Taught Me About AI

Building AI readiness for the EU AI act

Key Takeaways 

  • Connecting AI agents to APIs isn’t enough. They need a normalized knowledge layer to reason over verified data instead of inventing answers. 
  • Structured evidence stored in an intermediate layer prevents hallucinations by creating a deterministic boundary between retrieval and reasoning. 
  • Building trustworthy AI systems requires treating prose as human-facing output and structured data as agent-facing input. 

 
When I joined Precisely, I expected the usual rampup: elearning modules, reading docs, exploring APIs, and figuring out how the pieces fit together. Instead, within days, I was building on top of an MCP server (Model Context Protocol — a framework that lets AI agents call tools and APIs) that let an AI agent interact with the Precisely Data Integrity Suite. 

Instead of asking how fast I could learn the product, I started asking how I could help the agent learn on its own. 

Why Does Simple API Access Fall Short for AI Agents? 

Simple prompts like, “What terms are associated with the customer dataset?” worked so well through the MCP that it felt almost magical. But as complexity increased, I noticed a gap I did not expect — and I suspect many AI applications fail for the same reason: 

I had connected a few MCPs to different Data Integrity Suite instances and needed to compare readiness across them. The answers seemed almost right. Plausible, but still incorrect. 

Working with the MCP server gave the agent access to the APIs, but not an understanding of how data flows through the Suite or how the broader lifecycle fits together. The agent needed to stay grounded in the data returned from the MCP. My goal was clear: make the output trustworthy. 

What Happens When AI Agents Choose the Wrong Search Paths? 

Achieving my goal took a few steps.  

First, I realized the action the agent favored did not search the way I expected. For example, searching for a type name like “Domain” did not reliably return Domain records. Instead, it returned anything with that word in the asset name, including unrelated entries like columns or metric types. For a while, that made it look like Domains were not retrievable at all. 

The more accurate path was an advanced search action that filtered by asset type instead of relying on fulltext name matching. That distinction was available through the “describe action” tool, but I assumed the agent would choose correctly on its own.  

In reality, confidence scoring pushed it toward the wrong action path — a subtle but important lesson. It was a small technical change, but it created better continuity between the data that existed and the data the agent received.  

Still, it did not stop hallucinations in the final conclusion. Better retrieval solved part of the problem. The real issue was deeper: even with cleaner data, the model could still misinterpret what it found. 

What Is a Knowledge Layer and Why Does It Matter for AI Agents?  

That realization pushed me to build what I am calling a knowledge layer between retrieval and reasoning.  

Instead of letting the model jump from search results to conclusions, I wanted an intermediate step that normalized what had been found, filtered weak matches, and preserved only entities I could trust. A type validator like Zod still mattered, but it was not enough. A hallucinated string is still a string. I needed guardrails that ensured the model was reasoning over actual evidence. 

Data Integrity Suite vocabulary is part platform and part local. When you query advanced search for governed types, you get the platform’s universal vocabulary back: Domains, Business Terms, Models, and Policies. On top of that, each instance I connected to had its own custom reference types shaped by its compliance program, operating language, and structure. That meant the knowledge layer had to support both stable slots for universal types and a translation pass for local ones. 

Building and Structuring the AI Knowledge Layer 

In practice, the knowledge layer was a normalized working set built from verified results: asset IDs, asset type, display name, source instance, and a small set of trusted relationships.  

Once an entity entered that layer, the model could compare or summarize it. Keeping this layer stable mattered, because summaries of summaries increased hallucinations. That reinforced a useful rule for me: prose is for humans; structured evidence is for agents.  

If something was not in the layer, the model was not allowed to invent it. That boundary created a deterministic step between retrieval and reasoning and kept the model from blending partial matches, local naming quirks, and implied context into one confident but unreliable answer. 

When Does a Knowledge Layer Make the Biggest Difference?  

The distinction mattered most with broad versus specific questions. A broad query sounds like “show me domains related to customer data” or “what governance assets do we have for privacy?” That is where the knowledge layer earns its keep, because the agent has to break intent into the correct retrieval steps and then reassemble verified results into an answer that still reflects what the user meant. 

If a user asks, “What does our governance coverage look like for customer data?”, I do not want the agent to treat that as one search. I want it to identify whether there is a customer-related Domain, retrieve the Business Terms associated with it, retrieve any related Policies, and then summarize only the verified entities returned from those steps. That is the role of the knowledge layer: gather evidence in structured form first, reason over it second, and generate a narrative answer last. 

Engineering Trustworthy AI: Lessons Beyond the Product 

I hope the process and patterns I outlined here are useful beyond my own implementation. I would genuinely love to hear how others are approaching this, because getting something deterministic out of AI systems is a challenge many of us are now working through.  

The shape may differ depending on your platform, data, or users, but the underlying problem feels familiar: how do you build something flexible enough to be useful without letting it drift away from what is actually true? 

There is constant talk about AI replacing developers, but I do not think the work disappears. Rather, the problems just look different now. Developers have always had to account for odd technology behavior, hidden limitations, and systems that do not quite do what they promise. AI is just less predictable in most cases.  

Engineers have always been problem solvers, and now AI is simply part of both the problem space and the solution space. I still find myself just as engaged in the work, iterating and learning as I go. Working with MCP servers has been one of the most energizing parts of that journey. 

 
Frequently Asked Questions 

What is a knowledge layer in the context of AI agents? 
A knowledge layer is an intermediate, normalized data structure positioned between data retrieval and AI reasoning. It stores verified results in structured form (asset IDs, types, names, trusted relationships) and prevents agents from fabricating answers by enforcing a boundary: if data isn’t in the layer, the agent cannot invent it. 

Why do AI agents hallucinate even when connected to accurate APIs? 
Connecting an agent to an API provides access to data, but not understanding of how that data relates or flows. Agents can misinterpret search results, choose less precise API actions, and blend partial matches into confident but false conclusions. A knowledge layer filters weak matches and normalizes results before reasoning begins. 

Can a knowledge layer work across different data sources or platforms? 
Yes. The knowledge layer needs to support both universal vocabulary (standardized across a platform) and local translations (custom types specific to each instance). This dual-layer approach lets you normalize results from multiple sources while preserving instance-specific nuance. 

What’s the difference between validation (like Zod) and a knowledge layer? 
Type validators ensure data is the right shape, but a hallucinated string is still valid JSON. A knowledge layer goes further: it ensures the agent is reasoning only over data that actually exists and was actually retrieved, not invented or inferred. 

How do you prevent “summaries of summaries” from increasing hallucinations? 
Keep the knowledge layer stable and atomic. Once data enters the layer, the model should work from that verified set without regenerating or re-summarizing intermediate steps. More derivations = more opportunities for drift from the original truth. 

Is this approach specific to the Data Integrity Suite, or can it apply to other AI systems? 
The pattern is generic. Any system where you want AI to reason reliably over real data can benefit from this approach: normalize and structure retrieval results first, then hand structured evidence to the reasoning step. The shape changes based on your data, but the principle is universal. 

Read More from the Precisely Blog

View All Blog Posts

AI image
Engineering

From Skepticism to Momentum: How AI Is Transforming our Approach to Software Development

Top Reasons to Choose Precisely for Hybrid Cloud Integration
Engineering

OpenLineage Integration: Bridging Open Standards with the Precisely Data Integrity Suite

AI Agents for Platform Engineering:
Engineering

AI Agents for Platform Engineering

Let’s talk

Integrate, improve, govern, and contextualize your data with one powerful solution.

Get in touch