> ## Documentation Index
> Fetch the complete documentation index at: https://trytilde.ai/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Ontology

> An ontology turns your business data into typed objects, reads, and actions that agents, people, and spaces use under one set of Cedar policies.

An ontology is a typed model of your business, defined in one TypeScript project. It joins the data from your systems into **objects**, such as customers and invoices, and exposes **reads** and **actions** over them. Agents call those reads and actions as tools. People use them through spaces. [Cedar policies](https://trytilde.ai/docs/ontology/policies.md) in the same project decide who may do what.

The ontology is part of Tilde Cloud.

## How it relates to agents

An agent should not hold database credentials or call ten APIs to answer one question. With an ontology, the agent sees a small set of typed tools, such as `customerOverview` or `creditCustomer`, and each call is checked against your policies.

![The ontology between your data sources and its callers: agents, people, and spaces](https://mintcdn.com/tilde/5zvc5f3lvl_5o3L_/images/ontology-overview.drawio.svg?fit=max\&auto=format\&n=5zvc5f3lvl_5o3L_\&q=85\&s=416a6360ddf4f35f37602cad74556240)

&#x20;*Click to zoom*

* **Agents** get every read and action as a tool through the **Tilde Ontology** tool provider. See [Give an agent the ontology](https://trytilde.ai/docs/ontology/deploying.md#give-an-agent-the-ontology).
* **People** open [spaces](https://trytilde.ai/docs/ontology/spaces.md) in **Live**, which call the same reads and actions.
* **Policies** see both the person and the agent acting for them. An agent never does more than the person it serves.

## The building blocks

| Concept | What it is | Page |
| - | - | - |
| Pipeline | Brings raw records in from a third-party API, a database, a webhook, or your own code. | [Sources and models](https://trytilde.ai/docs/ontology/sources-and-models.md) |
| Model | SQL that shapes raw records into tables, in dbt's vocabulary. | [Sources and models](https://trytilde.ai/docs/ontology/sources-and-models.md) |
| Object | A typed noun over a model, with properties and a key. | [Objects and links](https://trytilde.ai/docs/ontology/objects-and-links.md) |
| Link | A relationship between two object types. | [Objects and links](https://trytilde.ai/docs/ontology/objects-and-links.md) |
| Transactional view | The objects that change together, grouped by one key, such as a customer with its invoices. | [Views and actions](https://trytilde.ai/docs/ontology/views-and-actions.md) |
| Read, action, realtime view | Typed handlers, with zod input and output. | [Views and actions](https://trytilde.ai/docs/ontology/views-and-actions.md) |
| Policy | One Cedar `permit` or `forbid`. | [Policies](https://trytilde.ai/docs/ontology/policies.md) |
| Space | A React page fed only by the ontology's handlers. | [Spaces](https://trytilde.ai/docs/ontology/spaces.md) |
| Project, environment | The repository you deploy, and where it runs. | [Deploy and environments](https://trytilde.ai/docs/ontology/deploying.md) |

## A project at a glance

An ontology project is a Git repository:

```text theme={"system"}
tilde.toml          name = "crm"
ducktail.toml       the pipelines that feed the ontology
ontology/
  package.json      zod, @cedar-policy/cedar-wasm, and any SDKs your handlers use
                    (@tilde/ontology is provided at build time; don't list it)
  ontology.ts       default export: ontology({ ... })
  *.ts, *.sql       models, objects, views, handlers, policies
spaces/         optional: one React page per folder
```

`ontology.ts` brings the pieces together:

```ts ontology/ontology.ts theme={"system"}
import { ontology } from "@tilde/ontology";
import { Customer, Invoice, CustomerInvoices } from "./sales.ts";
import { CustomerView, customerOverview, creditCustomer } from "./customer.ts";
import { policies } from "./policies.ts";
import { stripe } from "./connections.ts";

export default ontology({
  objects: [Customer, Invoice],
  links: [CustomerInvoices],
  views: [CustomerView],
  reads: [customerOverview],
  actions: [creditCustomer],
  connections: [stripe],
  policies,
});
```

Tilde installs `@tilde/ontology` for you when it builds the project. Every build error names the TypeScript file, line, and field it comes from.

## Next steps

> [card] [Build your first ontology](https://trytilde.ai/docs/ontology/quickstart.md)
>
> Create, deploy, and link an ontology to an agent in a few minutes.

> [card] [Sources and models](https://trytilde.ai/docs/ontology/sources-and-models.md)
>
> Bring data in, and shape it with SQL.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.