Lalabase
티켓·문서·근무시간·고객대화를 한 곳에 모아 KI로 검색, 소프트웨어 기업 고객 프로젝트용, 오픈소스로 자체 서버·독일 클라우드에 배포
아직 감지된 업데이트가 없습니다. GitHub 릴리스가 나오면 여기에 보입니다.
개인 계정의 공개 저장소 소유자는 GitHub로 로그인해 운영자를 확인하고 소개를 직접 관리할 수 있습니다. 관리자 승인은 필요하지 않습니다.
로그인한 뒤 확인 파일을 만들어 이 저장소의 기본 브랜치에 30분 안에 커밋해 주세요. 다른 브랜치나 포크의 파일은 인정하지 않습니다. 파일을 올린 뒤 아래에서 확인하면 관리자 승인 없이 관리할 수 있습니다. 자격을 유지하려면 파일을 남겨 두세요.
로그인이 필요하면 로그인 화면으로 이동합니다. 로그인 후 이곳으로 돌아와 원하는 확인 버튼을 다시 눌러 주세요.
프로젝트 폴더에서 /nomorevibe verify를 실행하면 소유권을 확인하고 소개를 직접 관리할 수 있습니다.
1분 만에 확인하기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 |