Overview

Rekor gives AI agents a persistent, structured place to store and query data — without migrations, infrastructure setup, or schema design upfront. Agents define their own schemas at runtime and start writing immediately.

✦ Agentic shortcut

Human reading this?

Paste this URL into your code agent — Claude Code, Codex, etc. — and it'll handle the setup for you, end to end.

Ready to build? Get Started is the fast path. This page is the reference hub — the core concepts, a manual 5-minute walkthrough, and the full MCP, CLI, and REST interfaces.

Four Primitives

Everything in Rekor is built on two schema-and-instance pairs — a record_type schemas its records, and a relationship type schemas its relationships:

PrimitiveWhat it is
RecordTypeA JSON Schema defining a record type. Created at runtime — no migrations.
RecordA JSON record conforming to a record_type's schema. Upsert by external ID for idempotency.
Relationship typeA schema for a link, like a record_type is for a record. Defines a relationship type, optionally validates its metadata, and optionally restricts which record_types it connects. Declared before linking.
RelationshipA typed, directed link between two records with schema-validated metadata. Queryable in any direction.

5-Minute Tutorial

This walkthrough creates a base, defines a schema, writes records, links them with a relationship, and queries the result.

1. Install and authenticate

npm install -g rekor-cli
rekor login

2. Create a base and preview environment

All schema changes happen in preview first, then get promoted to production.

rekor bases create crm --name "CRM"
rekor bases create-preview crm --name "setup"

3. Define record_types in preview

rekor record-types upsert contacts \
  --base crm--setup \
  --name "Contacts" \
  --schema '{
    "type": "object",
    "required": ["name"],
    "properties": {
      "name": { "type": "string" },
      "email": { "type": "string" },
      "company": { "type": "string" }
    }
  }'

rekor record-types upsert deals \
  --base crm--setup \
  --name "Deals" \
  --schema '{
    "type": "object",
    "required": ["title", "value"],
    "properties": {
      "title": { "type": "string" },
      "value": { "type": "number" },
      "stage": { "type": "string" }
    }
  }'

4. Promote to production

rekor bases promote crm --from crm--setup --dry-run
rekor bases promote crm --from crm--setup

5. Write records

rekor records upsert contacts --base crm \
  --external-id "c_001" --external-source crm \
  --data '{"name": "Jane Doe", "email": "jane@acme.com", "company": "Acme"}'

rekor records upsert deals --base crm \
  --external-id "d_001" --external-source crm \
  --data '{"title": "Enterprise Plan", "value": 50000, "stage": "negotiation"}'

6. Declare a relationship type, then link records

# Declare the relationship type once (config — preview then promote)
rekor relationship-types upsert owns --base crm \
  --description "Contact owns a deal" \
  --source-record_types '["contacts"]' --target-record_types '["deals"]'

rekor relationships upsert --base crm \
  --type "owns" \
  --source contacts/c_001 \
  --target deals/d_001

7. Query and traverse

# SQL query
rekor sql "SELECT data.title.:String as deal, CAST(data.value, 'Float64') as value FROM records WHERE org_id = {org_id:String} AND base_id = {base_id:String} AND record_type = 'deals' AND CAST(data.value, 'Float64') >= 10000 AND deleted = false ORDER BY value DESC" --base crm

# Aggregate
rekor sql "SELECT sum(CAST(data.value, 'Float64')) as pipeline_total FROM records WHERE org_id = {org_id:String} AND base_id = {base_id:String} AND record_type = 'deals' AND deleted = false" --base crm

# Traverse relationships
rekor query-relationships contacts c_001 --base crm \
  --type owns --direction outgoing

Interfaces

Three ways to interact with Rekor — all backed by the same API.

MCP Tools

Sixteen MCP tools that AI agents use to manage bases, record_types, records, relationships, and more. An agent typically starts with manage_base(list) to discover context.

ToolDescription
batch_operationsExecute multiple record, relationship, and record_type operations atomically. All operations succeed or all fail. Use for transactions, multi-entity writes, or any case where consistency between operations is required. Max 1,000 operations.
get_change_historyRetrieve the change history (audit log) for a record, relationship, record_type, or relationship type — every version as a full snapshot, plus who changed it (actor), the operation (create/update/delete/cancel/archive), and when. Admin-only: organization owners/admins, or a token explicitly granted read:audit; ordinary agent tokens receive 403.
manage_attachmentManage file attachments on records. Filenames can include paths for folder structure (e.g. 'docs/guide.md', 'src/index.ts'). Upload returns a presigned URL — the agent uploads bytes directly.
manage_baseManage bases. Actions: create, get, list, delete, create_preview, list_previews. Start here to discover existing bases before operating. Note: schema changes (record_types, triggers, inbound webhooks) can only be made in preview bases. Use create_preview to create a preview from a production database, then promote via CLI.
manage_fileManage files (path-addressed, versioned content) within a file type. Actions: create (upload text content, mints a content version), get (metadata; ?version reads a retained one), list (by path prefix), move (rename), delete, history (list content versions), diff (compare two versions — metadata delta + text content diff). Binary uploads/downloads use the CLI or REST; this tool handles text content and metadata.
manage_file_typeManage file types (Buckets) — the config for a set of files: storage policy + optional metadata schema. Actions: upsert, get, list, delete. Config writes require a preview database.
manage_inbound_webhookManage inbound webhook endpoints. Inbound webhooks accept JSON and upsert through the normal write path; an optional mapping canonicalizes the received payload to the record_type's schema before write.
manage_recordCreate, read, update, patch, delete, or cancel individual records. 'upsert' (PUT) writes the FULL record — send every field; supply external_id (and optional external_source) for idempotent writes from external systems (the internal UUID is auto-generated). 'patch' is a PARTIAL update — send only the fields you want to change and the rest are kept (top-level merge; nested objects replaced wholesale). Use patch to flip a status or set a flag without re-sending the whole record; it addresses an existing record by record_id or external_id and 404s if none exists. (For a record_type backed by an external source, the provided fields are forwarded to that upstream system, which decides how they are applied.) Use record_id (internal UUID) for get/delete/cancel or to address a known record. Records may be archived (_archived: true in response) — an archived record stays readable and can still be cancelled, but it cannot be deleted, and re-upserting by the same external_id creates a new record rather than updating the archived one. Keep record data small (structured JSON only) — store binary or large content (PDFs, images, files) as an attachment via manage_attachment and reference it from the record; oversized payloads are rejected.
manage_record_typeManage record_type schemas. Actions: upsert, get, list, delete. Use list to discover what record_types exist in a database.
manage_relationshipCreate, read, update, or delete relationships between records. Relationships are typed, directed links with optional metadata.
manage_relationship_typeManage relationship types. A relationship type must exist before any relationship of that type can be created — it optionally validates the relationship's metadata against a JSON Schema and restricts which record_types it may connect. Actions: upsert, get, list, delete.
manage_triggerManage triggers. A webhook trigger fires a signed HTTP POST when records/relationships change; an internal_write trigger makes Rekor patch a referenced record itself (no executor); an external_write trigger writes the changed record out through an external source's write path (reusing its translation, endpoint, and auth) and links the upstream-assigned id back (no executor).
provider_adapterConvert between LLM provider tool formats (openai, anthropic, google, mcp) and Record record_types. Actions: import_tools (create record_types from tool definitions), export_tools (export record_types as tool definitions), import_tool_call (create a record from a tool call in provider format).
query_recordsList and search records in a record_type. Supports exact filtering, fuzzy text search, sorting, and pagination via the Filter DSL. Use the `search` operator on a field to match approximate values when you don't have the exact stored string (e.g. {"field":"data.car_model","op":"search","value":"honda civic"}); results come back ranked by closeness with a `_search_score`. Combine `search` with exact operators (eq/in/gte/...) in the same filter to narrow first, then rank.
query_relationshipsQuery relationships for a specific record. Find related records by type and direction.
sql_queryExecute a read-only SQL query against database data. Tables: records, relationships, record_types, bases, operations_log. Always include BOTH org_id = {org_id:String} AND base_id = {base_id:String}, plus deleted = false, in WHERE (a database id is per-org, not globally unique, so org_id is required to isolate your data). Queries return the latest version of each row automatically.

CLI Commands

The Rekor CLI (rekor-cli) provides a complete command-line interface.

npm install -g rekor-cli
rekor login
CommandDescription
rekor actionsManage Actions — reusable, named definitions: one record_type + one operation, or a composite of atomic write steps (--config with `steps`)
rekor attachmentsManage record attachments
rekor basesManage bases
rekor batchExecute atomic batch operations (up to 1,000 operations)
rekor file-typesManage file types (Buckets) — storage policy + optional metadata schema for files
rekor filesManage files (path-addressed, versioned content) within a file type
rekor inbound-webhooksManage inbound webhook endpoints
rekor loginAuthenticate with Rekor
rekor logoutRemove stored authentication credentials
rekor providersImport/export tool definitions between LLM providers and Record record_types
rekor pullPull a database config into rekor-ws/ as YAML files (a preview, plus a read-only mirror of linked production)
rekor pushPush local config files to a preview database (creating it if new)
rekor query-relationshipsQuery related records
rekor record-typesManage record_types
rekor recordsManage records
rekor relationshipsManage relationships between records
rekor reportFile a report to the Rekor triage queue and verify the outcome
rekor secretsManage organization vault secrets
rekor seedApply, reset, or clear a seed fixture on a preview base (hermetic eval data)
rekor sqlExecute a read-only SQL query against database data
rekor statusShow auth, connectivity, and CLI version diagnostics
rekor templateBrowse and pull ready-made data-layer templates
rekor tokensManage API tokens
rekor toolsetsManage MCP Factory toolsets
rekor triggersManage triggers (outbound webhooks, internal writes, external writes)
rekor unbindClear the database binding for this worktree
rekor updateUpdate the Rekor CLI to the latest published version
rekor useBind this worktree to a database so push/pull refuse to run against a different one
rekor whoamiShow the authenticated identity

REST API

All endpoints accept and return JSON. Base URL:

https://api.rekor.pro/v1/{base_id}

Authenticate with a Bearer token in the Authorization header.

SectionDescription
BasesBases API endpoints
Record_typesRecord_types API endpoints
RecordsRecords API endpoints
RelationshipsRelationships API endpoints
Change HistoryChange History API endpoints
AttachmentsAttachments API endpoints
File TypesFile Types API endpoints
FilesFiles API endpoints
S3 Mount CredentialsS3 Mount Credentials API endpoints
Inbound_webhooksInbound_webhooks API endpoints
TriggersTriggers API endpoints
MCP Factory ToolsetsMCP Factory Toolsets API endpoints
ActionsActions API endpoints
BatchBatch API endpoints
ProvidersProviders API endpoints
SQLSQL API endpoints
EnvironmentsEnvironments API endpoints
API TokensAPI Tokens API endpoints
Secret VaultSecret Vault API endpoints
OtherOther API endpoints

Integrations

Connect external systems, compose operations, and adapt to different AI providers.

Next Steps

  • Get Started — install the Rekor skill into your agent with one command and have it set everything up for you.
  • Skill — read the full skill content used by AI agents to drive Rekor via the CLI.
  • Environments — understand preview and production bases before deploying.
  • Query — SQL queries, cross-base queries, filter DSL, sorting, and aggregation.
  • Access Control — set up scoped API keys and organizations.