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.
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:
| Primitive | What it is |
|---|---|
| RecordType | A JSON Schema defining a record type. Created at runtime — no migrations. |
| Record | A JSON record conforming to a record_type's schema. Upsert by external ID for idempotency. |
| Relationship type | A 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. |
| Relationship | A 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.
| Tool | Description |
|---|---|
batch_operations | Execute 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_history | Retrieve 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_attachment | Manage 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_base | Manage 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_file | Manage 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_type | Manage 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_webhook | Manage 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_record | Create, 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_type | Manage record_type schemas. Actions: upsert, get, list, delete. Use list to discover what record_types exist in a database. |
manage_relationship | Create, read, update, or delete relationships between records. Relationships are typed, directed links with optional metadata. |
manage_relationship_type | Manage 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_trigger | Manage 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_adapter | Convert 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_records | List 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_relationships | Query relationships for a specific record. Find related records by type and direction. |
sql_query | Execute 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
| Command | Description |
|---|---|
rekor actions | Manage Actions — reusable, named definitions: one record_type + one operation, or a composite of atomic write steps (--config with `steps`) |
rekor attachments | Manage record attachments |
rekor bases | Manage bases |
rekor batch | Execute atomic batch operations (up to 1,000 operations) |
rekor file-types | Manage file types (Buckets) — storage policy + optional metadata schema for files |
rekor files | Manage files (path-addressed, versioned content) within a file type |
rekor inbound-webhooks | Manage inbound webhook endpoints |
rekor login | Authenticate with Rekor |
rekor logout | Remove stored authentication credentials |
rekor providers | Import/export tool definitions between LLM providers and Record record_types |
rekor pull | Pull a database config into rekor-ws/ as YAML files (a preview, plus a read-only mirror of linked production) |
rekor push | Push local config files to a preview database (creating it if new) |
rekor query-relationships | Query related records |
rekor record-types | Manage record_types |
rekor records | Manage records |
rekor relationships | Manage relationships between records |
rekor report | File a report to the Rekor triage queue and verify the outcome |
rekor secrets | Manage organization vault secrets |
rekor seed | Apply, reset, or clear a seed fixture on a preview base (hermetic eval data) |
rekor sql | Execute a read-only SQL query against database data |
rekor status | Show auth, connectivity, and CLI version diagnostics |
rekor template | Browse and pull ready-made data-layer templates |
rekor tokens | Manage API tokens |
rekor toolsets | Manage MCP Factory toolsets |
rekor triggers | Manage triggers (outbound webhooks, internal writes, external writes) |
rekor unbind | Clear the database binding for this worktree |
rekor update | Update the Rekor CLI to the latest published version |
rekor use | Bind this worktree to a database so push/pull refuse to run against a different one |
rekor whoami | Show 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.
| Section | Description |
|---|---|
| Bases | Bases API endpoints |
| Record_types | Record_types API endpoints |
| Records | Records API endpoints |
| Relationships | Relationships API endpoints |
| Change History | Change History API endpoints |
| Attachments | Attachments API endpoints |
| File Types | File Types API endpoints |
| Files | Files API endpoints |
| S3 Mount Credentials | S3 Mount Credentials API endpoints |
| Inbound_webhooks | Inbound_webhooks API endpoints |
| Triggers | Triggers API endpoints |
| MCP Factory Toolsets | MCP Factory Toolsets API endpoints |
| Actions | Actions API endpoints |
| Batch | Batch API endpoints |
| Providers | Providers API endpoints |
| SQL | SQL API endpoints |
| Environments | Environments API endpoints |
| API Tokens | API Tokens API endpoints |
| Secret Vault | Secret Vault API endpoints |
| Other | Other 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.