
This blog is written by AI for SEO
Helix Foundry vs Cube: AI Context Layer or Ontology?
An AI context layer is the set of governed, traceable information an AI agent reads before it answers a question about your company: definitions, relationships, rules and sources. Two very different jobs hide in that phrase, and Cube and Helix Foundry each take one of them seriously. Cube gives agents governed metrics over warehouse SQL. Helix Foundry connects app data and documents into one entity graph in HelixDB, with every value traced to the row or document quote it came from.
If you are asking how to build a context layer for AI, the honest answer starts with deciding which job you have. This post defines the term plainly, walks through what each product does, and ends with a rule for choosing, or for running both.
What an AI context layer is, and the two jobs hiding in the phrase
An AI context layer sits between your agents and your company's data and tells them what things mean and where answers come from. Without it, an agent guesses what "active customer" means, joins tables on whatever column looks right, and cannot tell you where a number came from.
Building a context layer for AI comes down to four steps, whatever tool you use. First, list the questions agents must answer correctly. Second, decide whether those questions are about numbers (revenue, churn, orders per week) or about things (this customer, this contract, this vendor and how they relate). Third, define the vocabulary once: metrics, entities, links and the rules between them. Fourth, make every answer traceable to a source, so a person can check it.
Step two is where the phrase splits into two jobs. The first is governed analytics: one definition of each metric, one set of join paths, one set of access rules, applied to every consumer. The second is entity context: the same customer appearing in Stripe, a CRM and a signed contract, resolved into one node with the facts from each source attached and attributed. Table-shaped questions need the first. Cross-system, document-shaped questions need the second.
What Cube does: a semantic layer for governed metrics over warehouse SQL
Cube is an agentic analytics platform built on a semantic layer. Its docs say Cube's AI agents don't query the warehouse directly. They go through Semantic SQL, with queries validated against the data model and joins governed by relationships defined in the model.
The semantic layer rests on four pillars: data modeling, access control, caching and APIs. Everything, including data models and access policies, is managed as code. The data model is the knowledge graph that the platform and any AI agent use to understand your business. Access control runs at the semantic layer, so the same policies apply to AI agents, BI tools and embedded applications. Caching uses pre-aggregations, rollup tables declared in the model and refreshed in the background. Standard APIs let any consumer plug in.
Cube describes its broader AI context layer as the governed semantic layer plus business vocabulary, modeling guidance and lineage, with documents and tickets from other tools retrieved at query time through connectors. The semantic layer still does the executable work. Documents help agents interpret questions and explain results.
That is a real win, and a mature one. If your agent's job is to answer "what was net revenue by region last quarter" the same way your BI dashboard does, a governed semantic layer over warehouse SQL is the right foundation.
What Helix Foundry does: one ontology over app data and documents, with provenance
Helix Foundry turns the tools your company runs on into one connected graph. HelixDB is the open-source graph-vector database underneath. Foundry is the app that connects your sources, drafts the model and loads it there.
The flow has five parts. Connectors read from your application databases, SaaS tools and documents. An ontology agent then drafts types, links, rules and their sources from your synced tables and documents. You review the draft and make a version current. The ontology loads into HelixDB with the origin of every value kept: the row, or the quote in the document. Values the documents disagree on wait for your review instead of being silently picked.
You then use it two ways. You can browse the graph. You can answer plain-language questions with a source for every claim. You choose which AI model Foundry uses. Foundry never writes to your sources, and it is Apache-2.0, so you can run it locally with Docker Compose or on Helix Cloud.
The result isn't a metric catalog. It's one node per real-world thing, with the evidence for each fact attached.
Where they differ: metrics over tables vs entities across systems and documents
Cube models measures and dimensions over warehouse tables. Foundry models entities and links across systems and documents. That is the whole difference, and it decides which one answers your question.
| Question | Cube | Helix Foundry |
|---|---|---|
| Primary unit | Governed metric over warehouse SQL | Entity in a graph (customer, contract, vendor) |
| Source of truth | Warehouse tables | App databases, SaaS tools and documents |
| Documents | Retrieved at query time through connectors | Drafted into the graph, values quoted back to the passage |
| Where answers come from | Semantic model and SQL | A row or a document quote on every value |
| Conflicting values | Resolved by the model's definitions | Held for human review |
| Access control | At the semantic layer for every consumer | Follows access to each source |
| Run it | Cube's platform | docker compose locally, or Helix Cloud |
Take a concrete question: "Which customers on the enterprise plan have a contract renewal clause that conflicts with what billing shows?" The plan is in Stripe, the clause is in a PDF, and the customer name differs between them. A metric layer cannot answer it, because the answer is not a number over a table. An entity graph can, because the customer is one node with facts from both sources and the disagreement is flagged.
Flip it: "What was MRR by cohort in Q3?" That is a governed aggregate over warehouse data, and a graph is the wrong place to compute it.
Try Helix Foundry: docker compose locally or Set up with your agent on Helix Cloud
You can have Foundry running in a few minutes. Locally you need Docker with Compose v2, ports 3000 and 8333 free, and room for a few GB of images on first start:
git clone https://github.com/helixdb/helix-foundry.git
cd helix-foundry
docker compose up -d --waitThen open http://localhost:3000. The local install is for one person on their own computer, single-user on localhost with no sign-in, so do not expose it to a network.
On Helix Cloud, go to foundry.helix-db.com and choose Set up with your agent to connect an agent through the Helix MCP.
From there, follow the quickstart: sign in, connect a source, test it, sync its tables, generate an ontology, then ask a first question and explore the graph. There is also a sample company if you want to see every step on made-up data first. For how the ontology agent behaves when your sources change, see how to update an ontology when your data changes.
Honest trade-offs: where Cube wins, where Foundry is the wrong tool
Cube wins on governed metrics, and it is not close. Its semantic layer is built for exactly that: data modeling as code, access policies applied once to every consumer, pre-aggregations for speed, and standard APIs for BI tools and embedded apps. If your agents mostly need consistent numbers from a warehouse, Foundry is the wrong tool. It does not replace a metrics layer, and you should not try to compute dashboards from a graph.
Foundry is also the wrong tool when your data is already clean, lives in one system, and your questions are aggregates. An ontology adds a step you do not need.
Cube's limits mirror this. Its semantic layer is built around warehouse tables, and documents arrive through query-time retrieval rather than being drafted into the model. Cube's docs show no entity graph that holds a document quote against each value. If you need the contract clause and the billing record resolved into one customer with sources, that is the gap Foundry fills.
On the Foundry side, expect to review. The agent drafts, and values the documents disagree on wait for you. That is by design, because a wrong link written confidently is worse than a flagged one. It also means a person approves each version.
Can you use both? How to choose
Yes, and for many companies both is the right answer, because the two jobs rarely overlap.
Use this rule. If the question is "how much, how many, how fast" over warehouse data, you need a semantic layer, and Cube is a mature choice. If the question is "who, which, and what do our records say" across Stripe, your CRM, your tickets and your contracts, you need an ontology, and that is Foundry. If agents ask both kinds, put metrics behind the semantic layer and entities behind the ontology, and let the agent pick the right tool per question.
A quick test: take the five questions your agents get wrong most often. If four of them are about numbers, start with Cube. If four of them need facts joined across tools or pulled out of documents, start with Foundry. The same entity question that breaks a metric layer is where an ontology differs from a plain knowledge graph. If you are unsure whether you need one at all, see five signs your data needs an ontology.
Pick the layer that matches your five worst agent answers
An AI context layer is not one product category. Metrics over warehouse tables and entities across systems and documents are different jobs, and the cheapest way to choose is to look at where your agents are wrong today. If the failures are numbers, a semantic layer fixes them. If they are customers, contracts and vendors that disagree across tools, you need one graph with a source on every value. Clone the repo, run docker compose up -d --wait, connect one database and one folder of documents, and ask the question your agents keep getting wrong. Star HelixDB on GitHub if it earns it.