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.
翻譯準備中
尚未偵測到更新。GitHub 發布版本後會顯示在這裡。
個人 GitHub 帳號下公開儲存庫的擁有者可以登入並驗證所有權,自行管理介紹,無需管理員核准。
登入並產生驗證檔案,在 30 分鐘內將其提交至此儲存庫的預設分支。其他分支或分叉儲存庫中的檔案無效。然後在下方檢查檔案,即可無需管理員核准直接管理專案。請保留檔案以維持管理權限。
如需登入,將前往登入頁面。登入後請回到此處,再次點擊所選的驗證按鈕。
在專案資料夾中執行 /nomorevibe verify,即可驗證所有權並自行管理介紹。
一分鐘完成驗證AI-Powered Legal Contract Analysis & Tracked-Change Redlining
翻譯準備中
取自儲存庫 README
正在載入完整 README。 以下為已儲存的摘錄。
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"檢視完整 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 |