About this project

Launchstack is a TypeScript engine for building AI-native applications, shipped alongside a Next.js reference app that demonstrates how the pieces fit together. The engine covers ingestion, OCR, RAG, a knowledge graph, LLM abstractions and background jobs, organized as layered packages behind typed ports. Repository layout The repo is a pnpm workspace, not an application itself; root-level commands are limited to lint, typecheck, format and Changesets scripts, and package commands must be targeted with --filter. apps/web is the Next.js host (UI, auth, command acceptance, synchronous reads). apps/worker is the durable workflow coordinator that consumes the ingestion outbox and hosts background jobs. apps/landing is the separate public marketing site and is not part of self-hosted deployments. The engine lives in packages/protocol, evidence, application and adapters, with packages/core as a compatibility facade over them, and packages/features holding vertical features. services/ contains non-workspace compute services (a Node document converter, plus Python transcription and docs-editing services). Architecture Core exposes ports that the host wires up; features depend only on those ports and never reach into the app or framework. The host owns environment, auth and routing and implements ports such as storage (S3), job dispatch (Inngest), credits and RAG. createEngine(config) opens the database pool and registers slots; several subsystems are configured through separate registration calls. Slots are read lazily, so they must be set before first use. Engine state is stored on globalThis, which guards against Next.js HMR re-evaluation but means one engine per process. ESLint declares the core/features/host import boundaries and CI enforces them; the engine packages read no process.env. Running it Requirements are Node 20+ and pnpm 10.15.1. Docker Compose is the recommended path, with a lite stack and an OCR profile that adds Docling; make targets cover up, logs, down and volume-wiping down-clean. Without Docker, you need Postgres with the pgvector extension, then run migrations, an optional seed, the Next.js dev server, the worker, and optionally the Inngest dev UI. The web dev server accepts uploads but processes nothing, so the worker must run alongside it or documents stay queued. DATABASE_URL and BETTER_AUTH_SECRET are required to boot. Chat configuration Chat reaches a single endpoint implementing the OpenAI chat-completions protocol, defaulting to Google Gemini's OpenAI-compatible endpoint via GOOGLE_AI_API_KEY. Other providers are reached by setting CHAT_BASE_URL and optionally CHAT_API_KEY; per-vendor variables such as OPENAI_API_KEY or OLLAMA_BASE_URL do not configure chat. Which model handles general chat, extraction, reasoning and images is declared in a YAML config with presets and routes; behavior is not inferred from model ids, and specialized routes fail closed. Chat configuration is independent from embeddings, OCR, transcription, reranking and text-to-speech. Reference app capabilities The app demonstrates first-party auth with per-workspace roles, folder-level access, invitations and an audit log; document upload with optional OCR through several providers; PostgreSQL plus pgvector semantic retrieval; AI chat with guardrails including a PII filter, grounding and a confidence gate; predictive document analysis (eight document types defined, with the request validator currently accepting contract, financial, technical, compliance and general); a marketing pipeline for Reddit, X, LinkedIn and Bluesky; Inngest-backed background jobs; and optional LangSmith tracing. Ingestion sources The pipeline reads exports from Notion, Google Docs/Sheets, Google Drive Takeout, Slack and GitHub without OAuth, alongside first-class PDF, DOCX, PPTX, XLSX, Markdown, HTML, text and image adapters. A documented caveat: ZipAdapter skips JSON and image adapters for entries inside an archive, so a Slack export shipped as a ZIP of JSON yields no pages. Self-hosting and status Deployments are self-hosted unless DEPLOYMENT_MODE=cloud; usage is recorded but not gated, no telemetry or CDN assets are loaded, and the first signup becomes the workspace owner. The engine packages are not yet published to npm; until the first Changesets release, the engine is consumed by running the repository. The project is Apache-2.0 licensed and welcomes contributions, with one issue per PR and Changesets for engine changes.