TETHESIS
DocumentationQuickstart
DOCUMENTATION · QUICKSTART

InvariantDB in 5 minutes

Three paths, depending on what you’re holding: an AI agent, an app, or a terminal. Each one ends with data in a graph and its history readable.

01 · AI agent via MCP

InvariantDB ships a Model Context Protocol server. Add one block to your MCP client’s config and your agent gets tools for Cypher, search, agent memory, provenance and history — the set on offer depends on the server’s settings and the graph’s own switches.

// In your MCP client's config: { "mcpServers": { "invariantdb": { "type": "http", "url": "https://invariantdb.com/graphs/a1b2c3_my-graph/mcp", "headers": { "Authorization": "Bearer gq_your_api_key" } } } }

Works with any MCP client that supports remote servers (HTTP POST, JSON-RPC 2.0). The URL ends in your graph’s full name from the dashboard (like a1b2c3_my-graph). Create an API key in your InvariantDB workspace; the secret is shown once. Then ask your agent a question like “employees whose role changed in the last 90 days, with when it was recorded versus when it took effect” and it runs the temporal query for you.

02 · Python or Node SDK

Two clients over the same HTTP API. The module is invariantdb in both languages. The clients aren’t on PyPI or the public npm registry — install from a pinned, hash-checked URL.

# Python — pinned wheel URL (not on PyPI); pip verifies the hash and refuses a mismatch pip install "https://sdk.invariantdb.com/python/invariantdb-0.10.1-py3-none-any.whl#sha256=<SHA-256 from the release notes>"
# Node — versioned URL (not on the npm registry); module name invariantdb npm install https://sdk.invariantdb.com/node/invariantdb-0.10.1.tgz
from invariantdb import Client db = Client("https://invariantdb.com", api_key="gq_...") # Create the graph in the dashboard, then use its full name: rows = db.cypher( graph="a1b2c3_my-graph", query="MATCH (p:Person) WHERE p.role = 'engineer' RETURN p.name", ).rows

The Node client mirrors the same surface. Full reference — search, vector, bulk import, capability tokens, streaming reads — is on the SDK page.

03 · curl against the HTTP API

Two requests, end to end: write a node and read it back with its property history. Create the graph in the dashboard first and copy its full name. An Idempotency-Key makes a write safe to resend; format=flat returns plain JSON values instead of tagged ones.

KEY="gq_your_api_key" GRAPH="a1b2c3_my-graph" # the full name from the dashboard # 1. Write a node (the Idempotency-Key makes a resend safe) curl -fsS -X POST -H "Authorization: Bearer $KEY" \ -H "Content-Type: application/json" \ -H "Idempotency-Key: quickstart-alice-1" \ --data '{"query": "CREATE (p:Person {name: \"Alice\", role: \"engineer\"}) RETURN p"}' \ "https://invariantdb.com/graphs/$GRAPH/cypher?format=flat" # 2. Read it back, with property history (bitemporal) curl -fsS -X POST -H "Authorization: Bearer $KEY" \ -H "Content-Type: application/json" \ --data '{"query": "MATCH (p:Person {name: \"Alice\"}) CALL db.propertyHistory(p, \"role\") YIELD value, validFrom, validTo, txnAt RETURN value, validFrom, validTo, txnAt"}' \ "https://invariantdb.com/graphs/$GRAPH/cypher?format=flat"

validFrom, validTo and txnAt are nanoseconds since the Unix epoch. The full HTTP surface is in the OpenAPI spec, rendered interactively at /docs/.

NEXT STEPS

By what you’re building

If you’re building…Read
An AI agent that remembersAgent memory
A tamper-evident audit trailProvenance & audit
Erasure you can prove on requestCryptographic erasure
Grounded retrieval over your dataKnowledge
The full capability listFeatures
WHEN SOMETHING DOESN’T WORK

Common responses

ResponseWhat it means
401 UnauthorizedMissing or wrong Authorization: Bearer gq_… header. Check the key’s prefix and that it hasn’t been revoked.
403 ForbiddenThe key authenticated, but its role doesn’t permit the operation — mint a key with the right role.
404 Not FoundThe graph doesn’t exist yet, or the name is wrong. Create graphs in the dashboard and use the full name shown there.
429 Too Many RequestsPer-key rate limit. Raise the key’s rateLimits or back off.
Cypher parse errorInvariantDB targets openCypher; the covered surface is in the Cypher reference.

Build on the foundation