Infactory Intelligent Queries are reusable analytics that can be deployed as APIs. Think of them as smart functions that understand your data.
Your First Query Program
Let’s start with a fundamental business question that every investor needs to answer.
1
Create Your First Query
After your data source is connected:
- Look for the “Build” section in the left sidebar
- Click the ”+” button next to “Build”
- A new “Untitled query” appears in the Build section
- The main area shows “Use the assistant to build a query”

2
Use the AI Assistant
Now let’s use Infactory’s AI Assistant to create your query:
- Click the “Assistant” button on the right side
- A text box appears with “Use our AI Assistant to ask questions about your data”
- Type your question in natural language
- “What’s the average closing price for each ticker?”
- “Show me the daily price change percentage for each stock”
- “Which stocks have the highest trading volume?”

Infactory’s AI understands your business context. Start with simple questions, then build more complex analytics as needed.
3
Review the Generated Query
Infactory’s AI Assistant generates a complete query program and displays it in the code editor:
You’ll see:

Generated query program code in the editor
- The complete query program code
- Clear variable definitions
- Comments explaining the logic
- Calculations based on your specific question
You can review and modify the code if needed. Infactory generates well-structured, readable code.
4
Test Your Query
Now run the query to see actual results:
Pretty tab: A formatted table and chart visualization (default)
- Click the “Run” button at the bottom right
- Results appear below the code editor with two view options:

Query results with Pretty and Raw view tabs
- Automatic chart visualization for quick insights
- Detailed data table below the chart
- Column headers and rows match your query
- Sortable columns, copy, and download options
- Complete API response in JSON format
- Includes metadata, execution trace, and timing information
- Useful for debugging or integrating with other systems
Success! Your query has executed and returned results. The data is now ready for analysis or deployment as an API.
Automatic Save: When you run a query successfully, Infactory automatically:
- Generates a descriptive name based on your query
- Saves the query program to your Build section
Pro Tips for Query Creation
Be Specific
Include exact metric names and calculation methods
Add Context
Explain why you need the query for better results
Test First
Always test before saving to ensure accuracy
Iterate Quickly
Refine queries based on test results
Query Management
After creating your queries, you’ll see them in your Query Library:
Your query library with all created programs
- 📝 Edit queries anytime
- 🔄 Clone and modify existing queries
- 📊 View usage statistics
Common Issues & Solutions
Query returns no results
Query returns no results
- Check column names match exactly
- Verify filters aren’t too restrictive
- Ensure data exists for your criteria
Calculations seem wrong
Calculations seem wrong
- Verify the formula logic in the query program
- Check for null values affecting calculations
- Test with known values to validate
Query takes too long
Query takes too long
- Add filters to reduce data volume
- Avoid complex nested calculations
- Contact support for optimization help
Ready to Deploy?
You’ve built a powerful suite of analytics queries. Now let’s turn them into production APIs!Continue to Deploy APIs
Transform your queries into live endpoints →
Progress Update: You’re about 4 minutes in and have created intelligent analytics that would typically take days to build. Next, we’ll deploy them as APIs!