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 |