Napalm documentation
Napalm compiles a single schema into your entire application backend, AI model pipeline and agent runtime on PostgreSQL 18.
- API
POST /query- 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.
Install the CLI
curl -fsSL https://downloads.napalmdata.com/ cli/ install.sh | sh curl -fsSL https://downloads.napalmdata.com/ cli/ install.sh | sh irm https://downloads.napalmdata.com/ cli/ install.ps1 | iex Sign in to your organization
napalm loginopens a browser prompt to authorize your machine and save a scoped org token locally.Your terminalnapalm loginOpening 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+studioSigned in to NorthwindCan make changes until 2026-11-16 01:12 PSTPush 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 pushto plan the migration on the server and preview every change before applying it.Your terminalnapalm schema push notesCREATE 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_accessALLOW ALL USING ((.identity ?= GLOBAL default::caller));CREATE ACCESS POLICY signed_in_can_readALLOW 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_accessALLOW ALL USING ((.author.identity ?= GLOBAL default::caller));CREATE MULTI LINK shared_with: default::Person;CREATE ACCESS POLICY shared_can_readALLOW 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] yMigrated notes: 4 changesIssue a service key and run a query
A service key authenticates requests to one project and branch. Pass
--saveto store the credential locally fornapalm query,napalm callandnapalm mcp.Your terminalnapalm keys create notes --label laptop --read-only --saveCreated laptop for notes, read-only, for 30 daysndb_Qm9zZS1yZWQtZXhhbXBsZS1rZXkSaved 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 exports under consent rules, PDF passage pipelines, evals in CI and hybrid search.
Agents & MCP
Expiring grants on chosen records, built-in /mcp and /a2a endpoints and dry-run previews.
Logic & Workflows
Actions guarded by queries, hosted handlers in 5 languages, background jobs and commit webhooks.
Apps & SaaS Scale
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.
| Caller | Credential | Endpoint |
|---|---|---|
| Browser or mobile app | User session token (from /sign-in) | Endpoint/ |
| Backend server or worker | Project service key (ndb_…) | Endpoint/ |
| MCP client (Claude, Cursor) | Service key or OAuth 2.1 user grant | Endpoint/mcp |
| A2A peer agent | Service key or user session token | Endpoint/a2a |
| napalm CLI and CI pipelines | Org token (napalm_…) and service key | Endpointapi.napalmdata.com and project host |
| Web console | Org member session or org token | Endpointapi.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.
| Behavior | Result | Fix |
|---|---|---|
| Queries inside an access policy | A 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 value | An = 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 replica | On 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.