DevxSubh
I develop 3D visuals, user interfaces and web applications.
Loading...0%
Menu
Menu
Close
Close
Back to projects
Lexora — AI-Powered Contract Lifecycle Management (CLM)

Lexora — AI-Powered Contract Lifecycle Management (CLM)

Lexora is a full-stack contract lifecycle product: templates (NDA, vendor, consulting, employment, MSA), clause library, variable placeholders, rich editing, sharing, PDF/DOCX/Markdown/HTML export, and signature flows. Auth covers email/password, Google OAuth, verification and reset via Resend, JWT access tokens with rotating refresh, and RBAC. AI features use Google Gemini (with Ollama fallback) for chat grounded in the contract, risk-focused review, rewrite/explain/summarize, clause generation and suggestions, and streaming full-contract generation. Retrieval deliberately avoids vectors: a hierarchical tree is built from BlockNote structure (`contractTree.ts`); the model selects sections, pulls exact line-bounded sources, and server-side validation ensures citations quote real text—reducing hallucinated references compared to embedding-only RAG.

Timeline

Ongoing

Role

Full-Stack Developer

Team

Solo

Status

Completed

Technology Stack

Next.js 14

React 18

TypeScript

Tailwind CSS

BlockNote

Node.js 20

Express 4

MongoDB

MongoosePassportGoogle GeminiOllamaResendJoiSwagger / OpenAPIpnpm workspaces

Key Features

Monorepo: `pnpm dev` runs Next.js (3000) and API (8080); OpenAPI docs at `/api-docs`
Contract workspace: editor, AI sidebar, variables, templates, outline, floating selection toolbar
PageIndex-style retrieval: heading tree, BFS candidate selection, line-numbered sources, citation validation
AI routes: chat, review, rewrite, explain, summarize, generate clause, suggest clauses
Platform: dashboard, notifications, image upload (Cloudinary or local), background jobs hook
Production paths: Docker for API, Render `render.yaml` with health checks

Key Learnings

  • Structuring CLM domains: templates, clauses, variables, signatures, and audit-friendly exports
  • Reasoning-based retrieval over document outline vs embedding similarity trade-offs
  • Monorepo discipline with shared types and env validation (Joi at startup)
  • Operating Gemini with retry/backoff and local-model fallback for dev resilience

Key Challenges

  • Grounding LLM answers in long legal documents without a vector database
  • Robust citation validation and fallbacks when the model drifts
  • RS256 key management and secure token rotation across client and server
  • Keeping editor state, tree index, and AI prompts consistent on every save

Impact & Results

Demonstrates production-shaped CLM plus novel vectorless RAG for contracts
Deployable backend pattern (Render) with documented secrets and health probes
Reusable reference for compliance-first legal tech UX

Future Enhancements

Dedicated production frontend URL and deep links from marketing site
E-sign integrations and jurisdiction-specific template packs
Automated regression tests for tree builder and citation validator
Org-level admin, billing, and audit logs for firm deployments