Querying Data in DataGyro
As the core capability of DataGyro’s Search vertical, our platform provides powerful natural language querying capabilities designed specifically for LLM-powered applications. Skip the complex query languages and directly ask questions in plain English.Natural Language Querying
With DataGyro, you can query your collections using natural language questions or statements, making it incredibly easy to retrieve exactly what you need:- “Find all customer complaints from March 2025”
- “What were our top-selling products last quarter?”
- “Show me documents about machine learning”
- “Get information about API rate limiting from our docs”
API Integration
DataGyro’s querying is designed to be easily integrated with your LLM-powered applications through our streaming API. The query endpoint returns real-time updates via Server-Sent Events (SSE):Understanding Query Results
When you query a collection, DataGyro streams responses in real-time through Server-Sent Events. The final results are delivered in theresults event with information optimized for LLMs:
Stream Events
The query process returns four types of events:- Thoughts Event: Shows query processing insights including filters, traits, and key phrases
- SQL Event: Contains the generated SQL query used to retrieve data
- Results Event: Delivers the actual query results
- Close Event: Indicates the stream has completed
Results Structure
The results event contains an array of relevant items:- A unique identifier for the result
- The structured data from your dataset
- All available fields for the matched record
Optimizing Your Queries
While DataGyro handles most of the complexity automatically, here are some tips for getting the best results:Be Specific
More specific queries typically yield better results:- Less effective: “Tell me about our customers”
- More effective: “What are the most common customer complaints in the last month?”
Include Context
Providing context helps DataGyro understand exactly what you’re looking for:- Less effective: “What are our policies?”
- More effective: “What are our return policies for damaged electronics?”
Query Parameters
You can refine your queries with these parameters:query_string: The natural language query or questiondataset_id: The ID of the collection you want to querylimit: Maximum number of results to return (default: 10)use_smaller_model: Option to use a smaller model for faster processing (default: false)
Using Results with LLMs
The results from DataGyro queries are designed to be easily fed into LLM prompts. Since the API uses SSE streaming, you’ll collect results and then use them:Advanced Features
Semantic Search
DataGyro automatically uses semantic search to understand the meaning behind your queries, not just matching keywords. This enables more intuitive retrieval:- Users can ask questions in different ways but get consistent results
- Queries can match conceptually related content, not just exact phrase matches
- Results are ranked by semantic relevance, not just keyword frequency
Hybrid Search
For optimal results, DataGyro combines semantic search with traditional keyword search:- Get the precision of keyword matching when needed
- Benefit from the flexibility of semantic understanding
- Automatically balanced for best results based on your query
Query Understanding
DataGyro parses and analyzes natural language queries to extract:- Core information needs
- Important entities and relationships
- Time frames and other constraints
- Required context for proper retrieval