Introduction to Askalot¶
Askalot is an AI-powered survey platform with mathematical validation, designed to eliminate the cognitive overhead of maintaining logical coherence in complex questionnaires. The platform combines domain-specific language design with formal verification to ensure survey quality.
QML: Domain Specific Language for Questionnaires¶
QML (Questionnaire Markup Language) is a YAML-based domain-specific language designed specifically for AI-assisted questionnaire generation. QML uses declarative syntax with mathematical semantics, allowing AI to focus on question content while SMT solvers handle logical validation.
Why QML?¶
Current AI tools struggle with complex survey generation because Large Language Models face an overwhelming cognitive burden when attempting to simultaneously:
- Generate semantically meaningful questions
- Track conditional dependencies between questions
- Ensure logical consistency across all paths
- Maintain correct question ordering and flow
- Avoid contradictions and unreachable dead ends
QML solves this by separating concerns: AI generates questions, SMT validates logic:
- Declarative Syntax: Questions are defined with preconditions and postconditions, not sequential flows
- Mathematical Semantics: Every QML construct has formal mathematical meaning verified by Z3
- Separation of Concerns: AI generates meaningful questions while SMT solvers ensure logical consistency
- Human-Readable Format: YAML with diagram based navigation makes questionnaires accessible to non-programmers
This separation relieves AI from tracking complex conditional dependencies, logical consistency, and flow ordering—allowing it to focus solely on generating semantically meaningful questions while mathematical validation handles the complexity.
See QML Syntax for detailed documentation.
Questionnaire Presentation Format¶
Askalot uses a universal JSON format to represent questionnaire items for rendering, making integration into any application seamless. Each question in the questionnaire is delivered as a JSON response containing all necessary information to render the question item:
- Title and Description: Clear question text and optional help content
- Input Control Specification: Type of control (text, radio, checkbox, dropdown, etc.) with configuration
- Visual Hints: Layout preferences, validation messages, and conditional display rules
- Validation Rules: Real-time validation constraints derived from QML postconditions
Framework-Agnostic Design¶
This JSON representation makes integration dead simple because:
- No Predefined UI Components: Applications use their own UI framework's components
- No Custom CSS Required: Styling matches your existing application design
- Brand Consistency: Questions naturally adopt your application's look and feel
- Framework Flexibility: Works with React, Vue, Angular, vanilla JS, or any frontend technology
This approach enables any application to render questionnaires using its native components while maintaining full logical validation from the QML engine.
How It Works Together¶
The four services form an integrated workflow:
graph LR
A["<b>Armiger</b><br/>Design with AI<br/><<QML>>"] --> B["<b>Targetor</b><br/>Build Campaign"]
B --> C["<b>SirWay</b><br/>Execute Survey<br/><<JSON>>"]
C --> D["<b>Balansor</b><br/>Analyze Results<br/><<Parquet>>"]
style A fill:#e1f5ff
style B fill:#fff4e1
style C fill:#e8f5e9
style D fill:#f3e5f5
- Design in Armiger: AI generates QML questionnaire, SMT validates logical consistency, export QML file
- Campaign in Targetor: Import target audience, configure demographic parameters, launch campaign
- Execute in SirWay: Respondents complete surveys with guaranteed logical coherence, dynamic flow navigation
- Analyze in Balansor: Rebalance responses, correct sampling bias, export results in multiple formats
All services share a common authentication system and data repository, enabling seamless workflow integration.

Key Benefits¶
For Survey Designers¶
- AI assistance: Generate questionnaires from natural language descriptions
- Error prevention: Mathematical validation catches logical flaws automatically
- No manual dependency tracking: System handles question order and conditional logic
- Confidence: Know that deployed surveys are logically sound
For Respondents¶
- Smooth experience: Never encounter contradictory questions
- Relevant questions: Only see questions that apply to their situation
- No dead ends: Guaranteed to complete surveys that are reachable
- Dynamic adaptation: Survey adapts based on previous answers
For Analysts¶
- Quality data: Logical validation ensures response consistency
- Representative samples: Targetor enables demographic balancing
- Statistical correction: Balansor adjusts for sampling bias
- Standard formats: Export to familiar analysis tools
Formal Verification in Practice¶
Traditional survey platforms require designers to manually ensure:
- Questions appear in the correct order
- Conditional logic doesn't create contradictions
- All questions are reachable
- Validation rules are mutually consistent
Askalot automates all of this through mathematical verification. Here's a simple questionnaire example:
flowchart TD
q_age["q_age: What is your age?"]
q_consent["q_consent: Do you consent to participate?"]
q_children["q_children: How many children do you have?"]
q_household["q_household: How many people live in your household?"]
q_end["q_end: Thank you for participating!"]
q_age e1@==> q_consent
q_consent e2@==> q_household
q_household e3@==> q_children
q_children e4@==> q_end
%% BEGIN_PRECONDITIONS
q_consent ---- q_consent_precond_0(["q_age.outcome >= 18"])
q_consent_precond_0 -..-> q_age
q_children ---- q_children_precond_0(["q_household.outcome > 1"])
q_children_precond_0 -..-> q_household
%% END_PRECONDITIONS
%% BEGIN_POSTCONDITIONS
q_children ---- q_children_postcond_0{{"q_children.outcome < q_household.outcome"}}
%% END_POSTCONDITIONS
%% BEGIN_ITEM_STYLING
q_age:::always
q_consent:::conditional
q_household:::always
q_children:::conditional
q_end:::always
%% END_ITEM_STYLING
%% BEGIN_CONDITION_STYLING
q_consent_precond_0:::precondition
q_children_precond_0:::precondition
q_children_postcond_0:::postcondition
%% END_CONDITION_STYLING
classDef default fill:#F9F9F9,stroke:#333,stroke-width:2px
classDef always fill:#00CC00,stroke:#000,stroke-width:2px
classDef conditional fill:#FFCC00,stroke:#000,stroke-width:2px
classDef precondition fill:#F5F5DC,stroke:#000,stroke-width:1px
classDef postcondition fill:#E6F0FF,stroke:#000,stroke-width:1px
e1@{ animate: true }
e2@{ animate: true }
e3@{ animate: true }
e4@{ animate: true }
The SMT solver automatically verifies:
- Reachability: Green nodes (ALWAYS reachable), yellow nodes (CONDITIONAL on preconditions)
- Preconditions: Rounded nodes show when questions appear (e.g., consent only if age ≥ 18)
- Postconditions: Curly nodes validate answers (e.g., children < household size)
- Consistency: All constraints are simultaneously satisfiable
This happens instantly during design in Armiger, not after deployment when problems are discovered by confused respondents.