Introducing the Ontology

Define your company's records, the actions that change them and who may run them once, in code, and every app, agent and API works under the same rules.

Product · SegmentStream · 14 October 2026 · 5 min read

On this page

The ontology is your company's model of itself, in code: the records your business runs on, how they connect, the actions that change them and who may run each one. Define it once in your repository, and your apps, your API, your team's AI tools and the company agent all work on the same records under the same rules.

The console's ontology map focused on Deal with every field shown: name, product, stage, amount, currency, close date and lost reason, each typed, its links to company, primary contact, lead and owner, and its move_stage action, beside Lead and its fields
A Deal and the records around it, as deployed: every property typed, every relationship drawn.

What's new

  • Entities, properties and relationships in TypeScript, each with a plain-language description.
  • Every change through an action, with your rules inside, in one transaction, kept in history.
  • Roles and permissions per entity and per action, down to the records a person owns.
  • One model, every interface: a REST API with its own reference, a typed SDK and an MCP server.
  • Metrics over your warehouse, declared once and asked for by name.
  • Safe changes: each deploy plans the change against the live database and refuses what would lose data.
  • The ontology in the console: a map, the records and a table of who may do what.

Entities, properties and relationships

An entity is a kind of thing your business runs on: Company, Contact, Deal, Order. Properties are the values each record holds, each of a set type, such as an amount, an email or a stage picked from a list. Relationships name how records connect, in both directions: a deal is with a company, and a company has deals.

Every entity, property, option, action and role carries a description in plain language. The console, the API reference and agents read the same text, so an agent knows what "qualified" means in your company before it moves a deal there.

Records live in your workspace's own Postgres database. Required properties, unique values and allowed options are checked on every write, whoever makes it.

Every change goes through an action

An action is a named operation with your business rules inside: qualify a lead, move a deal, approve an order. It is the only way to change a record.

  • Generated or written by you. Each entity gets create, update, delete and upsert actions. You write the ones that carry business logic, and an entity can accept changes through your actions only.
  • One transaction. The action checks its input and the caller's permission, runs your rules and saves, or saves nothing.
  • History. Every change is kept with the action, who ran it, and each value before and after.
  • Refusals an agent can act on. A refused action returns its own message, such as "A lost deal needs a reason", so the agent fixes its input and tries again. A dry run returns every problem without saving anything.

Raw database access

Agent: "mark the deal as won"
UPDATE deals SET stage = 'won'
Any row, any column, no history

Governed action

Agent: "mark the deal as won"
deal.moveStage({ deal, stage: "won" })
Rules and permission checked, history kept
The same request, two ways.

Roles and permissions

A permission is a read of an entity or the right to run one of its actions. A role is a named set of them, declared in your code: sales may read deals and move them, finance may approve invoices.

  • The same for everyone. People, API keys, workflows and agents are held to the same roles. An agent a person connects acts as that person, with the roles they hold at that moment.
  • Down to the record. A permission can cover only some records, such as the deals a person owns or the staff of their own division.
  • Checked on the server. Every read and every action is checked by the ontology itself, whichever app, key or agent sends it. Hiding a button is only a convenience.
The console's role comparison for the growth, sales and invoice_printer roles: each read and action in rows, with the permission it requires, and a dot where a role holds it
Who may do what, read from the rules: three roles side by side, each read and action in rows.

One model, every interface

Deploy an ontology and it is served three ways, from one code path:

  • A REST API at /api/ontology, with an interactive reference at /api/ontology/docs.
  • A typed SDK for your app's server code, generated from the same model.
  • An MCP server at /mcp, where your team's AI tools sign in as the person and get tools only for what their roles allow.

A rule enforced in one is enforced in all three.

Decisions here, observations in the warehouse

A company's data has two kinds of value. What a person or an agent decides, such as a stage, an approval or a correction, is a record in the ontology, changed by an action. What a machine reports or a model computes, such as orders, spend or a forecast, is a table in your warehouse.

  • Warehouse tables as entities. An entity can map a warehouse table and relate to your records, without copying it.
  • Metrics, declared once. Count orders, sum revenue or divide one by another, with filters and relative periods, and ask for them by name, grouped by any property they reach. Every app, report and agent gets the same number.
  • Records in the warehouse. Every record replicates to your BigQuery warehouse, so analysts join decisions made in the app with the rest of your data. Postgres stays the source of truth.

Changing the model safely

Every entity and property has a permanent id, so each deploy can tell exactly what changed.

  • New entities, properties and options apply on their own.
  • A rename keeps the data when you declare the old name.
  • A removed property or entity keeps its values and history, and comes back if you declare it again.
  • A changed type is refused before anything runs.
  • If a step fails, nothing is applied and the running version stays live.
  1. 01

    Your coding agent changes ontology/

  2. 02

    The deploy plans the change against the live database

  3. 03

    Unsafe changes are refused before anything runs

  4. 04

    The new version goes live

What a deploy does with a change to the model.

The ontology in the console

  • The map: every entity and relationship as deployed. Focus on one to see its neighbours and open the descriptions agents read.
  • Records: browse any entity, newest change first, with links between related records.
  • Access: every read and action against every role, computed from your code.
The console's ontology map focused on Deal and the records around it. The inspector shows Deal's description and its actions: move_stage, with its input, the permission it requires and the roles granted it, then the generated create, update and delete with their roles
The action that moves a deal between stages, what it needs, and which roles may run it.

Try it

Install SegmentStream:

curl -fsSL https://segmentstream.com/install.sh | sh

Then ask your coding agent (Claude Code, Codex, Cursor or another) to model your business. For purchasing it could be:

Model our purchasing in the SegmentStream ontology: suppliers,
purchase orders and their lines. An order moves from draft to
submitted, approved and received.

Anyone on the team can draft an order. Only finance can approve
one, and an order over 5,000 needs the CFO. A rejected order
needs a reason. Each person sees only the orders they drafted,
finance sees all of them.

Read more on the ontology page.

Enterprise pilot

Start a pilot.

Our forward-deployed engineers build one solution on your data, in your own workspace, as code you own. Tell us what you run today and what you want; your note goes straight to our founder.

  • One solution, on your data, in your own workspace
  • First version live in two weeks
  • Parity proven before anything is switched off
  • Fixed scope and price, credited to your contract if you continue

Not ready for a pilot? Send the form anyway with your question. An engineer will reply, not a sales rep.

How the pilot works

Goes to our founder’s inbox. No sales queue, no newsletter.

Build your company’s own software. Let agents run it.

Start a pilot

Our engineers build the first version on your data in two weeks, at a fixed price.

Or build it yourself with your coding agent:

curl -fsSL https://segmentstream.com/install.sh | sh

We’ll email you product updates, tips and onboarding help. Unsubscribe anytime.