Refinement
Refinement is the iterative process of improving generated code after the initial generation pass:
Specification
Your .aexol file
Parse to AST
Syntax tree
AI Generation
Model + KB context
Output Code
TS, Python, Rust, Go, JS
Refinement Types
Via Remote MCP
Remote MCP
curl -X POST "https://api.aexol.ai/mcp" \
-H "Authorization: Bearer sk-aexol-team-..." \
-d '{
"jsonrpc": "2.0", "id": 1, "method": "tools/call",
"params": {
"name": "remote_refine_aexol_content",
"arguments": {
"content": "type User { id: string }",
"instruction": "Add email, name fields and UserRole enum"
}
}
}'Remote MCP
curl -X POST "https://api.aexol.ai/mcp" \
-H "Authorization: Bearer sk-aexol-team-..." \
-d '{
"jsonrpc": "2.0", "id": 1, "method": "tools/call",
"params": {
"name": "remote_refine_inference_artifact",
"arguments": {
"taskId": "task_...",
"instruction": "Add input validation, error handling, strict types"
}
}
}'Remote MCP
curl -X POST "https://api.aexol.ai/mcp" \
-H "Authorization: Bearer sk-aexol-team-..." \
-d '{
"jsonrpc": "2.0", "id": 1, "method": "tools/call",
"params": {
"name": "remote_refine_from_task",
"arguments": {
"taskId": "from_task_...",
"instruction": "Add workflow definitions for all entities"
}
}
}'MCP Tools
| Tool | What it refines |
|---|---|
remote_refine_aexol_content | Aexol spec (add fields, types, workflows) |
remote_refine_inference_artifact | Generated code artifact |
remote_refine_from_task | AI Import task result |
Knowledge Base Integration
When your project has Knowledge Base documents, refinement automatically incorporates your team's conventions. E.g., if KB says "all API responses use { data, error, meta } envelope", refinement will restructure code accordingly.
Best Practices
- Be specific —
"Add try/catch to all async functions and zod validation"not"Make it better" - Iterate incrementally — smaller, focused passes produce better results
- Use KB — upload conventions before refining
Next Steps
- Code Generation — Initial generation
- Artifacts — Managing output
- Knowledge Base — Context for refinement