Skip to content

Architecture

AiLoom is a monorepo with a NestJS API, Postgres-backed job queue, pgvector knowledge base, and a Vite admin SPA, all behind Caddy on a single origin.

Repository structure

All AI traffic flows through the Llm service, which is the only importer of the Vercel AI SDK (ADR-003).

Provider layout

Module map

System overview

Chat pipeline

Ingestion pipeline

Module layout

Admin layout

Widget layout

Decision ADR
TypeORM with strict migration discipline ADR-001
pg-boss over BullMQ ADR-002
Vercel AI SDK, no LangChain ADR-003
Single origin via Caddy ADR-004
SSE over WebSockets ADR-005
Vector column with per-dimension indexes ADR-006
Short-lived JWT + DB-backed authorization ADR-007
Admin as static Vite SPA ADR-008
Split licensing (AGPL/MIT) ADR-009
Built-in local embedding model ADR-010

See docs/adr/ for full decision records.