Retail Mind
AI-powered retail data analysis API. Connect your database, ask questions in plain English, and get answers, insights, forecasts, and charts back over HTTP — from any tech stack.
Retail Mind is an API-first product. You bring your data, your AI provider, and your frontend. We handle the hard parts: schema discovery, NL-to-SQL, read-only enforcement, and streaming responses.
How it works
Your question (natural language)
→ Retail Mind finds relevant tables
→ Generates & validates SQL
→ Executes on your database (read-only)
→ Returns: answer + data + chart-ready JSONWhat you can do
- Query your data — Ask questions like “Top 10 products by revenue last quarter” and get SQL + natural language answers.
- Streaming responses — Use Server-Sent Events for real-time token streaming — watch answers appear word by word.
- Insights & anomalies — Run automated insight scans and detect unusual patterns in your retail data.
- Forecasting — Generate demand forecasts with AI-powered narrative interpretation.
Supported AI Providers
Connect your own AI key — or run fully local:
| Provider | Type | Notes |
|---|---|---|
| OpenAI | Cloud | GPT-4o, GPT-4o-mini |
| Anthropic | Cloud | Claude 3.7 Sonnet, Haiku |
| Google Gemini | Cloud | Gemini 1.5 Pro, Flash |
| Ollama | Local | Any model, no API key |
| LM Studio | Local | OpenAI-compatible local server |
| Custom | Self-hosted | Any OpenAI wire-format endpoint |
Supported Data Sources
| Source | Notes |
|---|---|
| PostgreSQL | Async, row-level limit enforcement |
| MySQL / MariaDB | Full schema discovery |
| SQLite | Great for development |
| BigQuery | Service account auth |
| Snowflake | Warehouse + role config |
| CSV / Excel | Loaded into DuckDB in-memory |
Quick Start
# 1. Get an API key
curl -X POST http://localhost:8000/v1/auth/keys \
-H "Content-Type: application/json" \
-d '{"name": "my-integration"}'
# 2. Connect a database
curl -X POST http://localhost:8000/v1/sources \
-H "Authorization: Bearer $API_KEY" \
-d '{"name":"My DB","source_type":"postgresql","credentials":{...}}'
# 3. Ask a question
curl -X POST http://localhost:8000/v1/query \
-H "Authorization: Bearer $API_KEY" \
-d '{"source_id":"...","question":"Top 5 products by revenue this month"}'