Knowledge Engineering Redux

We could use a semantic layer for our Snowflake database, and maybe a context layer for some AI agents. There are three different disciplines all chasing roughly the same goal, which is to provide AI with background knowledge about the business. Today, I will provide a brief survey of the field, so you can decide which one(s) you need.

  1. Semantic layers
  2. Context engineering
  3. Ontologies and graphs

Semantic Layer

Snowflake calls them semantic views. A complete set of semantic views makes up a semantic layer. The word “semantic,” of course, means that the layer contains meaning instead of mere syntax. Syntax is what a data element looks like in the schema. Semantics is what it means. As a Linguistics grad, I still have my textbook on (natural language) Syntax and Semantics.

CREATE OR REPLACE SEMANTIC VIEW sales_rev_analysis 
TABLES (
  orders AS source.orders,
  customers AS source.customers
) 
RELATIONSHIPS (
  o_to_c AS orders (cust_id) REFERENCES customers (id)
) 
FACTS (
  orders.total_price AS amount
) 
DIMENSIONS (
  customers.region,
  orders.order_date
) 
METRICS (
  total_revenue AS SUM(amount)
);

It’s reasonable to call this a “layer,” in the architectural sense, because it sits between the AI model and the database. Extending SQL DDL to include AI artifacts reminds me a lot of Google’s BQML. Note how the Snowflake example enforces Kimball’s modeling style.

Apart from Snowflake, any database-linked metadata, like E-R diagrams, catalogs, and data dictionaries can serve as a semantic layer – as long as they’re accessible to the AI model. If you’re a Sigma-heavy Snowflake shop like ours, Sigma will consume your Snowflake definitions automatically.

If you prefer your semantics as YAML code, dbt does that. Everybody in the analytics space has their own approach to semantic data, leading to the Open Semantic Interchange, which is meant to be the lingua franca among them.

Context Engineering

To understand the importance of context engineering, you need to understand how context works. An LLM doesn’t keep mental track of the conversation the way you and I do. Each turn of the dialogue must feed the entire context window through the LLM again. The longer the context, the less likely the model’s response will be on point.

Running a company is just context engineering internally – Shopify CEO Tobi Lutke

As Andrej Karpathy explains here, this has led to a “thick layer of non-trivial software” to maintain succinct context. You want to spawn a new agent, for instance, with only the context for a specific task – undiluted by the broader context – and you might even wish to arm it with specific skills.

Skills allow AI agents to maintain succinct context by progressively pulling in text (as markdown and YAML) only as needed for the task at hand. This is also a great way to provide business knowledge. Don’t let the simplicity fool you – give your context files the same governance and security that you would any sensitive code.

The Karpathy post is part of a dialogue, including Shopify CEO Tobi Lutke, on the importance of documenting business context. Fortunately, markdown is readable by humans, too. Am I the first cynic to note that we never got this kind of documentation until AI came along?

Knowledge Ontology

Jessica Talisman makes the case for formal representation of knowledge using tools like OWL and RDF. This is about specifying knowledge in the abstract, which will be familiar to designers of OO class models. Her examples are large bodies of knowledge, abstract in the sense that they transcend an individual business.

This is probably overkill for my Snowflake use case, but I can see where it would be useful for, say, Palantir. It’s too bad the term “knowledge engineering” has been co-opted because, of the three disciplines, this one seems the most technical – and they had it first.

Palantir Ontology

Ontology is also a “layer” at Palantir, analogous to the application layer in a software stack. Palantir CEO Alex Karp says that the client’s value-added knowledge belongs in an explicit ontology layer instead of handing it off to an AI model controlled by a third party.

Karp argues that if you hand your business data and context to an AI vendor, you risk transferring your company’s “alpha” to a third party. Palantir’s solution is to confine this knowledge in the ontology layer, where it can be executed using any model.

The alternative to this approach is “sovereign” AI, which means that the model is private, either to the vendor, or to the business itself. This doesn’t mean that you have to become a frontier AI lab. It just means that you acquire the initial weights and then train it for your application.

Conclusion

My knock on ontology is that it strikes me as terribly effortful. It seems that every time we try to “help” AI, with prompts and orchestrators and harnesses, AI turns around and renders our help obsolete.

I remember researcher Douglas Lenat trying to code all background knowledge, like “if an item is in a box, and the box is in a room, then the item is also in the room.” Sound ontological? Lenat wasn’t wrong. There was no better alternative, circa 1985, but then the technology improved.

Snowflake’s Semantic View Autopilot (SVA) is another example. Instead of reading your painstakingly crafted semantic views, Snowflake’s AI can discover them by watching your usage patterns. I can, equally, imagine an LLM producing an ontology on its own.

Talisman may be right that ontology is a grand, scientific enterprise, and analytics is small beer. Karp is betting his company on it. Me, I just want to make sure everyone in my shop has the same definition of “back-end gross.”

Switching to Linux

I recently switched from Windows to Linux. It was time for a new laptop anyway, and I just couldn’t handle the Windows crap any longer. It started when my favorite AI libraries stopped being supported on Windows, and I found myself using the Linux Subsystem (WSL) more and more.

In this article, I’ll motivate the switch to Linux, and give you some pointers from my recent experience. You can make the switch, too. It’s not as hard as you may think.

What 365 means is: you pay Microsoft every day of the year.

Most of you will recognize what I mean by Windows crap. It conveniently forgets that I own paid licenses, and tries to jam me into the “365” program. Apps I’ve already paid for suddenly stop working, and then I lose time fixing them.  What 365 means is: you pay Microsoft every day of the year.

Then, it’s always trying to badger me into using Copilot which, by the way, is spyware. After updating my registry to turn off Copilot for good, I was not looking forward to the next release, with integrated “kernel level” spyware. If you want a privacy horror story, check out Microsoft Recall.

The Linux ThinkPad

I’ve used ThinkPads forever, like, since they were IBM. I was tempted to buy a Mac but, for this exercise, I wanted to have familiar hardware and change only the operating system. Lenovo sold me the accustomed T16 preloaded with Ubuntu Linux, which probably saved about $100.

One fun thing I learned is that hardware manufacturers feel the pain from Windows, not only because the license takes a big slice of their gross, but because they end up fielding the support calls! Here is Dell opting out, and here is HP.

You can set up Linux to look and feel exactly like Windows, if you wish, using distros like Zorin and Mint. It’s a testament to Ubuntu’s flexibility that people are running around creating distros that emulate other operating systems – MacOS, too.

My Ubuntu Stack

What I wanted, though, was the most vanilla, mainstream Linux experience I could get – and still be compatible with my Microsoft-oriented day job. That’s Ubuntu Linux with Gnome. Here are the apps:

  • VS Code – Obviously. I miss Notepad++ but, if you live in VS Code anyway, you can use it as a general-purpose file editor.
  • Kate – This is my one concession, so far, to the KDE ecosystem. I installed it mainly to handle markdown files. I also use the default Gnome text editor.
  • Only Office – This is for compatibility with MS-Office files. Libre Office is also popular. I can also run the MS 365 web versions (on my employer’s tenant) in Chrome.
  • Chrome – Again, for Microsoft compatibility. I run Outlook and Teams in Chrome – as Progressive Web Apps (PWA) to be exact, so they launch from my dock just like they do on Windows.
  • Firefox – This is my default browser, not Chrome – for privacy purposes. Did I mention privacy? I’m only running Chrome for the work stuff.
  • Thunderbird – I remember running Thunderbird email twenty years ago, and it still looks the same. Battle tested. This for my Virag Consulting mail. My work mail stays in Chrome.
  • Nemo – I replaced the default Gnome file manager with Nemo because I prefer its tree view. Much like File Explorer on Windows.
  • Network Share – Linux can access files on my Windows computer using the SMB protocol. This is the mount command in bash, but it’s much easier just to connect with Nemo.
  • Syncthing – I like to keep an offline copy of my network share on the laptop. It’s rare these days to be without an internet connection, but you never know.
  • Clipboard Indicator – This is Win-V on Windows, one of those little things you don’t notice until you don’t have it.
  • Flameshot – You’ll need a replacement for Snagit. There are a bunch. I chose Flameshot.
  • Slack – No surprise, Slack runs on Linux. Download the DEB version. Ubuntu is Debian-based, and you’ll be installing with APT.

That’s pretty much everything I need to work, travel, and code both personal and job-related. The Interactive Brokers trading app is a little rough, but they’re trying. At least they have a Linux app, and you can always trade on a web site – or your phone.

Claude, help me remap the Copilot key

I run four “workspaces,” which roughly match the four monitors I have at home. Teams and Outlook sit at the end, and I just Super-4 over there when I want to check my work messages. This is an old Linux feature that Windows recently caught up with.

Not only is TensorFlow happier on Linux, but so is Claude Code. It was always weird running Claude in a WSL window, with program files and test data in Windows. And, you don’t need to be coding! You can just start Claude in a terminal window and ask, “Claude, help me remap the Copilot key.”

Online Training

I have used Linux off and on over the years, but I needed a refresher, so I took Coursera’s online class, The Software Developer’s Guide to Linux. This lived up to the name. It was spot-on what I needed – Linux topics tailored for a developer, with enough of the sysadmin stuff to keep me out of trouble. I love being able to get just-in-time training for whatever my current project is.

I find that my usage style has changed with Linux. With Windows, I would faithfully shut down the laptop between sessions, and I’d be careful always to have power. Linux doesn’t seem to use much power, so I mostly just close the lid and let it suspend. I do a restart about once a week, for good measure.

The whole user experience, once you get used to it, just seems less brittle. If you’ve been fatigued with the Windows crap, as I was, hopefully this article encourages you to give Linux a try.

Saaspocalypse Now

For my sins, I have joined the “AI not kill SaaS” debate. I am motivating this with the Salesforce stock chart, which went off 30% in the recent “Saaspocalypse.” Charts for Thomson Reuters, Service Now, and Atlassian look about the same.

By 2030, more than 60 percent of software economics could flow through agentic systems rather than legacy SaaS seats.

So, why are people debating an accomplished fact? Because of a faulty thesis. This thesis (which I have actually read, not naming names) is that someone can vibe code a new Salesforce. This is a strawman. That’s not the thesis that wiped out $300 billion of market cap.

Someone probably could vibe code a new Salesforce app, but – that’s obviously not the same as killing Salesforce, the company, nor SaaS in general.

The thesis, according to Satya Nadella, is that business logic will come to reside in AI agents, leaving SaaS systems as mere databases. According to Goldman Sachs, by 2030, more than 60 percent of software usage could flow through agentic systems rather than legacy SaaS seats.

The fact that a single, well-prompted AI agent can now do the job of five or ten “seats” does not bode well for the old framework.

The more recent stock tankage in February – that 16% gap down in Thomson Reuters – is attributable to Claude Cowork, coupled with that day’s release of a prompt that does legal contract review. Yes, one single prompt. Again, it’s not feature coding – it’s the pricing model.

Consider Salesforce, for example. Each literal headset-wearing agent needs a “seat license.” With Claude Cowork, no human agent would ever interact directly with Salesforce. Robots talk to Salesforce, with 10X efficiency, and only escalate to humans when they have to.

As Phil Rosen puts it, “the fact that a single, well-prompted AI agent can now do the job of five or ten seats does not bode well for the old framework.”

None of this says that SaaS is dead, exactly. What it says is that SaaS vendors need to reinvent themselves – something legacy “growth to value” companies have historically failed to do.

Choose the Right AI Tool

The AI landscape has changed a bit since I wrote What Is Real AI? back in 2021. The advent of GenAI has enabled a new wave of dubious AI sales pitches. Here’s one that crossed my desk recently:

We’ve identified some key GenAI opportunities at PermaPlate … forecast revenue and claims across [products] and adjust staffing monthly.

This sounds like a good idea, except – it’s not a GenAI application. It’s a standard forecasting exercise that everybody does already. If I did want to switch to a learning model – even a deep neural net, which is architecturally similar to an LLM – it would still not be GenAI.

The thing to remember is that GenAI “generates” things, like blog posts and deepfakes. My favorite learning models, going back to AI-Based Risk Rating, are all quantitative in nature. Here again, there are plenty of good statistical methods. Even if you prefer to use a learning model, you may not choose a neural net.

Neural nets have a problem with explainability. They’re basically a black box. That’s why credit bureaus, which must be able to explain their ratings, use a two-step approach. They use AI for exploration and feature engineering, but then they put the features into a more-transparent logistic regression model.

I might consider GenAI in a forecasting application, to deal with unstructured data. On the other hand, I would ask why the data is unstructured. We did this exercise as a POC here at PermaPlate. I wrote a little program that would read a service contract, and then answer natural-language queries.

Which coverage did the customer select and does it include roadside assistance?

It was a cool demo, but – if you want coverage details available for automation, it makes a lot more sense to store them in machine-readable form, at origination time. And what kind of automation might that be? Well, it might be “agentic.”

Agentic AI means that the AI has “agency,” in the sense that it can make decisions and do things in the world. Cool, huh? We give AI agency by equipping it with tools, in the form of software APIs.

Imagine asking ChatGPT to organize your next trip. It can’t, because it’s trapped inside your web browser. But if you invoke ChatGPT as part of an agentic workflow, with interfaces to the airlines and hotels, it can actually book the trip.

Agentic workflows often divide the work among tool-using LLMs, with a mastermind LLM directing the others. For systems that don’t have APIs, the agent can use Robotic Process Automation to operate the system’s user interface – just like you would at the keyboard. It’s not surprising that UIPath, one of the leading RPA vendors, has moved into Agentic AI.

Here is a short list of the latest AI techniques:

  • Large Language Model (LLM) – Like Grok and ChatGPT, these are AI models that can read and write (and plan, and execute).
  • Generative AI – Broad class of AI models that can create things, including LLMs but also diffusion models for video and other media.
  • Deep Neural Net (DNN) – Core technology behind GenAI, and many other learning models, as in my earlier article.
  • Retrieval Augmented Generation (RAG) – As the name implies, GenAI “augmented” by the ability to find and read your documents. See Unguided RAG for Text Comparison.
  • Robotic Process Automation (RPA) – Not AI, but frequently used by Agentic AI. As I wrote in Applied AI for Auto Finance, you can derive a lot of efficiency from RPA alone.
  • Agentic AI – AI agents that can make decisions and act autonomously.

Now that you know the lingo, you can choose the right tool for the job – or your AI sales pitch. I, for one, will not be using GenAI to predict claims volume … but I may use Agentic AI to dispatch the technicians.