Core · Service · Active
platform-ai-service
Provider-agnostic AI boundary for the workspace, exposing a stable internal contract for text generation with pluggable providers.
- TypeScript
- NestJS 11
- PostgreSQL
- OpenAI SDK
- Responses API
- @platform/contracts-ai
- @platform/observability
Spec sheet
Boundary
Core / AI
Runtime
NestJS 11 HTTP service
Default port
3300
Persistence
PostgreSQL via AI_DATABASE_URL
Security
Required PLATFORM_INTERNAL_TOKEN plus forwarded bearer validation via platform-auth-service
Providers
Postgres-managed registry with openai and template support
Responsibilities
- Expose a stable HTTP contract for synchronous text generations.
- Keep provider selection behind a provider registry.
- Support OpenAI via Responses API and a local template fallback.
- Persist provider configuration and default routing through admin endpoints.
- Allow consumers to inspect configured and enabled providers.
Interfaces and contract surface
- GET /health
- GET /internal/ai/providers
- GET /internal/ai/providers/admin
- GET /internal/ai/providers/:providerKey
- PUT /internal/ai/providers/:providerKey
- POST /internal/ai/generations
Consumers
Dependencies and external touchpoints
- platform-auth-service
- platform-local-stack
- @platform/contracts-ai
- @platform/observability
- OpenAI-compatible provider endpoints
- PostgreSQL state store
Notes
- Funnel IA still contains legacy AI integrations that should progressively move behind this service.
- Always inspect /internal/ai/providers first if you need to know whether openai is really configured in the current environment.
- Provider enablement and default model routing are runtime state in Postgres, not environment-only configuration.
- The template provider is deterministic and intended for local tests and fallback scenarios.
Source references
platform-ai-service/README.mddocs/core-services-integration.mdplatform-ai-service/package.json