Skip to content

Commit 506fdd7

Browse files
committed
Add AI agent and app generation docs, update navigation
Introduces new documentation for generating apps with AI and building autonomous data agents. Updates navigation in VitePress config to include new tutorials and reorganizes sidebar structure. Enhances the AI coding assistant guide with usage strategies and adds an IDE setup guide for improved developer experience.
1 parent bf4d3e9 commit 506fdd7

File tree

6 files changed

+352
-13
lines changed

6 files changed

+352
-13
lines changed

docs/.vitepress/config.mts

Lines changed: 17 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ export default defineConfig({
3737
{ text: '1. Task Manager (Beginner)', link: '/tutorials/task-manager' },
3838
{ text: '2. Micro-CRM (Intermediate)', link: '/tutorials/crm-system' },
3939
{ text: '3. Federated Data (Advanced)', link: '/tutorials/federation' },
40+
{ text: '4. AI Data Agent (AI-Native)', link: '/tutorials/ai-agent' },
4041
]
4142
}
4243
],
@@ -60,7 +61,8 @@ export default defineConfig({
6061
text: 'AI-Native Ecosystem',
6162
items: [
6263
{ text: 'Overview', link: '/ai/' },
63-
{ text: 'Building AI Apps', link: '/ai/building-apps' },
64+
{ text: 'Generating Apps (Zero-Shot)', link: '/ai/generating-apps' },
65+
{ text: 'Building AI Agents', link: '/ai/building-apps' },
6466
{ text: 'AI Coding Assistant', link: '/ai/coding-assistant' },
6567
]
6668
}
@@ -69,34 +71,39 @@ export default defineConfig({
6971
// Sidebar for Guide section
7072
'/guide/': [
7173
{
72-
text: 'Start Here',
74+
text: 'Getting Started',
7375
items: [
7476
{ text: 'Introduction', link: '/guide/' },
7577
{ text: 'Why ObjectQL?', link: '/guide/architecture/why-objectql' },
7678
{ text: 'Quick Start', link: '/guide/getting-started' },
77-
{ text: '🤖 AI Coding Setup', link: '/ai/coding-assistant' },
79+
{ text: 'IDE Setup', link: '/guide/ide-setup' },
7880
]
7981
},
8082
{
81-
text: 'Core Fundamentals',
83+
text: 'Data & Logic Layers',
8284
items: [
8385
{ text: 'Data Modeling', link: '/guide/data-modeling' },
84-
{ text: 'Page Metadata', link: '/guide/page-metadata' },
85-
{ text: 'Metadata Organization', link: '/guide/metadata-organization' },
8686
{ text: 'Querying Data', link: '/guide/querying' },
87-
{ text: 'Business Logic', link: '/guide/logic-hooks' },
87+
{ text: 'Business Logic (Hooks)', link: '/guide/logic-hooks' },
88+
{ text: 'Custom Actions (RPC)', link: '/guide/logic-actions' },
8889
]
8990
},
9091
{
91-
text: 'Advanced Features',
92+
text: 'System Architecture',
9293
items: [
94+
{ text: 'File Organization', link: '/guide/metadata-organization' },
9395
{ text: 'Microservices & Federation', link: '/guide/microservices' },
94-
{ text: 'Custom Actions (RPC)', link: '/guide/logic-actions' },
9596
{ text: 'Plugin System', link: '/guide/plugins' },
9697
]
9798
},
9899
{
99-
text: 'Integration & Deployment',
100+
text: 'Low-Code UI',
101+
items: [
102+
{ text: 'Page & Layouts', link: '/guide/page-metadata' },
103+
]
104+
},
105+
{
106+
text: 'Operations & Deployment',
100107
items: [
101108
{ text: 'Server Integration', link: '/guide/server-integration' },
102109
{ text: 'Database Drivers', link: '/guide/drivers/' },

docs/ai/coding-assistant.md

Lines changed: 37 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,47 @@
22

33
One of the core design goals of ObjectQL is to be the **most LLM-friendly backend protocol**.
44

5-
If you are using **Cursor**, **GitHub Copilot Chat**, **Windsurf**, or **ChatGPT** for development, please copy the following **System Prompt** into your AI configuration or project rules (e.g., `.cursorrules`). This allows the AI to accurately understand ObjectQL's syntax and best practices.
5+
If you are using **Cursor**, **GitHub Copilot Chat**, **Windsurf**, or **ChatGPT** for development, please copy the following **System Prompt** into your AI configuration or project rules (e.g., `.cursorrules`).
6+
This allows the AI to accurately understand ObjectQL's syntax and best practices.
7+
8+
## How to Use Effectively
9+
10+
### 1. "Before" vs "After"
11+
12+
Without this prompt, Copilot assumes you are using a generic ORM (like TypeORM) and might hallucinate classes:
13+
14+
> **Bad AI Output:**
15+
> `await getConnection().manager.find(Todo, { where: { priority: 'high' } })`
16+
> *(ObjectQL doesn't use classes or `getConnection`)*
17+
18+
With the System Prompt, it understands the **Context + Repository** pattern:
19+
20+
> **Good AI Output:**
21+
> `await ctx.object('todo').find({ filters: [['priority', '=', 'high']] })`
22+
23+
### 2. Prompting Strategy
24+
25+
When asking the AI to write code, be explicit about the schema you have defined.
26+
27+
**User Prompt:**
28+
> "Write an API route to complete a todo item. The object is named 'todo' and has a 'completed' boolean field."
29+
30+
**AI Response (with System Prompt):**
31+
```typescript
32+
app.post('/api/todo/:id/complete', async (req, res) => {
33+
const { id } = req.params;
34+
// Creates a context for the current user (if auth is handled)
35+
const ctx = app.createContext({ userId: req.user?.id });
36+
37+
await ctx.object('todo').update(id, { completed: true });
38+
res.json({ success: true });
39+
});
40+
```
641

742
## Standard System Prompt
843

944
Click the copy button in the top right to get the full prompt:
10-
11-
````text
45+
`text
1246
You are an expert developer specializing in **ObjectQL**, a metadata-driven, low-code backend engine.
1347

1448
### Core Principles

docs/ai/generating-apps.md

Lines changed: 111 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,111 @@
1+
# Generating Apps with AI
2+
3+
Because ObjectQL applications are defined primarily by **Metadata** (YAML/JSON) rather than **Code** (Classes/Functions), LLMs can generate complete, working backends in a single pass.
4+
5+
This is "Zero-Shot Microservice Generation".
6+
7+
## The Workflow
8+
9+
1. **Prompt**: You ask the AI to design a system (e.g., "A Property Management System").
10+
2. **Generation**: The AI outputs a set of `*.object.yml` files.
11+
3. **Execution**: You drop these files into your project, and the API is instantly live.
12+
13+
## Prompting Guide
14+
15+
To get the best results, use a prompt that enforces the ObjectQL schema format.
16+
17+
### Template
18+
19+
> **Act as an ObjectQL Architect.**
20+
>
21+
> I need a backend for **[APP_DESCRIPTION]**.
22+
>
23+
> Please generate the object definitions in YAML format.
24+
> Follow these rules:
25+
> 1. Use standard types: `text`, `number`, `boolean`, `select`, `date`, `lookup`.
26+
> 2. For relationships, use `type: lookup` with `reference_to: <object_name>`.
27+
> 3. Include `required: true` for important fields.
28+
> 4. Suggest 2-3 essential objects.
29+
>
30+
> Output the YAML for each object in a separate code block.
31+
32+
### Example: Real Estate CRM
33+
34+
**User:**
35+
> "I need a backend for a Real Estate Agency to track Properties and Agents."
36+
37+
**AI Output:**
38+
39+
```yaml
40+
# agent.object.yml
41+
name: agent
42+
fields:
43+
name:
44+
type: text
45+
required: true
46+
email:
47+
type: email
48+
required: true
49+
phone:
50+
type: phone
51+
license_number:
52+
type: text
53+
status:
54+
type: select
55+
options: [active, inactive]
56+
```
57+
58+
```yaml
59+
# property.object.yml
60+
name: property
61+
fields:
62+
address:
63+
type: textarea
64+
required: true
65+
price:
66+
type: currency
67+
bedrooms:
68+
type: number
69+
bathrooms:
70+
type: number
71+
listing_agent:
72+
type: lookup
73+
reference_to: agent
74+
status:
75+
type: select
76+
options: [for_sale, sold, pending]
77+
```
78+
79+
## Automating the Process
80+
81+
You can build tools to automate this loop.
82+
83+
### 1. The Generator Script
84+
Imagine a simple CLI tool that takes a user description and writes files to disk.
85+
86+
```typescript
87+
import { generateSchema } from './my-llm-service'; // Wrapper around OpenAI
88+
89+
async function main() {
90+
const description = process.argv[2];
91+
const schemas = await generateSchema(description);
92+
93+
for (const schema of schemas) {
94+
fs.writeFileSync(`${schema.name}.object.yml`, yaml.dump(schema));
95+
}
96+
97+
console.log("App generated! Starting server...");
98+
}
99+
```
100+
101+
### 2. Hot Reloading
102+
Since ObjectQL can load metadata at runtime, you can build **Self-Evolving Apps**.
103+
1. The App receives a request: "Add a 'renovation_date' field to Property."
104+
2. The App calls an LLM to update the YAML.
105+
3. The App reloads the metadata registry.
106+
4. The new field is immediately available via API.
107+
108+
## Summary
109+
110+
ObjectQL turns software development into a **Content Generation** task.
111+
Instead of generating complex imperative code (which is brittle), you generate simple declarative configurations (which are robust).

docs/ai/index.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,14 @@ ObjectQL resides at the intersection of Data and Artificial Intelligence. It is
77

88
## Overview
99

10+
### ✨ Generating Apps
11+
Turn natural language into full backend systems instantly. Because ObjectQL uses declarative YAML/JSON, LLMs can "write" software by simply generating configuration files.
12+
13+
* [Zero-Shot Generation](/ai/generating-apps)
14+
* [Prompt Templates](/ai/generating-apps#prompting-guide)
15+
16+
[Start Generating →](/ai/generating-apps)
17+
1018
### 🏗️ Building AI Apps
1119
Learn how to use ObjectQL as the data engine for your RAG (Retrieval-Augmented Generation) applications, semantic search, and AI agents.
1220

docs/guide/ide-setup.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# IDE Setup
2+
3+
To get the best experience developing with ObjectQL, we recommend Visual Studio Code with the following configuration.
4+
5+
## Visual Studio Code
6+
7+
We recommend using [VS Code](https://code.visualstudio.com/) as your primary editor.
8+
9+
### Recommended Extensions
10+
11+
**1. YAML (Red Hat)**
12+
Essential for editing `*.object.yml` files. It provides syntax highlighting and validation.
13+
[Install Extension](https://marketplace.visualstudio.com/items?itemName=redhat.vscode-yaml)
14+
15+
**2. JSON (Official)**
16+
For editing configuration files.
17+
18+
## AI Assistant Configuration
19+
20+
ObjectQL is designed to be "AI-Native". The most efficient way to write schema and hooks is by pairing with an LLM.
21+
22+
We strongly recommend configuring your AI Coding Assistant (GitHub Copilot, Cursor, Windsurf) with our specialized System Prompts. These prompts teach the AI about ObjectQL's metadata protocol.
23+
24+
[👉 Go to AI Coding Assistant Guide](/ai/coding-assistant)

0 commit comments

Comments
 (0)