agent entity for worked examples; substitute any other singular/plural pair.
Naming
Operations are named from the entity’s singular and plural table names. For core entities these pairs are, for example,agent/agents, user/users, eval_run/eval_runs, prompt_library_item/prompt_library. Type names are lowercase singular (agent, eval_run); result wrapper types capitalize the first letter (AgentPaginationResult, FilterAgent).
Queries
For the
agent entity, the generated fields are (verbatim from the core SDL):
agentById is the one special case in the schema: it accepts an optional project: ID argument so agent lookups can be scoped to a project. Every other entity’s ById takes only id.Worked example: fetch and page
limit defaults to 10 and is capped at 10,000. page is 1-based: page 1 (or omitted) returns the first page, and the offset is (page - 1) * limit.
Worked example: statistics
{plural}Statistics counts records, optionally grouped by a field. Without groupBy it returns a single row with group: "total":
Mutations
For
agents, verbatim from the core SDL:
Worked example: create, update, delete
Filters
Every entity gets aFilter{Singular} input whose fields mirror the entity’s columns, each typed with a per-scalar operator input. The filters argument is an array; all entries (and all fields within an entry) are combined with AND. Use the or operator inside a field for alternatives.
The operator inputs, verbatim from the core SDL:
feedback entity’s status column (verbatim):
Worked example: AND and OR
Sorting
All list operations accept a singlesort argument:
Access control
Two layers apply to every operation: Entity-type gates. Foragents, workflow_templates, variables, users, test_cases, eval_sets, and eval_runs, your role must grant at least read on the matching permission (agents, workflows, variables, users, evals). Without it, queries fail with Access control error: no role found or no access to entity type. Writes additionally require the write level, enforced per record.
Row-level RBAC. Tables with RBAC enabled carry a rights_mode column (private, public, users, roles, teams) and a created_by column. List and read operations silently filter to rows you can see: public rows, rows you created, and rows shared with you, your role, or your team. Super admins bypass row-level filtering everywhere except agent_sessions, which always enforces the session’s own sharing rules.
RBAC-enabled types expose the resolved sharing state as a RBAC field, and accept sharing input on create/update:
id with a rights string ("read" or "write"):
Computed fields
Some fields are resolved at query time rather than read from a column:agent—providerName,modelName,streaming,capabilities,maxContextLength,authenticationInformation,systemInstructions,workflows, andslugare resolved from the agent’s provider and model configuration.workflow_template—variables: [String]lists the{variable}placeholders extracted from the template’s steps.budget: JSON— present onuser,role,team,project,agent, andworkflow_template. Resolved from the model gateway at query time;nullwhen the entity has no budget. See Budgets.
createdAt/updatedAt timestamps, plus last_processed_at and embeddings_updated_at processing markers.
Next steps
Dynamic types
Apply these patterns to your knowledge contexts.
Vector search
The retrieval operations context types add on top of CRUD.