IngaDB 0.1 · Product documentation
IngaDB/DocumentationAPI v1
Browse documentation
GET STARTED

Build your first causal analysis.

Go from an empty instance to a typed fault tree and a revision-stamped analysis result. The walkthrough uses plain HTTP so every system boundary stays visible.

15 minute guideAPI v1Docker required
What you will build

A packaging-line model with two failure events, one OR gate, and a computed top-outcome probability.

1. Start an instance

A local IngaDB instance runs as two containers: PostgreSQL and the API. The development override enables the local organization-header flow used in this guide.

terminalbash
docker compose -f deploy/docker-compose.yml \
  -f deploy/docker-compose.dev.yml up -d

Confirm the migrations are applied and inspect the service descriptor:

terminalbash
curl -s localhost:9876/admin/status
curl -s localhost:9876/db/v1

2. Create an organization

Organizations are the tenancy boundary. Save the returned identifier and send it asX-Org-Id on local development requests.

terminalbash
ORG=$(curl -s -X POST localhost:9876/admin/orgs \
  -H 'content-type: application/json' \
  -d '{"name":"my-team"}' | jq -r .id)

3. Create a graph

A graph owns its topology, evidence, computed views, revisions, and deltas.

terminalbash
GID=$(curl -s -X POST localhost:9876/db/v1/graphs \
  -H "X-Org-Id: $ORG" \
  -H 'content-type: application/json' \
  -d '{"name":"packaging-line"}' | jq -r .id)

4. Write the topology

Events are observable failures. Gates define how those events combine into outcomes. Replacing the topology is atomic: readers never see a half-written graph.

terminalbash
curl -s -X PUT "localhost:9876/db/v1/graphs/$GID/topology" \
  -H "X-Org-Id: $ORG" \
  -H 'content-type: application/json' -d '{
  "events": [
    {"id":"E_BEARING","label":"bearing wear","component":"conveyor","failure_mode":"wear"},
    {"id":"E_SEAL","label":"seal leak","component":"pump","failure_mode":"leak"}
  ],
  "gates": [
    {"id":"G_TOP","label":"line stops","type":"OR","inputs":["E_BEARING","E_SEAL"]}
  ]
}'

5. Compute the analysis

This request quantifies events, enumerates minimal cut sets, computes gate quantities, and stores the result with the revision it was calculated from.

terminalbash
curl -s -X POST \
  "localhost:9876/db/v1/graphs/$GID/views/analysis" \
  -H "X-Org-Id: $ORG" -d '{}' \
  | jq '{revision: .analysis.graph_revision, gates: .analysis.gate_quantities}'
Local versus production authentication

The development override accepts X-Org-Id. Reachable environments should use Authorization: Bearer cok_… and the deployment controls described in Operations.

Where to go next