Clausify Architecture

Serverless AI-Powered Contract Analysis Platform

Frontend Layer
Next.js 14
App Router • React Server Components
TypeScript
Type-safe development
shadcn/ui
Radix UI • Tailwind CSS
PDF.js
Client-side preview
Backend Layer
API Routes
Serverless functions
Groq API
Llama 3.1 70B • LLM inference
LangChain
Document processing pipeline
pdf-parse
Text extraction
Data Layer
PostgreSQL
Relational data store
pgvector
Vector similarity search
Supabase Auth
JWT authentication
Supabase Storage
PDF file storage

🚀 Key Technical Features

RAG Pipeline Retrieval-Augmented Generation using vector embeddings for semantic clause comparison
Vector Search IVFFlat indexing with cosine similarity for O(log n) nearest-neighbor search
Serverless Zero-infrastructure costs with edge-optimized API routes
Type Safety End-to-end TypeScript for compile-time error detection
Row-Level Security Database-level data isolation using RLS policies
Real-time Analysis Sub-60 second contract processing with streaming responses