← Indexsemantic-gateway

GET /work/semantic-gateway200 OK

01 / 08 · AI infrastructure, backend service · 2026

Semantic Gateway

A smarter gateway for AI requests, powered by semantic caching.

My role
Currently developing the backend, including API key authentication, gateway request processing, semantic caching, LLM provider integration, and tenant management. The client interface was built with AI assistance.
Year
2026
Context
Personal project · In development
Stack
  • Node.js
  • TypeScript
  • NestJS
  • PostgreSQL
  • Prisma

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

  1. 01

    Client sends an authenticated AI request

    REST API · API Key

  2. 02

    Gateway checks semantic cache

    PostgreSQL · Vector Search

  3. 03

    Cache miss triggers an LLM request

    OpenRouter · LLM

  4. 04

    Response is returned and cache is updated

    Redis · PostgreSQL

Stack

  • Node.js
  • TypeScript
  • NestJS
  • PostgreSQL
  • Prisma
  • Redis
  • OpenRouter
  • Semantic Caching
  • Vector Search