Back to blog
What Is Context Engineering? Business Context for AI Agents

This blog is written by AI for SEO

What Is Context Engineering? Business Context for AI Agents

HelixDB9 min read

Context engineering is the practice of deciding what information goes into an AI model's context window, and when: the instructions, tools, memory and retrieved data the model sees before it answers. It is what separates an agent that demos well from one that works on your actual company data.

Most writing on the topic covers the mechanics: token budgets, retrieval, memory, tool schemas. All of that matters. But if you wire an agent to Stripe, Postgres and a CRM, the part that breaks first is none of those. It is meaning. The agent does not know what "customer" means in your business, which of three records is the same person, or which approvals are required before an order ships. This post defines context engineering, separates it from prompt engineering, and argues that business context is the layer worth the most effort.

What context engineering is: what goes into the context window

Context engineering is designing the full set of inputs a model receives at each step, not just the question the user typed. The context window is the model's working space. Whatever is not in it, the model cannot use.

The building blocks are well documented. In practice they are:

  • Instructions: the system prompt that sets identity, constraints and behaviour.

  • Tools: functions the agent can call to query a database, hit an API or run code.

  • Short-term memory: the history and state of the current session.

  • Long-term memory: facts kept across sessions.

  • Retrieved information: documents or rows fetched just in time, usually through RAG (retrieval-augmented generation) or hybrid search.

  • Structured output: the format the answer has to take, such as JSON.

The window is finite, so the job is selection. Too little and the agent guesses. Too much and the relevant fact drowns. Good context engineering returns "3 relevant transactions totalling $4,532" rather than a raw 10,000-row SQL result.

Where did the term context engineering come from?

Context engineering became a common name for this work as teams moved from single prompts to agents that call tools, keep memory and pull in company data, a shift that picked up through 2024 and 2025. The idea is older than the label: deciding what an AI model sees before it answers. What changed is the scope. It now covers instructions, tool definitions, memory and retrieved data together, rather than the wording of one prompt.

Context engineering vs prompt engineering

Prompt engineering is about how you phrase an instruction; context engineering is about everything the model has in front of it when it reads that instruction. Prompt engineering is one input to the system. Context engineering is the system.

A well-worded prompt cannot rescue a model that was handed the wrong records. If the agent retrieves last year's contract instead of the current one, no amount of "think step by step" fixes it. The failure sits upstream, in what was selected, how it was structured and whether it was true.

A useful test: if the same prompt gives different answers on different days because the underlying data changed, you have a context problem, not a prompt problem.

The hardest context to engineer is business context

The hardest context to engineer is business context: what your company means by its own words, and the rules that connect them. Retrieval pipelines, chunking and reranking are largely solved engineering. Meaning is not, because it lives nowhere in one place.

Three problems show up every time you point an agent at real company data.

Definitions. What is a customer? In Stripe it is a customer object. In your CRM it is an account. In your product database it is a workspace. In a sales call transcript it is whoever was on the call. An order may be "approved" when finance signs off, or when the warehouse releases it. The agent cannot infer your definition from column names.

The same entity under different names. Acme Corp in billing, ACME Inc. in the CRM and acme.com in your product logs are one customer. Without links between them, the agent sees three unrelated records and answers about one of them confidently.

Rules between entities. An order above a threshold needs an approval. A refund cannot exceed the invoice. These rules usually live in a few people's heads and a stale wiki page. An agent that does not have them will take actions that look plausible and break policy.

Vector search over chunks does not solve this. It returns text that sounds relevant, not facts that are connected and correct. We cover the contrast in RAG vs Ontology: Which Your AI Agents Actually Need, and the broader idea in What Is a Context Graph? How AI Agents Use One.

How to engineer business context with an ontology (works with any tool)

An ontology is an explicit model of the things your business cares about, how they are named in each system, and the rules between them. Building one is the most reliable way to give an agent business context, and the method is the same whichever tool you use.

  1. List the entities. Customer, order, invoice, approval, contract. Keep it to the ten or so your agents will actually ask about.

  2. Define each in one sentence. Write down what counts as a customer, and what "approved" means. If two teams disagree, that disagreement is the finding.

  3. Map each source to the entities. Which Stripe object, CRM record or table row is a customer? Which column holds the identifier?

  4. Link the same entity across sources. Decide the matching keys (email, domain, external ID) and what to do when they conflict. Do not silently merge on a fuzzy name match.

  5. Write the rules down. State them as constraints a system can check, not prose.

  6. Keep provenance. Every fact should point back to the row or document it came from, so a wrong answer can be traced and fixed.

The last step is the one most DIY efforts skip, and it is what makes the context trustworthy. For a walkthrough aimed at agents, see How to Give AI Agents Context About Your Business.

Context engineering with Helix Foundry: connect, draft an ontology, serve it over the Helix MCP

Helix Foundry does the six steps above from your existing sources: you connect them, an ontology agent drafts the ontology, and the result is loaded into HelixDB as one connected graph. HelixDB is an open-source graph-vector database written in Rust; Foundry is the app on top of it.

Connect. Foundry has connectors for PostgreSQL, MySQL, Amazon S3, Stripe, Attio and Granola, plus documents. There are no Salesforce or HubSpot connectors. Foundry never writes to your sources.

Draft an ontology. A generation sends your synced tables, and the newest documents of each set it picks, to Foundry's agent, which drafts types, links and mappings. You review and confirm the changes. Every value in the graph is traced to the row or document quote it came from. For the Stripe, Attio and Granola case, see Build a Customer Ontology From Attio, Granola and Stripe.

Serve it over the Helix MCP. MCP (Model Context Protocol) is the standard way for an agent to call tools. Connect Claude Code with:

claude mcp add --transport http helix https://mcp.helix-db.com/mcp

Then run /mcp and sign in with your Foundry account. The agent queries the ontology instead of guessing from raw tables, and its answers can cite the source records, rows or document quotes behind each claim.

To try it, clone github.com/HelixDB/helix-foundry, run docker compose up -d --wait, and open http://localhost:3000, or start on Helix Cloud at foundry.helix-db.com. The Foundry docs cover each step. The self-hosted install is single-user on localhost, so do not expose it.

Grounded and permissioned context: source traces and source-grounded access

Context an agent can act on has to be traceable and permissioned. Foundry handles both from the same property: every fact and relationship in the ontology is grounded in a source.

Traceable. Because each claim points to its row, record or document quote, you can answer "where did the agent get that?" in one click. That is what lets a data lead trust an agent's number, and fix the source when it is wrong.

Permissioned. Access to sources and to the ontology is authenticated, and RBAC and enterprise directory sync are on by default. The consequence of grounding is the useful part: a user who cannot see a source cannot see anything in the ontology grounded by it. The agent runs with your identity and permissions. To narrow it further, an owner or admin can create a key under Settings, Access, Agents and grant it specific sources; the agent can then read only what is grounded in those sources. Most changes through the agent need confirmation, and it cannot add connector credentials, delete connections or change billing.

This is a Foundry property. The HelixDB database on its own has no per-user permissions. Details are in Directory Sync for an AI Ontology: Access Follows the Source.

Trade-offs and when you do not need this

You do not need an ontology for every agent. If your agent answers questions over one clean source, a single well-described database or a document set, good retrieval and tool design is enough. A support bot over one help centre is that case.

An ontology earns its cost when three things are true: the data spans several systems, the same entity appears under different names, and wrong answers carry real cost, such as a refund, an approval or a customer-facing claim.

There is also work on your side. Someone has to review the drafted ontology and confirm the definitions, because only your team knows what "approved" means. Foundry drafts and links; it does not decide your policy for you. Plan an afternoon of review on the first pass, then expect smaller edits as sources change. See Self-Healing Ontology: Keeping Links Right as Data Drifts for how drift is handled.

FAQ

The questions below are the ones searchers ask most often; each answer is also in the FAQ block that follows.

Engineer the business context first, then tune the rest

Token budgets, retrieval and memory are table stakes. The leverage is in whether the agent knows what your customer, order and approval mean, and can show where each fact came from. Start small: connect two sources you already trust, such as Stripe and Postgres, let Foundry draft the ontology, and ask an agent one question you can verify. Clone github.com/HelixDB/helix-foundry and star it if it earns it.

Try Foundry on a sample company

Sign in and Foundry sets up Acme Corp: its database and documents connected into one ontology you can explore and ask questions of, with a source behind every answer. Then connect your own data.