Deterministic credit decisioning. AI only writes the narrative.
On-prem pipeline with versioned scoring, F1–F5 compliance gates, CRC/CIRBE, immutable audit, and grounded local-LLM explanations — never an LLM score.
AI-driven credit decision platform with layered architecture, immutable audit trail, and F1–F5 regulatory compliance.
- Automated Pipeline — 5–15 second decisions with 11 parallel integrations
- 6 AI Agents — Specialized collection and normalization (Behavioral, Financial, Income, etc.)
- ML Scoring — Segment-based models (Consumer/SME/Corporate) with SHAP explainability
- OCR + AI Parsing — Document upload → automated data extraction (Tesseract + OpenAI-compatible LLM)
- Robust Manual Entry — Fallback when APIs fail + dynamic UI forms
- F1–F5 Compliance — Regulatory gates + mandatory human review
- Immutable Audit Log — SHA-256 hash chain, complete traceability
- Iberian Expansion — Support for Portugal (CRC) and Spain (CIRBE)
- Early Warning System — Automated post-disbursement monitoring
- Model Risk Management — Registry, backtesting, drift monitoring (PSI)
- On-Premise LLM — OpenAI-compatible
/v1or ContextMemory; local OCR (Tesseract) - Multi-tenant — PostgreSQL RLS + EF Core tenant filter
- Complete Architecture — System overview, components and tech stack
- Detailed Pipeline — Complete phase-by-phase flow
- Visual Diagram (Mermaid) — Visual pipeline flow
- Integrations — Data provider configuration (CRC, CIRBE, APIs)
- Document Processing (OCR + AI) — Upload and automated data extraction
- License & support — AGPL-3.0 terms and contribution pointers
- Contributing — Local setup and PR guidelines
- .NET SDK 9.0
- PostgreSQL 9.0+ (or Docker Desktop)
- OpenAI-compatible LLM (optional, for AI narratives) or ContextMemory gateway
- Tesseract OCR (optional, for document processing)
-
Prepare environment variables:
cp .env.example .env
-
Start PostgreSQL:
docker compose up -d docker compose ps # Validate statusOptional ContextMemory gateway (GHCR):
docker compose -f docker-compose.yml -f docker-compose.contextmemory.yml up -d # then set CONTEXT_MEMORY_API_KEY in .env (see .env.example) -
Run applications (two terminals):
Terminal 1 - API:
cd src/CreditAI.API dotnet run # → https://localhost:7257 # → Docs: https://localhost:7257/redoc
Terminal 2 - Web:
cd src/CreditAI.Web dotnet run # → http://localhost:5188
-
Initial login:
- URL:
http://localhost:5188 - Email:
admin@creditai.local - Password:
ChangeMe@1234
- URL:
Migrations are applied automatically on startup.
Default (development):
Host=localhost;Port=5432;Database=creditai;Username=creditai;Password=CHANGE_ME;
Customize via environment variable:
export ConnectionStrings__CreditAiDatabase="Host=localhost;..."Por defeito a narrativa e o parsing usam qualquer endpoint OpenAI-compatible (POST /v1/chat/completions) via Llm:* / LLM_* (qualquer host OpenAI-compatible via Llm:BaseUrl).
"Llm": {
"Enabled": true,
"BaseUrl": "http://localhost:8000",
"Model": "qwen3.5:9b"
}BaseUrl é o host sem /v1 (o cliente acrescenta v1/chat/completions).
Para passar pelo gateway ContextMemory:
"ContextMemory": {
"BaseUrl": "http://localhost:5100",
"AppId": "creditai",
"ApiKey": "cm_creditai_local_key"
}- Com
ContextMemoryBaseUrl+ApiKey: gateway. - Sem
ApiKey: LLM directo OpenAI-compatible (Llm:Enabled/LLM_BASE_URL). - Self-host CM: repositório acima, ou
docker-compose.contextmemory.ymlneste repo.
By default, all integrations are in Stub mode (development):
Integrations__Crc__Mode=Stub
Integrations__Yapily__Mode=Stub
Integrations__Citius__Mode=Manual # Manual entry only
# ... etcTo enable real integrations, see docs/integrations.md.
┌─────────────────────────────────────────────────────────────┐
│ CREDIT DECISION PIPELINE (5-15 seconds) │
├─────────────────────────────────────────────────────────────┤
│ │
│ 1. INTAKE → Validation and request creation │
│ 2. REGULATORY → CRC (PT) or CIRBE (ES) │
│ 3. EXTERNAL DATA → 11 parallel data providers │
│ 4. AI AGENTS → 6 agents normalize (50+ features) │
│ 5. ML SCORING → PD + Rating + SHAP values │
│ 6. SOLVENCY RULES → Gates F1-F5 (compliance) │
│ 7. NARRATIVE AI → OpenAI-compatible /v1 (or ContextMemory) │
│ 8. DECISION SNAPSHOT → Consolidation │
│ 9. AUDIT LOG → Immutable hash chain │
│ 10. HUMAN REVIEW → Supervisor approves/rejects │
│ 11. MONITORING → Early Warning System (continuous) │
│ │
└─────────────────────────────────────────────────────────────┘
Robust fallback: If any API fails → manual data entry (UI forms or document upload with OCR).
On-premise LLM: OpenAI-compatible /v1 or ContextMemory + Tesseract OCR. Zero cloud SaaS LLM by default.
See details in docs/ARCHITECTURE.md.
Upload PDFs/images → automated data extraction:
POST /api/documents/{requestId}/process
- file: document.pdf
- sourceKey: "Citius" # or CRC, WorldCheck, etc.
- segment: "Sme"Flow:
- OCR (Tesseract) → extracts text
- AI Parsing (OpenAI-compatible LLM) → identifies fields
- Validation → analyst reviews
- Submission → integrates with manual entry
Supported formats: PDF, PNG, JPG, JPEG, TIFF, BMP (max 10 MB)
See complete guide in docs/document-processing.md.
- Health:
GET /health - Decision:
GET /api/credit-decisions/{requestId} - Request intake:
POST /api/credit-requestsGET /api/credit-requestsGET /api/credit-requests/{requestId}
- Human review:
GET /api/human-review/queuePOST /api/human-review/queuePOST /api/human-review/decisionsPOST /api/human-review/decisions/batchGET /api/human-review/history
- Audit:
GET /api/audit-logGET /api/audit-log/export/csvGET /api/audit-log/export/json
Two modes supported via Authentication:Mode:
| Mode | Use | API | Web |
|---|---|---|---|
Development |
Local without Entra (Identity, like KYC) | Signed Bearer token or dev |
/Identity/Account/Login |
Entra |
Production (Microsoft Entra ID) | JWT Bearer | Cookie + OIDC |
- Web: email/password login at
/Identity/Account/Login(seed user:Auth:AdminEmail/Auth:AdminPassword, defaultadmin@creditai.local/ChangeMe@1234) - API: Web propagates signed
access_tokenafter login; tests can useAuthorization: Bearer dev - Roles:
Analyst,Supervisor,Auditor,RiskValidator,AmlOfficer,Admin
- Register two app registrations in Entra ID:
- API — expose scope
access_as_user, app rolesAnalyst,Supervisor,Auditor - Web (Blazor) — redirect URI
https://{host}/signin-oidc, permission to API scope
- API — expose scope
- Configure variables (API and Web):
Authentication__Mode=Entra
Authentication__Authority=https://login.microsoftonline.com/{tenant-id}/v2.0
Authentication__Audience=api://creditai
Authentication__ClientId={web-client-id}
Authentication__ClientSecret={web-client-secret}
Authentication__ApiScope=api://creditai/access_as_user
- Assign app roles to users/groups in Entra ID.
RBAC Policies:
CreditRead:Analyst,Supervisor,AuditorCreditWrite:Analyst,SupervisorHumanReviewRead:Analyst,Supervisor,AuditorHumanReviewWrite:Analyst,SupervisorAuditRead:Auditor,Supervisor
Web Routes:
- Login:
/account/login - Logout:
/account/logout
Web propagates the OIDC access_token to the API (Authorization: Bearer).
- Build:
dotnet build CreditAI.sln - MRM Gate:
dotnet run --project tools/CreditAI.MrmGate - Unit tests:
dotnet test tests/CreditAI.UnitTests - Tests (fast, no Docker):
dotnet test tests/CreditAI.IntegrationTests --filter "Category!=Postgres" - Architecture tests:
dotnet test tests/CreditAI.ArchitectureTests - PostgreSQL tests (requires Docker):
dotnet test tests/CreditAI.IntegrationTests --filter "Category=Postgres" - Stop local database:
docker compose down - Stop and remove volume:
docker compose down -v
Complete documentation in docs/README.md.
# Generate evidence dossier (tests + MRM + API exports)
.\scripts\generate-homologation-evidence.ps1 -StartApp
# UI screenshots (Playwright) + docx
.\scripts\run-homologation-full.ps1| Document | Description |
|---|---|
docs/HOMOLOGATION_CHECKLIST.md |
F1–F5 regulatory checklist |
docs/E2E_HOMOLOGATION.md |
12 E2E scenarios + execution log |
docs/dossier/ |
Evidence files (.trx, JSON, logs) |
docs/OPERATIONS_AND_HOMOLOGATION.md |
Deploy + runbooks |
| Phase | Status | Reference |
|---|---|---|
| F1 — Compliant core (GDPR, Art. 22, human review, CRC in pipeline) | 100% logic | docs/F1-completion-checklist.md |
| F2 — Model Risk (registry, MRM gate, model cards, ONNX) | 100% repo | docs/F2-completion-checklist.md |
| F3 — AML + solvency (sanctions, PEP/EDD, DSTI/LTI, FIU/goAML, CRC reporting) | 100% repo | docs/F3-completion-checklist.md |
| F4 — Multi-segment + narrative (grounding, OpenAI-compatible LLM, open banking) | 100% repo | docs/F4-completion-checklist.md |
| F5 — Competitive (EWI, watchlist, supervisor/CIRBE export, risk dashboard) | 100% repo | docs/F5-completion-checklist.md |
Documentation: docs/compliance/, docs/architecture/ADR-001-llm-scoring-separation.md.
Local MRM gate: dotnet run --project tools/CreditAI.MrmGate
dotnet-tests.yml— build, MRM gate, unit/architecture/integration testsrelease-please.yml— version bumps + release PRs from conventional commitsannounce-release.yml— LinkedIn + dev.to on published releases
Current version: see version.txt.
Pipeline is defined in azure-pipelines.yml (entry) and infra/azure-pipelines.yml (template).
Stages:
- Build + MRM gate — validates
ml/model_cards/*.mdviaCreditAI.MrmGate - Unit + architecture tests — promotion gate, LLM/scoring/CRC boundary
- Integration tests — in-memory and stubs (no Docker)
- PostgreSQL regulatory gates — Testcontainers validates append-only
audit_logtriggers
To connect in Azure DevOps: create pipeline pointing to azure-pipelines.yml in the repository root.
Project: tests/CreditAI.E2ETests
Requirements: Docker (PostgreSQL via Testcontainers) + Playwright browsers.
dotnet build tests/CreditAI.E2ETests
pwsh tests/CreditAI.E2ETests/bin/Debug/net9.0/playwright.ps1 install chromium
dotnet test tests/CreditAI.E2ETests --filter "Category=E2E"Covered scenarios:
- Identity login (
/Identity/Account/Login) and dashboard - Request submission with human review escalation
- Approval in human review queue
AGPL-3.0 for this open-source core (same as KYC / ContextMemory). Commercial / hosted offerings: kortexio.io. See docs/license-and-support.md.
GitHub topics (apply with pwsh ./scripts/set-github-topics.ps1 after gh auth login):
credit-risk, credit-scoring, fintech, csharp, dotnet, blazor, postgresql, contextmemory, self-hosted, agpl, open-source, model-risk, open-banking, explainable-ai, crc.