SparkLite AI is a conversational data analysis tool that transforms how you interact with your sales data. Instead of writing complex queries or formulas, simply ask questions in plain English and get instant insights, visualizations, and summaries.
This isn't just another data visualization tool. SparkLite AI remembers your conversations, learns from your corrections, and provides context-aware responses that get smarter over time. It's like having a data analyst who actually listens and improves with every interaction.
- Remembers your previous questions and corrections
- Builds context from your conversation history
- Learns your preferences and analysis patterns
- Provides more accurate responses based on past interactions
- Ask questions in plain English: "Show me sales trends by region"
- No need to learn SQL or complex formulas
- Understands business terminology and context
- Handles follow-up questions intelligently
- Creates charts and graphs automatically based on your data
- Supports bar charts, line graphs, and pie charts
- Smart chart type selection based on data patterns
- Interactive visualizations using Plotly
- Provides narrative explanations of your data
- Highlights key insights and patterns
- Explains what the numbers actually mean
- Contextualizes findings within your business
- Upload CSV or JSON files up to 20MB
- Automatic data profiling and structure detection
- Handles various data formats and structures
- Real-time data validation and error handling
- Python 3.8 or higher
- OpenAI API key (for code generation)
- Groq API key (for AI responses)
- Clone the repository:
git clone <repository-url>
cd sparklite-ai- Install dependencies:
pip install -r requirements.txt- Set up your environment variables:
Create a
.envfile in the root directory:
OPEN_AI_KEY=your_openai_api_key_here
GROK_API_KEY=your_groq_api_key_here
- Run the application:
streamlit run main.py- Click "Browse files" and select your CSV or JSON file
- Maximum file size: 20MB
- Supported formats: CSV, JSON (flat or nested)
Once uploaded, you'll see:
- Total rows and columns
- First 5 rows preview
- Column information with data types
- Null value counts
Try questions like:
- "What are the total sales by region?"
- "Show me the top 10 products by revenue"
- "Which sales person performed best last month?"
- "Create a chart showing sales trends over time"
For each question, you'll receive:
- Analysis Results: Tables, numbers, or text answers
- Visualizations: Automatic charts when relevant
- AI Summary: Plain English explanation of findings
- Generated Code: View the Python code that created the analysis
"Show me total sales by region"
"Which products have the highest profit margins?"
"Compare this quarter's performance to last quarter"
"Who are our top 5 customers by revenue?"
"What's the average order value by customer segment?"
"Show customer retention rates over time"
"Which products are selling best?"
"Show inventory turnover by product category"
"What's the seasonal trend for each product line?"
Natural Language Service (services/natural_language_service.py)
- Handles conversation flow and context management
- Processes user queries and maintains chat history
- Manages memory and learning from corrections
Code Generator (services/code_generator.py)
- Converts natural language to Python/Pandas code
- Executes analysis code safely in isolated environment
- Formats results for display
AI Generator (services/ai_generator.py)
- Manages API connections to Groq/OpenAI
- Handles API key rotation for reliability
- Provides safe completion methods
Visualization Engine (services/visualization.py)
- Automatically detects appropriate chart types
- Creates interactive Plotly visualizations
- Supports bar, line, and pie charts
AI Narration (services/ai_naration.py)
- Generates human-readable summaries
- Explains data insights in business context
- Provides two-sentence explanations of findings
- User uploads data file (CSV/JSON)
- System profiles data structure and columns
- User asks question in natural language
- AI converts question to Python/Pandas code
- Code executes safely against the data
- Results are formatted and visualized
- AI generates narrative summary
- Everything is displayed in an organized interface
The app uses custom Streamlit configuration in .streamlit/config.toml:
[theme]
primaryColor = "#1f77b4"
backgroundColor = "#ffffff"
secondaryBackgroundColor = "#f0f2f6"
textColor = "#262730"OPEN_AI_KEY: OpenAI API key for code generationGROK_API_KEY: Groq API key(s) for AI responses (comma-separated for multiple keys)
SparkLite AI maintains several types of memory:
- Stores last 20 messages with timestamps
- Provides context for follow-up questions
- Enables reference to previous analyses
- Remembers when you correct or clarify responses
- Applies learned corrections to future similar questions
- Improves accuracy over time
- Tracks types of analyses you perform most
- Remembers successful code patterns
- Suggests relevant follow-up questions
File Upload Problems
- Ensure file is under 20MB
- Check that CSV has proper headers
- Verify JSON structure is valid
API Key Issues
- Verify API keys are correctly set in
.env - Check API key permissions and quotas
- Ensure no extra spaces in environment variables
Analysis Errors
- Try rephrasing your question more specifically
- Reference actual column names from your data
- Use the "Clear History" button to reset context
- Check the generated code to understand what went wrong
- Use conversation history to see previous successful patterns
- Try simpler questions first, then build complexity
This project welcomes contributions! Areas where you can help:
- Adding new visualization types
- Improving natural language understanding
- Enhancing memory and context features
- Adding support for more data formats
- Optimizing performance for larger datasets
Created by: Ermiyas Developer
Website: https://ermiyas.dev
Contact: inbox@ermiyas.dev
SparkLite AI was built with a focus on making data analysis accessible to everyone, regardless of technical background. The goal is to democratize data insights through conversational AI.
This project is licensed under the MIT License - see the LICENSE file for details.
SparkLite AI - Making data analysis as easy as having a conversation.