An agent-assisted Business Intelligence system that converts datasets + natural language queries into validated insights and renderable dashboards.
X-101 is a compiler-like system that:
- Input: User-uploaded dataset (CSV/XLSX) + natural language query
- Output: Validated Insight JSON + dashboard definition OR structured error
The system is designed around determinism and correctness. It will never guess and will fail loudly on ambiguity.
Dataset + Query
β
Orchestrator Agent (Intent Classification)
β
Schema Intelligence Agent (Column Profiling)
β
Metrics Agent (Metric Mapping)
β
Validator Agent (Final Validation)
β
Insight JSON β Frontend Renderer β Dashboard
| Agent | Responsibility | Constraints |
|---|---|---|
| Orchestrator | Identity intent, control flow | No data inspection, no schema reasoning |
| Schema Intel | Profile columns, classify fact/dimension | No column invention, no fuzzy matching |
| Metrics | Map to supported metrics | No custom metrics, no guessing |
| Validator | Final validation authority | No partial passes, no retries |
churn- Customer churn analysisretention- Customer retention analysisactive_users- User activity analysisrevenue- Revenue/transaction analysis
- Python 3.11+
- Node.js 18+
- OpenRouter API key (get one here)
# Navigate to backend
cd backend
# Create virtual environment
python -m venv venv
venv\Scripts\activate # Windows
# source venv/bin/activate # macOS/Linux
# Install dependencies
pip install -r requirements.txt
# Copy environment file and add your API key
copy ..\.env.example ..\.env
# Edit .env and add your OPENROUTER_API_KEY
# Run the server
python -m uvicorn main:app --reload --host 0.0.0.0 --port 8000# Navigate to frontend
cd frontend
# Install dependencies
npm install
# Run development server
npm run dev# From project root
python scripts/generate_test_data.pyThis creates three test datasets in test_data/:
churn_data.csv- Customer churn dataactivity_data.csv- User activity datarevenue_data.csv- Transaction data
Upload a dataset and analyze with a natural language query.
Request:
Content-Type: multipart/form-data
file: <CSV or XLSX file>
query: "Build a churn dashboard"
Success Response:
{
"success": true,
"data": {
"metric": "churn",
"time_grain": "monthly",
"facts": ["monthly_revenue", "churned"],
"dimensions": ["subscription_plan", "country"],
"time_column": "signup_date",
"charts": [
{
"type": "line",
"x": "signup_date",
"y": "churn_rate",
"title": "Churn Rate Over Time"
}
],
"assumptions": ["Churn defined as no activity in last 30 days"],
"confidence": 0.85
}
}Error Response:
{
"success": false,
"error": {
"code": "UNSUPPORTED_INTENT",
"message": "Unable to map query to a supported analytical goal",
"details": {
"query": "...",
"supported_goals": ["churn", "retention", "active_users", "revenue"]
}
}
}Get supported features.
Health check endpoint.
x101/
βββ backend/
β βββ agents/ # Four agent implementations
β β βββ orchestrator.py
β β βββ schema_intel.py
β β βββ metrics.py
β β βββ validator.py
β β βββ llm_client.py # LiteLLM wrapper
β βββ models/ # Pydantic models
β β βββ insight.py # InsightJSON schema
β β βββ errors.py # Structured errors
β βββ pipeline/ # Pipeline coordinator
β βββ utils/ # File handling, logging
β βββ config.py # Configuration
β βββ main.py # FastAPI app
β βββ requirements.txt
βββ frontend/
β βββ app/ # Next.js App Router
β βββ components/ # React components
β βββ lib/ # API client
β βββ package.json
βββ scripts/
β βββ generate_test_data.py
βββ test_data/ # Generated test datasets
βββ .env.example
All settings are configured via environment variables (.env file):
| Variable | Description | Default |
|---|---|---|
OPENROUTER_API_KEY |
OpenRouter API key | (required) |
DEFAULT_MODEL |
LLM model to use | openrouter/mistralai/mistral-7b-instruct |
CONFIDENCE_THRESHOLD |
Minimum confidence score | 0.75 |
MAX_DIMENSION_CARDINALITY |
Max unique values per dimension | 100 |
MAX_FILE_SIZE_MB |
Max upload file size | 50 |
ENABLE_REPLAY_LOGGING |
Enable determinism logs | true |
# OpenRouter (free tier)
DEFAULT_MODEL=openrouter/mistralai/mistral-7b-instruct
DEFAULT_MODEL=openrouter/meta-llama/llama-3-8b-instruct
# Google
DEFAULT_MODEL=gemini/gemini-1.5-flash
# OpenAI
DEFAULT_MODEL=openai/gpt-4o
# Anthropic
DEFAULT_MODEL=anthropic/claude-3-sonnetline- Time series trendsbar- Categorical comparisonspie- Distribution/proportionarea- Cumulative trendsscatter- Correlation analysisheatmap- Matrix visualizationfunnel- Conversion flowsradial_bar- Radial comparisons
X-101 is not designed to sound intelligent.
X-101 is designed to be right or silent.A correct refusal is a success.
- Correctness over convenience - Never guess, fail loudly
- Determinism - Same input always produces same output
- No hidden state - All inputs/outputs are logged
- Fail fast - Reject early, don't paper over issues
- Frontend is dumb - Pure renderer, no AI logic
MIT