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 once 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.napalm schema pushplans the migration on the server and previews each change before applying it.dbschema/default.gel using extension auth;using extension napalm;using future simple_scoping; module default { global caller := global ext::auth::ClientTokenIdentity; type Person { # Not required: a caller reads their own identity alone, so another person's reads as empty. 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); }}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 shards by tenant 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 HTTPS host
Serves /query, /subscribe, /uploads, /mcp and /a2a directly on your cluster’s engines under verified caller identity.
Sessions, ndb_ keys & napalm_ tokens
User sessions and branch-scoped ndb_… keys run under schema access policies, while value-blind napalm_… org tokens manage infrastructure and DDL only.
| 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 |
User sessions and service keys belong to one project and 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.
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 POST /query request compiles and runs one EdgeQL statement as a single SQL query against one PostgreSQL snapshot, including traversed links, computed properties and access policies.
Limits gathers every limit of a project, an org and the control API 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 that has 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.