Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.aiparlance.org/llms.txt

Use this file to discover all available pages before exploring further.

Syntax

Reference for Core and Infra blocks (stable in v0.1). Full grammar: Specification. CRM example: crm-reference.aip. Security and Behavior blocks: Security, Workflows.

Conventions

  • Fields are declared inside entity (name: type modifiers).
  • Modifier order: required | optionaluniquedefault(value).
  • Identifiers: PascalCase for entities/events; snake_case for fields.

app

app CRM @0.1 {
  database postgres
  auth jwt
}
MemberInitial values
databasepostgres, mysql
authjwt, session, api_key, oauth
auth on app is the default; api { } may override HTTP exposure details.

entity

entity User {
  name: string required
  email: email required unique
  role: enum(admin, manager, seller) default(seller)
  active: bool default(true)
}
Implicit fields: specification#implicit-fields.
entity User {
  timestamps   // optional marker; created_at/updated_at always injected
  soft_delete  // adds deleted_at
}

Types

string | text | int | float | bool
datetime | date | uuid | email | phone | json
status: enum(new, assigned, won, lost) default(new)

relation

entity Lead {
  seller: belongs_to User optional
}
Relation (inline, v0.1)Usage
belongs_toFK to another entity
has_one1:1 inverse (roadmap)
has_many1:N (roadmap)
many_to_manyN:N (roadmap)
optional marks nullable / optional FK.

crud

crud Lead
Typical routes:
POST   /leads
GET    /leads
GET    /leads/:id
PUT    /leads/:id
DELETE /leads/:id
Artifacts depend on the transpiler matrix.

Validation

Prefer inline modifiers:
entity User {
  name: string required
  email: email required unique
}
validation block (equivalent, for many rules):
validation User {
  name required
  email required unique
}

index

index Lead {
  status
  created_at
}
unique on a field already creates a constraint; use index for non-unique or composite lookups.

api

api {
  prefix "/v1"
  format json
}
HTTP auth inherits from app.auth unless overridden. Rate limit and CORS: Security.

Summary (Core + Infra)

BlockLevelFunction
appCoreApplication defaults
entityCoreData model
inline enum(…)CoreEnum field types
inline belongs_toCoreRelationships (v0.1)
crudCoreREST operations
inline / validationCoreField rules
indexInfraDatabase indexes
apiInfraHTTP config
seedInfraSeed data — Database

Blocks in other chapters

BlockChapter
policy, permission, authSecurity
workflow, event, lifecycle, job, queueWorkflows
ai_contextAgents

Core example (no full CRM)

app Shop @0.1 {
  database postgres
  auth jwt
}

entity Product {
  name: string required
  price: float required
  sku: string required unique
}

crud Product

api {
  prefix "/v1"
  format json
}
Full CRM with policy and workflow: crm-reference.aip.