- Embedded B2B banking recommendation platform for client channels, RM tools, and internal banking decisioning.
- FastAPI prod API, separate sandbox service/UI, dedicated background worker, DB-backed offer registry, source-ingestion staging, materialized snapshots/features, feedback-driven learning loop, offline ranking-model training, Kafka events, Prometheus metrics, Postgres audit.
- Docker Compose environment for local development and manual testing.
- Normalize client profile, relationship, transactions, and risk signals into a banking snapshot.
- Build explainable next-best-actions such as acquiring, credit line, overdraft, factoring, payroll, tariff optimization, FX tools, liquidity alerts, and treasury offers.
- Track recommendation history and client reaction, apply frequency capping, and adapt scores from acceptance/rejection feedback.
- Serve a dedicated sandbox UI for manual testing with synthetic B2B clients and scenarios.
- Materialize client snapshots and features from relational banking tables.
- Keep offer catalog and policy rules in a DB-backed registry with admin endpoints and JSON seed assets.
- Drain Kafka events from a durable outbox via a dedicated worker and run scheduled materialization refreshes.
- Load production-like source extracts into staging and merge them into normalized banking tables.
- Build a feature store and retrain bounded ranking models from recommendation history and feedback.
- Use an admin UI for registry edits, ingestion, retraining, DLQ, and ops checks.
- Provide synthetic data generator in
services/b2b-rec-service/app/demo_bank_data/.
app/domain/decisioning/contains pure business logic for catalog, feature extraction, policy, explanations, and ranking.app/application/orchestrates use cases, request flows, and runtime assembly.app/infrastructure/contains adapters for LLM, learning, repositories, and persistence wrappers.app/interfaces/http/exposes separateprodandsandboxFastAPI applications.
- Prod API:
http://localhost:8010 - Sandbox UI/API:
http://localhost:8011 - Prod admin UI:
http://localhost:8010/admin/ui - Sandbox admin UI:
http://localhost:8011/admin/ui - Background worker:
b2b-rec-worker
POST /api/v1/recommendationsPOST /api/v1/recommendations/feedbackGET /api/v1/internal/banking/clientsGET /api/v1/internal/banking/clients/{client_id}/snapshotPOST /api/v1/internal/recommendations/by-client/{client_id}GET /api/v1/internal/analytics/client/{client_id}GET /api/v1/internal/ops/statusPOST /api/v1/admin/registry/seed-defaultsGET /api/v1/admin/registry/offersPUT /api/v1/admin/registry/offers/{offer_key}GET /api/v1/admin/registry/rulesPOST /api/v1/admin/registry/rulesDELETE /api/v1/admin/registry/rules/{rule_id}GET /api/v1/admin/ops/statusPOST /api/v1/admin/materializations/refreshPOST /api/v1/admin/outbox/publishGET /api/v1/admin/outbox/dlqPOST /api/v1/admin/outbox/dlq/{event_id}/requeuePOST /api/v1/admin/outbox/cleanupPOST /api/v1/admin/ingestion/load-assetsPOST /api/v1/admin/ingestion/runPOST /api/v1/admin/ml/feature-store/rebuildPOST /api/v1/admin/ml/trainGET /api/v1/admin/ml/models
Internal endpoints require header X-Internal-Service-Token.
Admin endpoints require header X-Admin-Api-Key.
GET /uiGET /api/v1/demo/clientsGET /api/v1/demo/clients/{client_id}POST /api/v1/demo/recommendations/{client_id}GET /api/v1/analytics/client/{client_id}POST /api/v1/internal/banking/seed-demo-dataPOST /api/v1/internal/registry/seed-defaultsPOST /api/v1/internal/materializations/refreshPOST /api/v1/internal/outbox/publishGET /api/v1/internal/ops/statusPOST /api/v1/internal/ingestion/load-assetsPOST /api/v1/internal/ingestion/runPOST /api/v1/internal/ml/feature-store/rebuildPOST /api/v1/internal/ml/trainGET /api/v1/internal/ml/models
- Copy
.env.exampleto.env. - Run
docker compose up --build. - Use
http://localhost:8010as the prod API. - Open
http://localhost:8011/uifor the sandbox banking UI. - The sandbox auto-seeds demo banking data, the platform auto-seeds the offer registry and source assets when enabled, and the worker handles outbox delivery, ingestion, materialization refreshes, and optional retraining.
- Open
http://localhost:8010/admin/uifor the admin console.