Quickstart

Your first “what was true, when” query — in five minutes.

InvariantDB is a decision database: every write records what was true, when it was true, and what the system knew when it acted. Three paths to your first query — pick what’s on your desk.

Bitemporal by design Cypher-native MCP-ready
Want the full 30-minute walkthrough with production hardening, bitemporal deep-dive, and MCP integration? See the 30-minute onboarding runbook.
Three paths, five minutes

Pick what’s already on your desk.

Wire an AI agent through the Model Context Protocol, install the Python or Node SDK, or hit the HTTP API with curl. Same graph, same records, same audit chain underneath.

01
AI agent via MCP
Claude Desktop, Cursor, Continue, or any MCP-compatible client. One config block, fourteen tools.
Jump to Path 1
02
Python or Node SDK
Install, ensure a graph, run a Cypher query. Agent-memory primitives in one call.
Jump to Path 2
03
curl against the HTTP API
Create a graph with a JWT, then query with the returned gq_… key. Bitemporal history round-tripped in three requests.
Jump to Path 3
From clone to first query

Pick your path. Ship.

Each path lands you at the same place: a live graph, an API key, and a Cypher query returning the record with its bitemporal provenance intact.

Path 1 / MCP

AI agent via MCP.

InvariantDB ships a Model Context Protocol server. One config line gets your agent 14 tools: Cypher query, fulltext + vector search, schema introspection, agent-memory primitives (record/replay episodes, beliefs, salience), provenance + audit replay.

Claude Desktop

Edit ~/Library/Application Support/Claude/claude_desktop_config.json (macOS) or %APPDATA%\Claude\claude_desktop_config.json (Windows). Replace {name} with your graph name:

claude_desktop_config.json MCP
Config
{
  "mcpServers": {
    "invariantdb": {
      "type": "http",
      "url": "https://invariantdb.com/graphs/{name}/mcp",
      "headers": {
        "Authorization": "Bearer gq_paste_your_api_key_here"
      }
    }
  }
}

Restart Claude Desktop. The 14 tools appear under the plug icon.

Cursor / Continue / VS Code

The same shape works in any MCP-compatible client. Endpoint: https://invariantdb.com/graphs/{name}/mcp (HTTP POST, JSON-RPC 2.0). See the full tool catalog.

Get an API key

Sign in to the dashboard and create a graph. POST /cloud/me/graphs returns the raw API key exactly once — copy it immediately:

POST /cloud/me/graphs → 200 OK response
Response body
{
  "graph_id": "grph_01H...",
  "name": "my-graph",
  "status": "active",
  "api_key": "gq_live_a1b2c3...",
  "api_key_id": "key_01H...",
  "api_key_prefix": "gq_live_a1b2",
  "mcp_config": {
    "mcpServers": {
      "invariantdb": {
        "type": "http",
        "url": "https://us.invariantdb.com/graphs/my-graph/mcp",
        "headers": { "Authorization": "Bearer gq_live_a1b2c3..." }
      }
    }
  },
  "already_existed": false
}

On repeat calls (same graph name), the response returns "api_key": null and "mcp_config": null — mint a fresh key from the dashboard’s API keys panel if you lost the original.

First query through your agent

“Show me every employee whose role changed in the last 90 days, with the timestamp the change was recorded versus when it took effect.”

The agent translates this to Cypher, runs MATCH (p:Person)-[:HAS_ROLE]->(r) AT RECORDED <ts> AT VALID <ts> ..., and replies with structured output. The audit chain records the query, the noise (if you’re in DP mode), and every property accessed.

Path 2 / SDK

Python or Node SDK.

Install, ensure a graph, run a Cypher query. Agent-memory primitives ship as first-class procedures.

Python

shell pip
Install
pip install invariantdb==0.7.0
quickstart.py python
Code
from invariantdb import Client

db = Client("https://invariantdb.com", api_key="gq_...")
db.graphs.ensure("my-graph")

rows = db.cypher(
    graph="my-graph",
    query="MATCH (p:Person) WHERE p.role = 'engineer' RETURN p.name, p.startDate",
).rows

# Agent memory in one call
db.cypher(graph="my-graph", query="""
    CALL db.recordEpisode($s, 'observation', $text, {topic: 'pricing'})
""", parameters={"s": "conv-abc-123", "text": "User asked about pricing"})

Node

shell npm
Install
npm install https://sdk.invariantdb.com/node/invariantdb-0.7.0.tgz
quickstart.mjs node
Code
import { Client } from 'invariantdb';

const db = new Client({ url: 'https://invariantdb.com', apiKey: 'gq_...' });
await db.graphs.ensure({ name: 'my-graph' });
const { rows } = await db.cypher({
  graph: 'my-graph',
  query: 'MATCH (n) RETURN count(n) AS total',
});

Full SDK reference: docs.

Path 3 / HTTP

curl against the HTTP API.

Graph creation uses a JWT (from the dashboard sign-in flow). Cypher queries use the raw gq_... API key returned by that create call.

first-query.sh bash
Three requests
KEY="gq_paste_your_api_key_here"
JWT="paste_your_dashboard_jwt_here"

# 1. Create a graph (idempotent; returns raw api_key once)
curl -fsS -X POST -H "Authorization: Bearer $JWT" \
    -H "Content-Type: application/json" \
    --data '{"name": "my-graph"}' \
    https://invariantdb.com/cloud/me/graphs

# 2. Run a Cypher query
curl -fsS -X POST -H "Authorization: Bearer $KEY" \
    -H "Content-Type: application/json" \
    --data '{
      "graph": "my-graph",
      "query": "CREATE (p:Person {name: \"Alice\", role: \"engineer\"}) RETURN p"
    }' \
    https://invariantdb.com/cypher

# 3. Read it back — with every version of the node (bitemporal)
curl -fsS -X POST -H "Authorization: Bearer $KEY" \
    -H "Content-Type: application/json" \
    --data '{
      "graph": "my-graph",
      "query": "MATCH (p:Person {name: \"Alice\"}) CALL db.history(id(p)) YIELD version, timestamp, properties, validFrom, validTo RETURN version, timestamp, properties, validFrom, validTo"
    }' \
    https://invariantdb.com/cypher

Full HTTP API: /openapi.yaml or the interactive /docs (Swagger UI).

Next steps by goal.

Once the first query returns, jump to the guide that matches what you’re building.

Agents that remember

An AI agent that remembers.

Record episodes, beliefs, and salience with the built-in agent-memory procedures.

Audit & compliance

A compliance-grade audit trail.

Hash-chained history you can hand to a regulator or reconstruct in a courtroom.

Private-mode data

A research data API with privacy guarantees.

Differential privacy on scalar aggregates, with per-key noise budgets and receipts.

Regulated industries

Healthcare, finance, insurance, public sector.

Bitemporal reconstruction, WORM access log, tamper-evident chain of custody.

Feature catalog

The full feature catalog.

Every capability, every procedure, every query shape.

When something doesn’t work.

401 Unauthorized
Missing or wrong Authorization: Bearer gq_... header. Mint a fresh key from the dashboard.
403 Forbidden
Key auth’d, but the role doesn’t permit the operation. Mint an admin-role key.
404 Not Found on /graphs/<name>/…
Create the graph first via POST /cloud/me/graphs.
429 Too Many Requests
Per-key rate limit. Increase via the rateLimits block.
PRIVATE_MODE_NON_AGGREGATE_RETURN
You’re using a private-mode (DP) key; only scalar aggregates allowed. See Features › Differential privacy.
Cypher parse error
InvariantDB targets openCypher; minor syntax differences listed in the docs.
Start with one decision

Ship the first query. Keep the receipt.

Sign up, spin a graph, and watch every mutation land in the tamper-evident audit chain from request one.