GET /work/semantic-gateway200 OK
01 / 08 · AI infrastructure, backend service · 2026
Semantic Gateway
A smarter gateway for AI requests, powered by semantic caching.
01 / The problem
The overview
An AI gateway currently under development, designed to sit between client applications and LLM providers. It uses semantic similarity to identify reusable responses, reduce redundant model calls, and provide a unified interface for AI integrations.
- Building the backend with NestJS and TypeScript.
- Using PostgreSQL and vector similarity search for semantic caching.
- Implementing Redis for fast cache lookups.
- Integrating LLM providers through OpenRouter.
- Designing API key authentication and tenant-aware request handling.
How it fits together
01
Client sends an authenticated AI request
REST API · API Key
02
Gateway checks semantic cache
PostgreSQL · Vector Search
03
Cache miss triggers an LLM request
OpenRouter · LLM
04
Response is returned and cache is updated
Redis · PostgreSQL
Stack
- Node.js
- TypeScript
- NestJS
- PostgreSQL
- Prisma
- Redis
- OpenRouter
- Semantic Caching
- Vector Search