Risk Intelligence Platform for Invoice Receivables Anticipation (NF-e)
Turning raw invoice data into intelligent, explainable credit decisions.
Cypher is a specialized risk intelligence engine built for fintechs and B2B credit operations focused on invoice receivables anticipation (NF-e).
Designed to support financial analysts and credit teams, Cypher delivers transparent risk scoring, rich operational metrics, and full auditability — enabling confident and data-driven decisions in receivables financing.
Instead of simple approve/reject outputs, Cypher provides deep contextual intelligence to enhance human decision-making.
- Rule-based evaluation pipeline with full traceability
- Multi-dimensional risk assessment including:
- SEFAZ invoice status
- Issuer reliability
- Buyer behavior patterns
- Maturity window risk
- Value anomalies
- External data consistency
- Operational red flags
- Individual rule contribution and weighting
- Intelligent fallback mechanisms with clear justification
Built as a truly multi-tenant system from day one, with complete logical isolation and tenant context propagation across all layers.
Automatically calculates key metrics:
- Expected Loss (EL)
- Risk-adjusted ROI
- Exposure indicators
- Recommended anticipation amount
Every analysis generates a complete audit trail including executed rules, fallback events, scores, timestamps, and contextual metadata.
Modular Monolith built with modern Java practices, prioritizing simplicity, maintainability, and operational excellence.
- Backend: Java 21 + Spring Boot 3.3.5
- Frontend: React 19 + TypeScript + Vite 7
- Database: PostgreSQL with Flyway migrations
- Cache / Idempotency: Redis
- Security: Spring Security, JWT resource server, API key authentication
- Observability: Spring Boot Actuator, Micrometer tracing, OpenAPI / Swagger UI
- Resilience: Resilience4j circuit breakers for external integrations
- Concurrency: Virtual Threads (Project Loom)
Design Philosophy:
Explainability first • Simplicity • Modularity without premature complexity
flowchart TD
A[Request] --> B[Validation]
B --> C[Tenant Context]
C --> D[Rule Evaluation Pipeline]
D --> E[Score Aggregation]
E --> F[Financial Metrics]
F --> G[Audit Trail]
G --> H[Response]
- Java 21
- Spring Boot 3.3.5
- Spring Web MVC
- Spring Data JPA / Hibernate
- Spring Validation
- Spring Security
- OAuth2 Resource Server / JWT
- API key authentication
- PostgreSQL
- Flyway
- Redis
- Resilience4j
- Spring Boot Actuator
- Micrometer Tracing with OpenTelemetry bridge
- Springdoc OpenAPI / Swagger UI
- Maven
- Lombok
- React 19
- TypeScript
- Vite 7
- Tailwind CSS
- React Router
- TanStack React Query
- Axios
- Recharts
- Lucide React
- ESLint
The current frontend implementation was created exclusively with AI assistance. It should be treated as an active product surface that needs regular human review for accessibility, usability, performance, security, and maintainability.
Frontend contributions are welcome, especially when they improve code clarity, user experience, test coverage, API contract alignment, and production readiness.
- JUnit 5
- Mockito
- Spring Boot Test
- Spring Security Test
- PostgreSQL 13+
- Redis
- Virtual Threads enabled on the backend
- Local XML storage support
- External integration adapters for SEFAZ and Receita Federal
Actively under development.
- Rule-based scoring engine
- Explainable risk factors
- Financial metrics calculation
- NF-e XML parsing
- SEFAZ status abstraction with fallback behavior
- Receita Federal company status integration layer
- Multi-tenant tenant context propagation
- API key and JWT authentication foundation
- Audit log infrastructure
- Idempotency layer backed by Redis
- Analysis history, statistics, and detail APIs
- React dashboard, history, analysis detail, and new analysis screens
- Flyway migration reliability
- Frontend/backend contract alignment
- Production-safe frontend error handling
- Stronger idempotency guarantees
- End-to-end and migration testing
- Tenant-specific policy customization
- Advanced financial modeling
- ML-assisted risk signals
- Explainability over black-box decisions
- Operational simplicity over unnecessary complexity
- Modularity without premature distribution
- Resilience through intelligent fallbacks
- Domain-Driven Design
Cypher Engine is preparing for open source collaboration. Please read CONTRIBUTING.md, SECURITY.md, and CODE_OF_CONDUCT.md before opening issues or pull requests.
This project is licensed under the GNU Affero General Public License v3.0 only (AGPL-3.0-only). See LICENSE.md.
Developed by Pedro Andrade