
This blog is written by AI for SEO
How to Give AI Agents Context About Your Business
To give AI agents context about your business, give them a connected model of your customers, orders, contracts and the links between them, built from the systems where that data already lives, with every value traceable to the row or document it came from. A longer system prompt will not do it. A prompt tells an agent how to behave; it cannot tell the agent that the "Acme Corp" in Stripe, the "ACME Corporation" in Postgres and the "Acme" in last week's call notes are one customer.
Most advice stops at pasting instructions into a prompt or adding a semantic layer for metrics. Both help, and neither answers the question an agent gets asked most: how do these things relate? This guide covers the four layers of business context, how to build the connected layer by hand, how Helix Foundry builds it from your sources, and where a simpler approach is enough.
The short answer: give agents a model of the business, not a bigger prompt
Agents fail on company questions for one reason: the facts they need are split across systems and nothing says which records refer to the same thing. Billing holds invoices, the product database holds accounts, the CRM holds deals, and contracts sit in PDFs. A bigger prompt cannot hold that, and it goes stale the day after you write it.
The fix is a model: a set of entity types (customer, order, contract, vendor), the links between them, and a record of which source each value came from. Agents query that model instead of guessing from fragments. When the agent says "Acme renews in March and has two open invoices," you can click through to the contract clause and the two Stripe rows.
This is the position of this guide: context for agents is a data modelling job, not a prompt writing job. Prompts still matter, but they sit on top of the model.
Four layers of business context (instructions, documents, metrics, entities and links)
Business context for an agent comes in four layers, and most teams stop after the second or third.
1. Instructions. Role, tone, rules of engagement, what the agent may and may not do. A system prompt or a project file covers this. It is cheap and necessary, and it holds no facts about your company that change.
2. Documents. Policies, contracts, wikis and call notes, usually made searchable with retrieval (RAG). Good for "what does our refund policy say?" Weak for "which customers are affected by this clause?", because retrieved chunks do not know which customer they belong to.
3. Metrics. Governed definitions of revenue, churn or active user, usually in a semantic layer, so the agent computes numbers the same way your analysts do. Data-platform guides such as Bruin's list metric definitions, documented tables, lineage and retrieval as the pieces an agent needs, and Amplitude makes the same case for a semantic layer as the translator between raw data and business meaning. A semantic layer answers "how do we compute X?" It does not say which customer record in system A is the customer record in system B.
4. Entities and links. The customers, orders, contracts and people your business runs on, matched across sources and connected to each other. This is the layer that lets an agent follow a customer from a deal to an invoice to a contract to a support thread.
Layer four is where cross-system questions get answered, and it is the one most guides skip. If you want the longer argument for why a semantic layer is a different thing from this, see Ontology vs Semantic Layer: The Difference for AI Agents, and for retrieval specifically, RAG vs Ontology: Which Your AI Agents Actually Need.
Build the model by hand: entities, links and matching the same customer across sources
You can build the connected layer yourself with any database. The work has three parts, and the third is the hard one.
Pick entity types from questions, not tables. Write down five questions your team asks that cross systems: "Which customers on the Enterprise plan have an unpaid invoice?" "Which contracts auto-renew in the next 60 days?" Each noun in those questions is an entity type: Customer, Plan, Invoice, Contract. Start with the five to eight nouns that recur, not every table you own.
Define links as named relationships. Customer has Invoices. Customer is bound by Contract. Contract covers Product. A link needs a direction, a name and a rule for when it holds. Without a name, you have a join; with one, an agent can read the relationship and traverse it.
Match the same entity across sources. This is where hand-built models break. Stripe knows a customer by email and customer ID. Postgres knows an account by UUID. Call notes know a person by first name and company. You need a matching rule per entity type: exact match on a shared key where one exists, normalised match on email domain or company name where it does not, and a review queue for the uncertain pairs. Never merge on a fuzzy match silently. A wrong merge corrupts every answer downstream, and nobody notices.
A worked example: take Stripe customers and Postgres accounts. Match on email first. For rows with no email match, compare normalised company names and domains, and send anything below your confidence threshold to a person. Record, on every matched pair, which rule fired. We walk through this exact case in Link the Same Customer Across Stripe, Postgres and Notion.
Keep the source on every value. Store the system, table and row ID (or document and quote) next to each property. Provenance is cheap to record at load time and impossible to reconstruct later.
Give agents context with Helix Foundry: clone and run, or Helix Cloud, connect sources, generate the ontology, ask, connect your agent
Helix Foundry does the build above for you. It connects your databases, tools and documents, has an ontology agent draft one ontology over them, and loads it into HelixDB as one connected graph you can explore and ask questions of, with every value traced to the row or document quote it came from. Foundry is the app; HelixDB is the database it loads into. Foundry is open source under Apache 2.0.
1. Run it. Two options. Locally with Docker Compose v2 (ports 3000 and 8333 free, 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, with no sign-in, so do not expose it to a network. Or use Helix Cloud at foundry.helix-db.com and choose Set up with your agent.
2. Connect sources. Foundry lists connectors for PostgreSQL, MySQL, Amazon S3, Stripe, Granola and Attio, plus documents. Add a source, test it and sync its tables. Foundry never writes to your sources. There are no Salesforce or HubSpot connectors, so plan around the sources above.
3. Generate the ontology. Foundry's agent drafts types, links and mappings from your synced tables and documents. You review the draft, adjust it and accept it. Read the draft the way you would read a colleague's data model: are these the nouns your questions use? A generation sends your synced tables, and up to five of the newest documents of each set it picks, to Foundry's agent, so choose sources with that in mind.
4. Ask. Ask Founder questions in plain language, such as "Which customers have a Stripe subscription but no active contract?" Answers come from the graph, and each value links back to its source row or document quote. Keep the answers you reuse as dashboards your team can open.
5. Connect your agent. Foundry exposes the ontology through the Helix MCP, so Claude Code, Codex or another MCP-capable agent can query the same graph your team does. For a full example on real tools, see Build a Customer Ontology From Attio, Granola and Stripe, and for a version where Claude does the setup, Let Claude Set Up Your Company's Knowledge Graph.
If you already hold the ground truth in Postgres, start there: Map Postgres Tables to an Ontology for AI Agents shows the mapping step in detail.
Keep the context right: provenance, review, and updating as data changes
A model that was right in March and wrong in June is worse than none, because agents trust it. Three habits keep it right.
Provenance on every value. Every fact in Foundry's ontology is grounded in a source row or a document quote. That is what makes an agent's answer checkable: the reviewer opens the claim, sees the Stripe row or the contract passage, and decides. It also makes access control tractable. Foundry authenticates access to sources and to the ontology, and because each fact is grounded in a source, a user who cannot see a source cannot see anything in the ontology grounded by it. Details in Ontology Access Control: Who Sees What Your Agents Know and Directory Sync for an AI Ontology.
Human review for anything uncertain. Code should measure, a model should propose, and a person should approve what is ambiguous. In practice: ambiguous entity matches and new rules get reviewed, not auto-applied. Ask of any tool you evaluate, including ours: what happens to a match it is unsure about?
Update as data and workloads change. New columns appear, a billing tool is replaced, a new contract type shows up. A hand-built model rots here, because nobody owns the remapping. Foundry handles the upkeep: it keeps links correct as data drifts and updates the schema and graph as your data and workload change. See Self-Healing Ontology: Keeping Links Right as Data Drifts and How to Update an Ontology When Your Data Changes. Re-run your five cross-system questions after any big change. If the answers shift, find out why before an agent finds out for you.
Trade-offs: when a prompt or RAG is enough, and what Foundry does not do
Not every agent needs a connected model. Use this to decide.
| Your situation | What is enough |
|---|---|
| One agent, one data source, questions about that source only | A prompt plus the source's own schema |
| Questions answered by reading documents (policies, runbooks, FAQs) | RAG over those documents |
| Agents compute KPIs and must agree with your analysts | A semantic layer for metrics |
| Questions cross systems: customer to invoice to contract to conversation | A connected model of entities and links |
If the first three rows describe you, do not build an ontology. Write a good prompt, index your documents and define your metrics. You will get most of the value for a fraction of the work.
The fourth row is where agents get confidently wrong: they find a contract chunk and an invoice row and have no way to know they belong to the same customer. That is when you need the entity and link layer.
What Foundry does not do: it never writes to your sources, so it is not a tool for changing data in your systems. The self-hosted install is single-user on localhost with no sign-in, so it suits trying things out, not serving a team over a network. Foundry's enterprise options (running locally, bring your own cloud, self-hosted models) are covered in the posts above, and if you must keep inference on your own hardware, see Build an Ontology With a Local LLM. And it only connects the sources it lists; if your key system is not among them, you will need to get its data into Postgres, S3 or an API source first.
FAQ
See the questions below.
Start with five cross-system questions and one real ontology
Agents are only as good as the connections they can follow. Write down five questions that cross your systems, run Foundry locally with git clone https://github.com/helixdb/helix-foundry.git, cd helix-foundry and docker compose up -d --wait, connect two sources that hold the same customers, and see whether the drafted ontology answers them with sources attached. Then point Claude Code or Codex at it through the Helix MCP. Star the repo at github.com/helixdb/helix-foundry if it earns it.