Lalabase
Tickets, Doku, Zeiterfassung und Kundengespräche an einem Ort, durchsuchbar per KI. Für Softwarefirmen mit Kundenprojekten. Open Source: auf deinem eigenen Server oder in unserer Cloud in Deutschland.
Translation pending
Ask questions about your contracts and see exactly where every answer came from.
BusinessJavaScript · TypeScriptGitHub @Kalpan2007OnlineOwner unconfirmed
Have you tried it? One tap is enough. No sign-in needed.
No updates detected yet. GitHub releases will appear here.
Owners of public repositories under a personal GitHub account can sign in to verify ownership and manage the introduction themselves. No administrator approval is needed.
Sign in, generate a verification file, and commit it to this repository’s default branch within 30 minutes. Files on other branches or forks do not count. Then check the file below to manage the project without administrator approval. Keep the file to retain your access.
If needed, you will go to sign-in. After signing in, return here and press your chosen verification button again.
Run /nomorevibe verify in your project folder to verify ownership and manage the introduction yourself.
Verify in one minuteAsk about other verification options
AI-Powered Legal Contract Analysis & Tracked-Change Redlining
Translation pending
Taken from the repository README
Loading the full README. The saved excerpt is shown below.
AI-Powered Legal Contract Analysis & Tracked-Change Redlining Engine Built for UAE legal practices and international commercial contracts. -brightgreen.svg) • 🌐 Live Web Application: https://juriqa-assignment-kappa.vercel.app • ⚡ Backend API Service: https://juriqa-assignment.onrender.com (Health: https://juriqa-assignment.onrender.com/health/ready) • 🎥 Video Walkthrough (YouTube): Watch Demo Video • 📁 Sample Test Contracts: Pre-bundled in TEST_FILES/ (Facility agreement 162p, MSA v1 & v2, NDAs, scanned samples) ⚖️ The Core Principle: "Never Trust the AI"Read the full README ↗
AI-Powered Legal Contract Analysis & Tracked-Change Redlining Engine
Built for UAE legal practices and international commercial contracts.
TEST_FILES/ (Facility agreement 162p, MSA v1 & v2, NDAs, scanned samples)In legal contract analysis, hallucinated quotes or fabricated clause citations can compromise legal counsel. This application is engineered around one foundational rule:
The AI is strictly an unprivileged drafter.
It is never trusted for coordinates, offsets, page numbers, or quote authenticity. Every supporting citation must be independently discovered, bounded, and verified by our deterministic TypeScript verification engine inside the source document.
- Matched quotes are verified with green badges and interactive viewport jump links.
- Unmatched or altered quotes are flagged as
UNVERIFIEDand barred from citation overlays.- If an answer does not exist in the contract, the engine reports its absence rather than inventing terms.
Ask complex questions against 100+ page contracts. Clicking any verified quote jumps directly to the rendered page and overlays viewport bounding-box highlights.
Compare two contract versions with Needleman-Wunsch sequence alignment, plain-language legal change summaries, and automatic risk severity scoring (HIGH / MEDIUM / LOW).
Query across multiple agreements simultaneously (e.g. comparing master agreements against NDAs) with document-isolated quote verification and unified legal synthesis.
| Section | Feature | Implementation Details | Status |
|---|---|---|---|
| Part A.1 | Upload & Processing | PDF (pdfjs-dist) & DOCX (mammoth) extraction, magic-byte sniffing (pdf-parse/mammoth), scanned PDF detection (amber alert banners for missing OCR text), encrypted file rejection. | 100% Complete |
| Part A.2 | Streaming Chat | Server-Sent Events (SSE) streaming answers word-by-word with abort controller support; persistent chat sessions per document in PostgreSQL. | 100% Complete |
| Part A.3 | Quote Verification Engine | Independent deterministic substring & normalized token matcher; supports curly/straight quotes, soft hyphens, whitespace compression, and case-insensitivity. | 100% Complete |
| Part A.4 | Large Contracts (150+ Pages) | Tested on 162-page Facility Agreement. Automatic Thorough Scan Mode for negative/absence queries with chunked map-reduce and honest coverage badges (COMPLETE vs PARTIAL). | 100% Complete |
| Part B.5 | Citation Highlighting | Viewport coordinate mapping with PDF text layer bounding boxes; DOCX reading mode DOM text ranges; multi-line & across-page highlight support. | 100% Complete |
| Part B.6 | Multi-Document Chat | Multi-contract selector with D1/D2 aliases, comparative synthesis, and strictly document-isolated quote verification. | 100% Complete |
| Part B.7 |
┌────────────────────────────────────────┐
│ Client Application (Next.js 16) │
│ React 19 • Tailwind CSS v4 • Zustand │
└───────────────────┬────────────────────┘
│ HTTPS / SSE
▼
┌────────────────────────────────────────┐
│ NestJS 11 Backend Server │
│ Fastify/Express • Zod Pipes • CORS │
└─┬──────────────┬──────────────┬────────┘
│ │ │
┌──────────────────┘ │ └──────────────────┐
▼ ▼ ▼
┌──────────────┐ ┌───────────────────┐ ┌────────────────┐
│ Prisma ORM │ │ Processing Engine │ │ Groq / OpenAI │
│ PostgreSQL │ │ • pdfjs-dist │ │ LLM Streaming │
│ • Full-Text │ │ • OpenXML Redline│ │ • Llama 3.3 70B│
│ • pg-boss │ │ • Quote Verifier │ │ • SSE chunks │
└──────────────┘ └───────────────────┘ └────────────────┘
[Quote: "...", Page: X], our backend intercepts the quote before client dispatch. It queries the document’s pre-indexed text layer and runs a 4-tier waterfall match:
“ ” ‘ ’), en/em-dashes (– —), non-breaking spaces (\u00A0), and ligatures (fi, fl) into standard ASCII equivalents.UNVERIFIED to preserve safety.01-facility-agreement-162p.pdf (~60,000 words).tsvector with ts_rank_cd) combined with section-aware window expansion to locate candidate provisions in sub-second time.COMPLETE coverage badge. If token quotas truncate the read, it alerts the user with PARTIAL coverage and the exact pages scanned..docxword/document.xml). In Word XML, a single grammatical sentence is frequently fractured across multiple run tags (<w:r>) due to formatting, spell-check bookmarks, or editing history. A naive string replace will corrupt the XML or fail to find text that spans runs.word/document.xml using a streaming XML DOM builder.<w:r> (run) and <w:t> (text) nodes.<w:del w:id="..." w:author="Contract Analyzer" w:date="..."><w:r><w:delText>...</w:delText></w:r></w:del>, and wrap additions in <w:ins>.simulateAccept and simulateReject) to prove that accepting all revisions yields the target text and rejecting all revisions recreates the exact original without XML corruption..docx download.v22.x or v24.x (LTS recommended)git clone https://github.com/Kalpan2007/Juriqa_assignment.git
cd Juriqa_assignment
Copy .env.example to .env in the root directory:
cp .env.example .env
Key variables in .env:
# Database (PostgreSQL / Supabase)
DATABASE_URL="postgresql://postgres:[email protected]:5432/postgres?schema=public"
# LLM Provider (Groq or OpenAI-compatible)
LLM_PROVIDER="groq"
LLM_API_KEY="gsk_your_groq_api_key_here"
LLM_MODEL="llama-3.3-70b-versatile"
# Storage Configuration
STORAGE_DRIVER="local"
STORAGE_LOCAL_DIR="./uploads"
# Ports & URLs
SERVER_PORT=3001
CLIENT_ORIGIN="http://localhost:3000"
NEXT_PUBLIC_API_URL="http://localhost:3001"
npm install
npm run prisma:generate -w @ca/server
npm run prisma:deploy -w @ca/server
Open two terminal windows:
# Terminal 1: Backend API (NestJS)
npm run dev -w @ca/server
# Terminal 2: Frontend App (Next.js)
npm run dev -w @ca/client
http://localhost:3000http://localhost:3001 (Health check: http://localhost:3001/health/ready)Nodemainnpm install && npx prisma generate --schema=server/prisma/schema.prisma && npx turbo run build --filter=@ca/server...
node server/dist/main.js
DATABASE_URL: Your Supabase connection string.LLM_API_KEY: Your Groq API key (gsk_...).LLM_PROVIDER: groqLLM_MODEL: llama-3.3-70b-versatileSTORAGE_DRIVER: supabase (or local)SUPABASE_URL: Your Supabase project URL.SUPABASE_SERVICE_ROLE_KEY: Supabase service role secret.SUPABASE_STORAGE_BUCKET: contractsWEB_ORIGIN: https://juriqa-assignment-kappa.vercel.app (or *)NODE_ENV: productionNext.jsclientnpm run build (or leave default Next.js build).nextNEXT_PUBLIC_API_URL: https://juriqa-assignment.onrender.com# Run all server unit & integration tests (512 tests)
npm test -w @ca/server
# Run client tests
npm test -w @ca/client
# Monorepo typecheck & lint verification
npm run typecheck
npm run lint
├── client/ # Next.js 16 (React 19, Tailwind CSS v4, Zustand)
│ ├── src/app/ # App router (library, ask, compare, redline)
│ └── src/features/ # Feature slices (chat, viewer, compare, redline)
├── server/ # NestJS 11 Application
│ ├── src/core/ # Error handling, Zod validation pipes, SSE filters
│ ├── src/features/ # Domain features (documents, verification, chat, comparison, redline)
│ ├── src/infrastructure/ # Prisma DB, Supabase storage, Groq LLM client
│ └── prisma/ # Database schema and migration scripts
├── shared/ # Shared TypeScript contracts, DTOs & Zod schemas
├── screenshots/ # Application demonstration screenshots
├── TEST_FILES/ # Standard test contract suite (Facility 162p, MSA v1/v2, NDAs)
└── docs/ # Technical specs and assignment documentation
MIT License. Built for the Juriqa Engineering Assignment submission.
| Clause-level sequence alignment, semantic diffs, renumbering shift notes, and risk severity tags (e.g., changes to liability caps, governing law, or payment days). |
| 100% Complete |
| Part C.1 | Tracked-Change Redlining (Chosen) | Native OpenXML .docx surgery injecting <w:del> and <w:ins> nodes into word/document.xml. Preserves styles and tables; self-checked with simulateAccept() / simulateReject(). | 100% Complete |