System CorePlatform APIs
Vitruvyan Docs
๐ง Neural Engine API
Last Updated: March 23, 2026 12:00 UTC
๐ Location
- Service:
services/api_neural_engine/ - Pure core:
vitruvyan_core/core/neural_engine/
๐ช Base URL / Port
- Config default:
PORT=8003(services/api_neural_engine/config.py) - Docker external port: 9003 (see
infrastructure/docker/docker-compose.yml)
๐งญ Endpoints (implemented)
Defined in services/api_neural_engine/api/routes.py:
| Method | Path | Description |
|---|---|---|
POST | /screen | multi-factor entity screening and composite ranking |
POST | /rank | single-factor ranking across an entity universe |
GET | /health | dependency-aware health (Postgres, Redis, embedding) |
GET | /metrics | Prometheus text metrics |
GET | /profiles | list available scoring profiles |
GET | / | service info (version, domain, uptime) |
๐งพ Request/Response models
Pydantic models live in services/api_neural_engine/schemas/api_models.py.
POST /screen
Request (ScreenRequest):
Key fields:
profileโ scoring profile name (maps toIScoringStrategyimplementation)stratification_modeโglobal|stratified|compositerisk_toleranceโlow|medium|high
Response (ScreenResponse): ranked list of entities with composite scores, z-scores per factor, rank, percentile, and explainability audit trail.
POST /rank
Request (RankRequest):
feature_name: strโ single KPI to rank byentity_ids: List[str]top_k: inthigher_is_better: bool(defaulttrue)
GET /health
Returns dependency-aware status:
- Postgres reachability
- Redis/StreamBus reachability
- Embedding service reachability
- Overall:
healthy | degraded | critical
โ๏ธ Env vars (service-level)
Loaded in services/api_neural_engine/config.py:
| Variable | Default | Description |
|---|---|---|
PORT | 8003 | HTTP listen port |
LOG_LEVEL | INFO | logging verbosity |
DOMAIN | mock | domain plugin to load (finance, mock, โฆ) |
NE_CACHE_TTL_SECONDS | 30 | scoring result cache TTL |
NE_STRATIFICATION_MODE | global | default stratification (global/stratified/composite) |
CORS_ORIGINS | http://localhost:3000 | comma-separated CORS origins |
๐ Integration with Cognitive Modules
The Neural Engine is the scoring step in the Cognitive Pipeline. It integrates with:
| Module | Integration |
|---|---|
| Veritas Engine | validate signal quality before scoring; skip entities where quality_score < threshold or regime = crisis |
| Horizon Engine | NE composite scores can serve as KPI inputs to Horizon's design space (e.g. return = NE_score) |
| Babel Gardens | NE consumes normalized entity features published by Babel Gardens via StreamBus |