Skip to the page

Napalm documentation

Napalm compiles a single schema into your entire application backend, AI model pipeline and agent runtime on PostgreSQL 18.

In the schema
—

Quickstart#

Install the CLI, sign in to your organization, push a schema and run your first query. Every approved organization starts with a project and a dedicated PostgreSQL cluster.

  1. Install the CLI

    curl -fsSL https://downloads.napalmdata.com/cli/install.sh | sh
  2. Sign in to your organization

    napalm login opens a browser prompt to authorize your machine and save a scoped org token locally.

    Your terminal
    napalm login
    Opening your browser to sign in…
    If the browser doesn’t open, visit:
    https://console.napalmdata.com/authorize-cli?port=53817&state=…&challenge=…&name=napalm+CLI+on+studio
    Signed in to Northwind
    Can make changes until 2026-11-16 01:12 PST
  3. Push your schema

    Define your object types, links and access policies in dbschema/default.gel.

    dbschema/default.gel
    using extension auth;using extension napalm;using future simple_scoping; module default {  global caller := global ext::auth::ClientTokenIdentity;   type Person {    # Optional so callers who cannot see another person's Identity still read Person.    identity: ext::auth::Identity {      constraint exclusive;    };    required name: str;     access policy self_has_full_access      allow all      using (.identity ?= global caller);    access policy signed_in_can_read      allow select      using (exists global caller);  }   type Note {    required title: str;    body: str;    pinned: bool;    required author: Person;    multi shared_with: Person;     access policy author_has_full_access      allow all      using (.author.identity ?= global caller);    access policy shared_can_read      allow select      using ((global caller in .shared_with.identity) ?? false);  }}

    Run napalm schema push to plan the migration on the server and preview every change before applying it.

    Your terminal
    napalm schema push notes
    CREATE FUTURE simple_scoping;
    CREATE GLOBAL default::caller := (GLOBAL ext::auth::ClientTokenIdentity);
    CREATE TYPE default::Person {
    CREATE LINK identity: ext::auth::Identity {
    CREATE CONSTRAINT std::exclusive;
    };
    CREATE ACCESS POLICY self_has_full_access
    ALLOW ALL USING ((.identity ?= GLOBAL default::caller));
    CREATE ACCESS POLICY signed_in_can_read
    ALLOW SELECT USING (EXISTS (GLOBAL default::caller));
    CREATE REQUIRED PROPERTY name: std::str;
    };
    CREATE TYPE default::Note {
    CREATE REQUIRED LINK author: default::Person;
    CREATE ACCESS POLICY author_has_full_access
    ALLOW ALL USING ((.author.identity ?= GLOBAL default::caller));
    CREATE MULTI LINK shared_with: default::Person;
    CREATE ACCESS POLICY shared_can_read
    ALLOW SELECT USING (((GLOBAL default::caller IN .shared_with.identity) ?? false));
    CREATE PROPERTY body: std::str;
    CREATE PROPERTY pinned: std::bool;
    CREATE REQUIRED PROPERTY title: std::str;
    };
    Apply the migration to notes? [y/N] y
    Migrated notes: 4 changes
  4. Issue a service key and run a query

    A service key authenticates requests to one project and branch. Pass --save to store the credential locally for napalm query, napalm call and napalm mcp.

    Your terminal
    napalm keys create notes --label laptop --read-only --save
    Created laptop for notes, read-only, for 30 days
    ndb_Qm9zZS1yZWQtZXhhbXBsZS1rZXk
    Saved for napalm query and napalm mcp.
    napalm query notes "select Note { title } order by .title limit 2"
    [
    {
    "title": "Launch checklist"
    },
    {
    "title": "Pricing notes"
    }
    ]

Workloads#

AI & Models

Training data, document search & evals

Training exports under consent rules, PDF passage pipelines, evals in CI and hybrid search.

Agents & MCP

Scoped agents, MCP, A2A & copilots

Expiring grants on chosen records, built-in /mcp and /a2a endpoints and dry-run previews.

Logic & Workflows

Actions, handlers, jobs & webhooks

Actions guarded by queries, hosted handlers in 5 languages, background jobs and commit webhooks.

Apps & SaaS Scale

Multi-tenant SaaS, realtime & sharding

Access rules across links, typed SDKs in 8 languages, live queries, object storage and sharding by ownership root.

Endpoints and credentials#

Napalm separates data-plane traffic from control-plane management. Queries, live subscriptions, file uploads, user sign-in and agent tool calls go directly to your project’s dedicated hostname (<label>.napalmdata.com). Cluster provisioning, schema migrations, branch management and key issuance go to api.napalmdata.com.

Project endpoint

Cluster engines serve queries, live streams, uploads and agent calls under caller policies.

Separated credentials

Sessions and service keys enforce row policies, while org tokens manage infrastructure.

User sessions and service keys target a single project branch and run under your schema’s access policies. Org tokens manage clusters and projects at api.napalmdata.com and never read or change application rows. See Sessions and keys.

CallerCredentialEndpoint
Browser or mobile appUser session token (from /sign-in)Endpoint/query, /subscribe, /uploads
Backend server or workerProject service key (ndb_…)Endpoint/query, /changes, /search
MCP client (Claude, Cursor)Service key or OAuth 2.1 user grantEndpoint/mcp
A2A peer agentService key or user session tokenEndpoint/a2a
napalm CLI and CI pipelinesOrg token (napalm_…) and service keyEndpointapi.napalmdata.com and project host
Web consoleOrg member session or org tokenEndpointapi.napalmdata.com

Operational limits#

Max request body
1 MiB
Max response payload
16 MiB
Statement timeout
60 s
Max service key TTL
365 days
Max user session TTL
365 days
Allowed CORS origins
32 per project

Every deployed POST /query/{name} call and parameterized POST /query statement compiles traversed links, computed properties and access policies into one SQL statement against a single PostgreSQL snapshot. Full-text indexes (fts::index) and queued ext::napalm::Job rows commit inside that transaction, while deferred vector embeddings (ext::ai::index) refresh in the background.

Limits lists every project, organization and Control API limit on one page.

Known limits#

These behaviors differ from SQL and upstream Gel.

BehaviorResultFix
Queries inside an access policyA query inside a policy reads every object of each referenced type without applying other policies on that type.FixFilter reads inside a policy by caller, such as filter .agent ?= global caller. A schema push warns when a rule reads another type without checking the caller. See Access rule syntax.
= against an empty valueAn = comparison returns the empty set when either side is empty, so filtering an optional value by = matches no rows.FixUse ?= against optional links, properties and globals. A push refuses a policy whose result could be empty, and deploying queries warns when an = filter can drop rows.
Commits without a replicaOn a cluster with replicas, each commit waits for a replica in the same region. If no replica is reachable for 5 seconds, the primary commits alone until a replica returns. A solo cluster has no replica.FixClose the window with napalm clusters commit-without-replica <cluster> refuse. Writes then wait while a shard has no replica streaming, so run two replicas. See Scale and recovery.

Files for agents and tools#

  • OpenAPI specOpenAPI 3.1 specification covering every Project API and Control API endpoint.
  • llms.txtCompact plain-text summary of Napalm concepts, HTTP routes and CLI commands for LLM context windows.
  • llms-full.txtComplete plain-text build of the entire documentation suite in reading order for coding agents.

Type a word or two to search every docs page.