Overview
Nolly captures institutional knowledge so it doesn't walk out when people leave. Teams upload documents, record audio, or type notes into one searchable base. The codebase is a TypeScript monorepo of 12 packages spanning three web apps, a worker, and an MCP server. The main app runs on TanStack Start with Drizzle over Postgres (row-level security), Better Auth with Google OAuth, and BullMQ on Redis for async jobs. The worker parses PDFs, runs Sharp, transcribes audio via Groq, and generates embeddings for semantic search. Real-time editing uses Hocuspocus with Yjs CRDTs, and an MCP server exposes knowledge operations to clients like Claude.
Built With
Architecture
Key Highlights
RAG Knowledge Pipeline
Multi-stage ingestion pipeline using BullMQ workers that extracts text from PDFs, DOCX, XLSX, images (via vision AI), and audio (via Groq Whisper). Documents are semantically chunked and embedded using MiniLM-L6-v2 (384-dim vectors) for pgvector search.
Real-time Collaboration
Hocuspocus WebSocket server with Yjs CRDTs syncing TipTap editors across users. Includes debounced micro-saves, automatic embedding regeneration after edits, and idle version snapshots queued through BullMQ.
AI Chat with Tool Use
Conversational knowledge assistant powered by Groq (Llama 4 Scout) with function-calling tools for semantic search, metadata filtering, and member lookups. Uses dual-layer retrieval with LLM query rewriting and expanded keyword variants.
Postgres Row-Level Security
Application-level RLS using AsyncLocalStorage to propagate user context. Every query runs inside a transaction that sets Postgres session variables via set_config, scoping all data to the authenticated user's organization.
Google Drive Sync
Background sync that imports files from Google Drive using raw fetch against the v3 REST API (no googleapis SDK, saving ~30MB). Handles Workspace export conversions and memory-aware backpressure with exponential backoff.

