Learn how to generate complete ObjectQL applications from natural language descriptions. This guide covers zero-shot microservice generation, prompt templates, and best practices for AI-powered app creation using LLMs.
- Prompt: You ask the AI to design a system (e.g., "A Property Management System").
- Generation: The AI outputs a set of
*.object.ymlfiles. - Execution: You drop these files into your project, and the API is instantly live.
To get the best results, use a prompt that enforces the ObjectQL schema format.
Act as an ObjectQL Architect.
I need a backend for [APP_DESCRIPTION].
Please generate the object definitions in YAML format. Follow these rules:
- Use standard types:
text,number,boolean,select,date,lookup.- For relationships, use
type: lookupwithreference_to: <object_name>.- Include
required: truefor important fields.- Suggest 2-3 essential objects.
Output the YAML for each object in a separate code block.
User:
"I need a backend for a Real Estate Agency to track Properties and Agents."
AI Output:
# agent.object.yml
name: agent
fields:
name:
type: text
required: true
email:
type: email
required: true
phone:
type: phone
license_number:
type: text
status:
type: select
options: [active, inactive]# property.object.yml
name: property
fields:
address:
type: textarea
required: true
price:
type: currency
bedrooms:
type: number
bathrooms:
type: number
listing_agent:
type: lookup
reference_to: agent
status:
type: select
options: [for_sale, sold, pending]You can build tools to automate this loop.
Imagine a simple CLI tool that takes a user description and writes files to disk.
import { generateSchema } from './my-llm-service'; // Wrapper around OpenAI
async function main() {
const description = process.argv[2];
const schemas = await generateSchema(description);
for (const schema of schemas) {
fs.writeFileSync(`${schema.name}.object.yml`, yaml.dump(schema));
}
console.log("App generated! Starting server...");
}Since ObjectQL can load metadata at runtime, you can build Self-Evolving Apps.
- The App receives a request: "Add a 'renovation_date' field to Property."
- The App calls an LLM to update the YAML.
- The App reloads the metadata registry.
- The new field is immediately available via API.
ObjectQL turns software development into a Content Generation task. Instead of generating complex imperative code (which is brittle), you generate simple declarative configurations (which are robust).