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 | optional → unique → default(value).
- Identifiers:
PascalCase for entities/events; snake_case for fields.
app
app CRM @0.1 {
database postgres
auth jwt
}
| Member | Initial values |
|---|
database | postgres, mysql |
auth | jwt, 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_to | FK to another entity |
has_one | 1:1 inverse (roadmap) |
has_many | 1:N (roadmap) |
many_to_many | N:N (roadmap) |
optional marks nullable / optional FK.
crud
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)
| Block | Level | Function |
|---|
app | Core | Application defaults |
entity | Core | Data model |
inline enum(…) | Core | Enum field types |
inline belongs_to | Core | Relationships (v0.1) |
crud | Core | REST operations |
inline / validation | Core | Field rules |
index | Infra | Database indexes |
api | Infra | HTTP config |
seed | Infra | Seed data — Database |
Blocks in other chapters
| Block | Chapter |
|---|
policy, permission, auth | Security |
workflow, event, lifecycle, job, queue | Workflows |
ai_context | Agents |
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.