You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# 1. Clone and setup
git clone https://github.com/demir-dev/olap-project.git
cd olap-project
cp .env.example .env
# Edit .env → add your ANTHROPIC_API_KEY# 2. Build and run
make build
make up
# 3. Open browser# Frontend: http://localhost:3000# API Docs: http://localhost:8000/docs
# Terminal 2 — Frontendcd frontend
npm install
npm run dev
# Open http://localhost:5173
Environment Variables
Variable
Required
Default
Description
ANTHROPIC_API_KEY
Yes
—
Anthropic API key (get at console.anthropic.com)
DATABASE_PATH
No
data/olap.duckdb
DuckDB file path
LLM_MODEL
No
claude-3-haiku-20240307
Anthropic model ID
CORS_ORIGINS
No
localhost origins
Allowed CORS origins (JSON array)
SESSION_TTL_MINUTES
No
30
Session expiry
LOG_LEVEL
No
INFO
Logging level
Without an API key: The system still works for all OLAP operations. Intent classification uses keyword rules and narratives use templates. Set ANTHROPIC_API_KEY to enable LLM-powered natural language understanding and narrative generation.
API Endpoints
Method
Path
Description
POST
/chat
OLAP chat — send question, get results
GET
/schema
Star schema metadata + dimension values
GET
/health
Backend health check
GET
/docs
Interactive Swagger UI
Example Chat Request
curl -X POST http://localhost:8000/chat \
-H "Content-Type: application/json" \
-d '{"message": "What is total revenue by region for 2024?", "session_id": null}'
OLAP Operations Supported
Operation
Example Question
Slice
"Show only 2024 data"
Dice
"Electronics sales in Europe for Q4 2024"
Drill-Down
"Break down 2024 revenue by quarter, then by month"
Roll-Up
"Summarize monthly data at the quarterly level"
Compare
"Compare 2023 vs 2024 revenue by region"
Pivot
"Pivot region by quarter showing revenue"
Drill-Through
"Show me the raw transactions for Electronics in Q4"
KPI
"Top 5 countries by profit margin"
Anomaly
"Are there any unusual spikes in monthly revenue?"
Dataset
Global Retail Sales — 10,000 synthetic transactions
Time: January 2022 – December 2024
Regions: North America, Europe, Asia Pacific, Latin America