О проекте
Команда: Deadline Driven
Кейс HackAlem.ai: Телеком — Beeline
Стадия: Рабочий MVP
Задача кейса: Агент, который решает, каким абонентам какой тариф предложить (чистый прирост ARPU)
Суть
Маркетинговый ассистент для Beeline: агент сегментирует абонентов, проводит пилоты через env.run_pilot и формирует план кампаний; результаты показываются в React-дашборде.
Как устроено
Agent.act(env) сегментирует по текущему тарифу и ARPU (при необходимости по трафику и звонкам), ранжирует гипотезы переходов тарифов по историческим данным, проводит пилоты, обновляет оценки эффекта с учётом неопределённости и выбирает кампании в пределах бюджета и лимита контактов. FastAPI ставит запуски в очередь, run_report.py оценивает результат через scoring_core.py, дашборд показывает кампании, историю пилотов, чистый прирост выручки и затраты, есть экспорт CSV. LLM не используется.
Ключевые решения
- сегментация по тарифу/ARPU
- адаптивные пилоты
- оценка эффекта с неопределённостью
- отбор с учётом бюджета и лимита контактов
- fallback-кампания
Особенности
Дашборд с асинхронной очередью запусков (queued/running/completed/failed), результаты сохраняются между перезапусками; есть отдельные benchmark и holdout-файлы, отчёты по hardening агента.
Стек
Python · FastAPI · Uvicorn · pandas · NumPy · React 19 · TypeScript · Vite · PowerShell
Проект создан за 5 часов на финале хакатона HackAlem.ai (23 сентября 2026, Астана). Код — BAITC-Hacks/hack-2804924d-deadline-driven.
README
README.mdBeeline Campaign AI
Team Deadline Driven | HackAlem Hackathon | Telecommunications Track
Project Overview
A marketing assistant that helps Beeline decide which customers to contact, which tariff to offer, and which communication channel to use to increase revenue without wasting the campaign budget.
The agent analyzes customer profiles and historical tariff changes, tests ideas on small groups, and produces a final marketing campaign plan.
This is not a service that finds the cheapest or "perfect" tariff for each subscriber. Its primary user is a marketing analyst. The objective is to increase the operator's revenue after communication costs, within the case limits.
The complete dashboard, Python API, agent, and case data are included in this repository. Use the instructions below to run the project locally.
Problem and Target User
A tariff change does not always benefit the operator: a subscriber may start paying less, while SMS, advertising, and calls also cost money. Contacting the entire customer base without testing can therefore be unprofitable.
The agent helps marketing analysts identify promising audiences and offers, test their assumptions, and allocate limited resources.
Three Key Terms
| Term | Meaning |
|---|---|
| Campaign | A selected audience, a target tariff, and a communication channel |
| Pilot | A small trial campaign used to estimate the effect of an offer |
| Campaign plan | The final set of campaigns selected after testing |
For example, the agent can test a tariff offer on a small customer group. If the estimated effect looks promising after accounting for cost and uncertainty, the offer may be included in the final plan. Profit is not guaranteed.
Implemented Features
- Analysis of customer profiles and historical tariff transitions.
- Segmentation by current tariff and ARPU, with additional data-usage and call-usage splits when needed. ARPU means average revenue per user.
- Pilot campaigns through the hackathon environment's public
env.run_pilot(...)method. - Campaign and channel selection based on estimated effects, uncertainty, budget, and contact limits.
- Background agent runs through the API, with progress states and error handling.
- A web dashboard with final campaigns, pilot history, net revenue gain, total costs, and remaining budget.
- CSV export from the stored run result without executing the agent again.
- Standalone agent evaluation and submission generation without the website.
Campaigns, pilots, and metrics displayed in the dashboard come from the backend and belong to the same run. They are calculated in the demo environment, not hardcoded sample results.
How It Works
- The analyst opens the dashboard and uses the agent launch button.
- The backend creates a run and loads the customer profile and demo environment.
- The agent builds customer segments and ranks tariff-transition hypotheses using historical data.
- It conducts pilots, updates effect estimates, and accounts for uncertainty.
- It selects a campaign plan within the remaining budget and contact limits.
- The backend evaluates the pilots and final plan using
scoring_core.py. - The dashboard shows the results and allows the analyst to export the plan as CSV.
The agent runs once per API run. Costs include both pilots and final campaigns. The reporting layer computes evaluation metrics; the agent itself does not receive private scoring inputs.
If no conservatively profitable plan is found, a fallback can select a feasible campaign. This does not guarantee a positive result.
The current application is a simulation. No real subscribers are contacted, and no real campaign money is spent.
Technology Stack
| Component | Technologies |
|---|---|
| Frontend | React 19, TypeScript 6, Vite 8, CSS, Lucide React |
| Backend | Python, FastAPI, Uvicorn |
| Agent and data processing | pandas, NumPy, heuristic selection with uncertainty estimates |
| Environment and evaluation | Hackathon SDK: environment.py, mock_environment.py, scoring_core.py |
| Data formats | JSON, CSV |
| Windows launcher | PowerShell |
| Checks included in the repository | Python unittest, Node.js test runner, ESLint, TypeScript |
External AI models: the current agent does not call OpenAI, NVIDIA, or other LLM services. Its strategy is implemented in Python. No API keys or paid model tokens are required. Internet access is needed for initial dependency installation.
Architecture
React dashboard
|
| /api via the local Vite proxy
v
FastAPI: run creation, queue, and status
|
v
run_report.py
|
+--> Agent.act(env): data -> hypotheses -> pilots -> campaign plan
|
+--> scoring_core.py: demo evaluation
|
v
Run result stored in API memory
|
+--> JSON: campaigns, metrics, pilots
+--> submission.csv
Main Components
| Path | Responsibility |
|---|---|
frontend/src/App.tsx | Dashboard and run states |
frontend/src/api.ts | API requests and response validation |
frontend/vite.config.ts | Proxy to the Python API |
backend/agent.py | Strategy implemented as Agent.act(env) |
backend/api.py | HTTP endpoints and run queue |
backend/run_report.py | Combined campaign, metric, and pilot report |
backend/environment.py | Public environment interface |
backend/mock_environment.py | Local demo environment |
backend/scoring_core.py | Strategy validation and evaluation |
backend/local_eval.py | Standalone agent evaluation |
backend/make_submission.py | Submission CSV generation |
backend/data/ | Case datasets |
start.ps1, stop.ps1 | Start and stop the local application |
HTTP API
| Method and Path | Purpose |
|---|---|
GET /health | Check service availability |
POST /runs | Create a run and return its run_id |
GET /runs/{run_id} | Read the run status |
GET /runs/{run_id}/result | Retrieve completed campaigns, metrics, and pilots |
GET /runs/{run_id}/submission | Download the same run's CSV |
POST /preview | Perform a separate synchronous calculation |
Run states are queued, running, completed, and failed.
The frontend polls once per second and stops on failure.
Unknown runs return HTTP 404; results that are not ready return HTTP 409.
Installation and Startup
Requirements
- Windows and PowerShell for the combined launcher.
- Python 3.12+ with
venvandpip. - Node.js 22.12+ or 24+, with npm.
- Git and access to the team repository.
Quick Start
Run the following in PowerShell:
git clone https://github.com/BAITC-Hacks/hack-2804924d-deadline-driven.git HackAlem
cd HackAlem
powershell -NoProfile -ExecutionPolicy Bypass -File .\start.ps1
If you already have the working application locally, open PowerShell in its root directory and run only the startup command.
The script creates .venv, installs missing dependencies, and starts the backend
and frontend in the background.
- Default dashboard: http://localhost:5173.
- Default API documentation: http://127.0.0.1:8000/docs.
If a port is occupied, the launcher selects another one.
Use the actual URLs printed in the terminal. Logs are stored in .run/.
If Python is not detected automatically, specify your interpreter path:
powershell -NoProfile -ExecutionPolicy Bypass -File .\start.ps1 -Python C:\Python312\python.exe
Add -Install to reinstall dependencies from the project dependency files.
To stop the servers started by the launcher:
powershell -NoProfile -ExecutionPolicy Bypass -File .\stop.ps1
Manual Startup
In the first terminal, from the project root:
py -3.12 -m venv .venv
.\.venv\Scripts\python.exe -m pip install -r backend\requirements.txt
.\.venv\Scripts\python.exe -m uvicorn api:app --app-dir backend --host 127.0.0.1 --port 8000
In a second terminal, from the project root:
cd frontend
npm.cmd ci
npm.cmd run dev -- --host 127.0.0.1 --port 5173
Vite proxies /api to http://127.0.0.1:8000 by default.
Set API_TARGET before starting Vite to use a different backend address.
Verification for Judges
Dashboard Walkthrough
- Start the application and open the dashboard URL printed in the terminal.
- Use the agent launch button and wait for the calculation to finish.
- Inspect the selected audiences, target tariffs, and channels in the final plan.
- Review the pilot history, net revenue gain, total costs, and remaining budget.
- Use the CSV export button to download the final campaigns from that run.
The exported CSV contains final campaigns, not pilot records or financial metrics.
The demo API uses a fixed seed=42 for reproducibility. It does not evaluate
against the organizers' hidden effects.
Standalone Agent Evaluation
After installing the Python dependencies, run these commands from the project root:
cd backend
..\.venv\Scripts\python.exe local_eval.py
..\.venv\Scripts\python.exe make_submission.py
The first command prints an evaluation report. The second creates
backend/submission.csv with these columns:
campaign_name,filter_arpu_segment,filter_data_segment,filter_call_segment,filter_current_tariff,target_tariff,channel
An optional multi-seed check is available:
..\.venv\Scripts\python.exe local_eval.py --runs 10
Submission artifacts are agent.py, the generated submission.csv, and the
dependency file. The website and FastAPI are not required to invoke Agent.act(env).
Data and Integrations
The application uses synthetic data supplied with the hackathon case, not a real customer database. Monetary values are in arbitrary units, and tariff identifiers do not represent Beeline's current commercial plans.
| Source | Contents and Use |
|---|---|
backend/customer_profile.csv | Profiles of 23,441 subscribers, current tariffs, segments, and predicted ARPU |
backend/data/change_tariff.csv | Historical tariff changes and ARPU before and after; used by the agent |
backend/data/arpu_monthly.csv | Additional monthly revenue history included in the case package |
backend/data/traffic.csv | Additional usage data included in the case package |
backend/data/dict_tariff.csv, backend/tariff_dictionary.csv | Tariff dictionaries |
backend/feature_dictionary.csv | Feature descriptions |
The strategy directly uses customer profiles, transition history, and tariff and channel parameters exposed by the environment. It does not directly use the additional monthly revenue and traffic files.
The frontend integrates with the project's own FastAPI service. There are no live CRM, billing, SMS-provider, or advertising-platform integrations.
Constraints and Limitations
Hackathon Constraints
- Between 1 and 10 final campaigns, with up to 5,000 subscribers per campaign.
- Up to 20 pilots, each involving 10-200 subscribers.
- Up to 15,000 total contacts, including pilots.
- A total budget of 100,000 arbitrary units for pilots and final campaigns combined.
- Each subscriber's effect is counted once, using their best campaign.
- Agent execution must take no more than 10 minutes.
See the participant guide for the original case requirements.
Current Application Limitations
- Mock-environment results do not guarantee the same judging score or real-world profit.
- The strategy is heuristic and does not guarantee a globally optimal plan.
- There is no dataset upload through the dashboard; the application uses project files.
- Runs are stored in memory and disappear when the API restarts.
- Calculations execute sequentially. Run the backend with one Uvicorn process, not multiple workers.
- Authentication, persistent storage, and production infrastructure are not implemented.
- Direct browser requests are allowed from
localhost:5173and127.0.0.1:5173; the combined launcher uses the Vite proxy. - A static frontend build does not include the Python API. Separate deployment requires a running backend, API routing, and appropriate allowed origins.
- The application produces plans and calculations; it does not send real offers.
Deployment
No public deployment URL is documented in the repository. The demonstration runs
locally using the instructions above. localhost and 127.0.0.1 are local
addresses, not public deployment links.
Авторы коммитов
История коммитов
- 2026-09-23 17:22Integrate final campaign dashboard, validated agent and persistent APIDikiy Asset
- 2026-09-23 16:59docs: publish complete English project READMEDikiy Asset
- 2026-09-23 16:57Document full project setup and integration statusIskander
- 2026-09-23 16:54docs: explain Beeline Campaign AI on the main repository pageDikiy Asset
- 2026-09-23 16:35docs: write Russian project README for hackathon juryDikiy Asset
- 2026-09-23 16:22Integrate campaign dashboard with agent API, metrics and pilotsDikiy Asset
- 2026-09-23 16:11Merge agent strategy into backend APIIskander
- 2026-09-23 15:50Harden campaign agent and add reproducible validationJackSokolov
Все коммиты (15)
- 2026-09-23 15:24Persist agent runs across server restartsIskander
- 2026-09-23 14:57Add pilot history and campaign metricsIskander
- 2026-09-23 14:44Restore team repository READMEDikiy Asset
- 2026-09-23 14:42Add Beeline Campaign AI frontendDikiy Asset
- 2026-09-23 14:40Initialize frontend repositoryDikiy Asset
- 2026-09-23 14:30Add adaptive tariff campaign agent, tests and reproducible submissionJackSokolov
- 2026-09-23 14:28Add campaign agent backend and APIIskander
Структура репозитория (70 файлов)
.gitignore README.md backend/.gitignore backend/BENCHMARK.md backend/HARDENING.md backend/PARTICIPANT_GUIDE.md backend/PARTICIPANT_GUIDE.pdf backend/README.md backend/STRATEGY.md backend/agent.py backend/agent_confirmed.py backend/agent_template.py backend/api.py backend/benchmark.py backend/benchmark_holdout.json backend/benchmark_results.json backend/customer_profile.csv backend/data/arpu_monthly.csv backend/data/change_tariff.csv backend/data/dict_tariff.csv backend/data/traffic.csv backend/demo_report.json backend/environment.py backend/export_demo.py backend/feature_dictionary.csv backend/integration.py backend/local_eval.py backend/make_submission.py backend/mock_environment.py backend/requirements-tested.txt backend/requirements.txt backend/run_report.py backend/run_storage.py backend/scoring_core.py backend/submission.csv backend/tariff_dictionary.csv backend/test_agent.py backend/test_agent_confirmed.py backend/test_run_report.py backend/test_run_storage.py backend/test_validation.py backend/validation.py backend/validation_runs10.txt backend/validation_seed42.txt backend/verification.json backend/verify_submission.py frontend/.gitignore frontend/README.md frontend/eslint.config.js frontend/index.html frontend/package-lock.json frontend/package.json frontend/public/favicon.svg frontend/public/icons.svg frontend/src/App.css frontend/src/App.tsx frontend/src/api.ts frontend/src/assets/beeline-logo.png frontend/src/assets/hero.png frontend/src/assets/react.svg frontend/src/assets/vite.svg frontend/src/index.css frontend/src/main.tsx frontend/tests/api.test.ts frontend/tsconfig.app.json frontend/tsconfig.json frontend/tsconfig.node.json frontend/vite.config.ts start.ps1 stop.ps1
Обсуждение 0 комментариев
Войдите, чтобы комментироватьПока нет комментариев — будьте первым.