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 layout
Section titled “Repository layout”Provider layer
Section titled “Provider layer”All AI traffic flows through the Llm service, which is the only importer of the Vercel AI SDK (ADR-003).
Module layout
Section titled “Module layout”System overview
Section titled “System overview”Chat pipeline
Section titled “Chat pipeline”Ingestion pipeline
Section titled “Ingestion pipeline”Module structure
Section titled “Module structure”Admin layout
Section titled “Admin layout”Widget layout
Section titled “Widget layout”Key decisions
Section titled “Key decisions”| 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.