Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,10 @@ jobs:
with:
enable-cache: true
- run: uv python install 3.12
- run: uv sync --frozen
- run: uv run ruff check src tests scripts
- run: uv run ruff format --check src tests scripts
- run: uv sync --frozen --extra dashboard --extra dashboard-review
- run: uv run playwright install --with-deps chromium
- run: uv run ruff check src tests scripts dashboards
- run: uv run ruff format --check src tests scripts dashboards
- run: uv run vulture src --min-confidence 100
- run: uv run pytest -q
secrets:
Expand Down
24 changes: 24 additions & 0 deletions .streamlit/config.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
[server]
address = "127.0.0.1"
headless = true
fileWatcherType = "none"

[browser]
gatherUsageStats = false

[client]
toolbarMode = "minimal"
showErrorDetails = false

[theme]
base = "light"
primaryColor = "#176581"
backgroundColor = "#FAF9F6"
secondaryBackgroundColor = "#F0EEE8"
textColor = "#203646"
font = "sans-serif"
headingFont = "serif"
baseFontSize = 17
baseRadius = "small"
borderColor = "#D9D6CD"
showWidgetBorder = true
6 changes: 6 additions & 0 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,12 @@ infrastructure last. The agent's value is measured, not asserted.
Owner-selected specialist default: `chatgpt-plan/gpt-6.1-sol`, medium reasoning. The `analyze`
CLI resolves `--model`, then `BACKINTEL_ANALYSIS_MODEL`, then that built-in default.
Scripted integration proves wiring, not live model quality; automatic delegation stays off.
- `presentation/review.py`: optional rendered dashboard review after verified export,
also available through `dashboard review`. Native Anthropic reviewer, existing Sol
writer, at most two presentation-only revisions. Host-owned Playwright capture and
strict DesignPlan validation preserve numerical tables and chart bindings. Review
acceptance is separate from analytical completion. Install dashboard/dashboard-review
extras and Chromium; no browser capability is added to the offline analytical VM.
- Contract (`contracts.py`): the analyst returns an `AnalystAnswer` with `evidence` (the exact
SQL or Python that produced the number), `method` and `caveats`. Code re-executes the
evidence; an answer that cannot be reproduced from its evidence is scored as unsupported.
Expand Down
19 changes: 19 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ not a product version. Code is available under the [MIT license](LICENSE).
| Data engineering | Schema discovery, bounded profiling, read-only source queries and transformations inside a run | No production ETL orchestration, source writes or customer connector service |
| Data science | Descriptive analysis and executable calculation checks using Python/SQL | Forecasting, causal inference and trained predictive workflows are not validated capabilities |
| Reporting | HTML reports; bar, line, scatter, histogram and heatmap charts; PNG/SVG; offline interactive HTML; CSV and XLSX | Local file bundles with bounded tables; no hosted dashboard or automated delivery service |
| Dashboard stories | Automatic Streamlit dashboard and business workbook from completed analysis reports | Trusted local app over report tables; hosting and arbitrary custom app generation remain planned |
| Repeated analysis | Standing questions and historical snapshot replays that hide future observations | Replayed invocations, not a durable scheduler |
| Improvement | Versioned cases, reproducible evidence, LangSmith traces/scores and supervised candidate comparisons | No automatic weight training, deployment or self-promotion |

Expand Down Expand Up @@ -141,6 +142,24 @@ Use a **new output directory** for every run. A valid refusal explains the missi
it does not export a substitute report. A failed or unfinished analysis is not a successful
delivery. The example's figures are computed from the downloaded source, not hardcoded.

### Explore a dashboard story

The first Streamlit presentation turns the retained taxi analysis into a business story,
with readable measure names, focused charts, monthly exploration and a clean workbook.
Run IDs, hashes and execution traces stay outside the business view. See
[dashboard stories](docs/dashboard-stories.md) for setup, design guidance and current limits.
Every successful `analyze` run now also creates a `dashboard/` directory. Open it with
`uv run --extra dashboard backintel dashboard serve data/output/retail-report/dashboard`.
Existing reports can be converted with `backintel dashboard generate --report /path/to/report.json
--output /path/to/new-dashboard`. Generation makes no additional model calls.

An optional **visual design reviewer** inspects the rendered dashboard at desktop and
phone widths, checks navigation and downloads, and asks the writer for at most two
presentation revisions. Add `--review-dashboard` to `analyze`, or review a retained
dashboard with `backintel dashboard review`. The analyst/writer stays on Sol; the reviewer
uses the native Anthropic account. Scores and screenshots can be traced in LangSmith.
See [review setup, limits and commands](docs/dashboard-stories.md#design-review-and-revision).

### Configuration and credentials

BackIntel reads environment variables; it does not load `.env` files. Supply credentials
Expand Down
82 changes: 82 additions & 0 deletions dashboards/taxi/presentation.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
{
"title": "Planning taxi shifts with trip data",
"introduction": "The first proposed test is evening shift coverage. Compare airport and city pickup areas before moving vehicles.",
"context": {
"audience": "A historical case study for a taxi fleet manager.",
"decision": "The decision: when and where should we test different shift coverage?",
"coverage": "NYC Taxi and Limousine Commission yellow-taxi records, Jan–Mar 2025: 10.46 million trips after payment, fare and duration checks. This is citywide activity, not one company's fleet.",
"limitation": "Recorded trips do not reveal unmet demand, idle vehicles or operating costs. These records cannot establish profit."
},
"sections": [
{
"title": "1. The starting point",
"takeaway": "Daily trips increased across the quarter. Daily averages make months of different lengths comparable.",
"columns": 1,
"charts": [{
"chart": 0,
"title": "Average recorded trips per day",
"reading_guide": "One column per month; height shows its trip count divided by calendar days.",
"caption": "About 105,600 trips per day in January versus 124,100 in March. This establishes a busier historical baseline; it does not explain the increase or forecast the next quarter. Next, look at when those trips occurred.",
"encoding": "column",
"x_label": "Month",
"y_label": "Average recorded trips"
}]
},
{
"title": "2. When trips happen",
"takeaway": "Evenings are the first timing pattern to investigate. A small shift overlap is a more testable proposal than adding vehicles based on trip counts alone.",
"columns": 1,
"charts": [{
"chart": 1,
"title": "Which hours were busiest?",
"reading_guide": "Read down for the hour and across for the weekday. Darker cells mean more recorded pickups in an average occurrence of that hour. Times are New York local time.",
"caption": "Thursday 6–7 pm averaged 10,289 pickups across the city; Friday 6–7 pm averaged 9,761. These are averages across the quarter, not counts for one date. A suggested test is a limited evening overlap, measuring pickup waits and net receipts per available vehicle-hour against unchanged shifts.",
"encoding": "original",
"x_label": "Hour",
"y_label": "Day"
}]
},
{
"title": "3. Where to compare",
"takeaway": "Airports generate large fares, but a long airport queue could offset that advantage. Compare an airport waiting location with a city pickup area before moving vehicles.",
"columns": 1,
"charts": [{
"chart": 2,
"title": "Ten pickup areas with the most metered fares",
"reading_guide": "Longer bars mean a larger sum of meter fares from trips starting in that area. This measures fare volume, not the number of passengers or driver profit.",
"caption": "JFK contributed $24.33m and LaGuardia $11.49m. Yet Midtown Center had 485,609 trip records versus JFK's 383,928. An airport-versus-city test must include waiting, driving and repositioning time. The chart shows only the ten leading areas.",
"encoding": "original",
"x_label": "Pickup area",
"y_label": "Metered fares"
}]
},
{
"title": "4. The everyday trips",
"takeaway": "Do not focus only on high fares. Trips with meter fares below $20 make up most recorded trips, so a city route remains a useful comparison for any airport test.",
"columns": 1,
"charts": [{
"chart": 3,
"title": "How much did a typical trip cost on the meter?",
"reading_guide": "Each bar is the percentage of all eligible trip records in a meter-fare band. $10–<20 means at least $10 and less than $20. A fare band is not a distance band.",
"caption": "44.71% of trips had meter fares from $10 to under $20; another 28.45% were below $10. High ticket size alone does not establish productivity. Meter fares exclude separate taxes, tolls, tips and surcharges.",
"encoding": "original",
"x_label": "Meter fare",
"y_label": "Share of trip records"
}]
},
{
"title": "5. Check the monthly mix",
"takeaway": "Airport contribution changes by month. Recheck the mix when evaluating a trial instead of assuming the same airport share all year.",
"columns": 1,
"charts": [{
"chart": 4,
"title": "Where each month's meter fares came from",
"reading_guide": "Each cell is a percentage of that month's total meter fares. Read across a row to compare months. Use the printed percentages for the two airport rows; other pickup areas account for most fares.",
"caption": "JFK's share was 13.93% in January, 11.59% in February and 12.28% in March. These are shares of fares, not trips or profit. The next operational step is a small timing or location test with fresh data and measured costs—not a fleet-wide rollout from this historical quarter.",
"encoding": "original",
"x_label": "Month",
"y_label": "Pickup group"
}]
}
]
}
Loading
Loading