Releases: MantaYuana/CLARA_AI
Completed Release
The v1.0 release of CLARA AI (Contract & Legal AI Reasoning Assistant) marks the completion of the project as a production-ready, end-to-end legal intelligence platform. This version culminates the hackathon journey by integrating advanced retrieval techniques, a polished workspace UI, and a multi-layered safety framework
🏛️ Complete Legal Operating System
- Unified Workspace: CLARA now functions as a full-scale legal hub where users can manage multiple "Projects" (legal matters), each with its own isolated set of documents and conversation history.
- Universal Source Management: A centralized source tracking system allows legal professionals to upload, manage, and reuse documents across different workflows.
- Multi-Format Ingestion: Supports complex document processing through an asynchronous OCR pipeline using Google Cloud Vision, handled by a robust BullMQ/Redis worker system.
🧠 Advanced Legal Intelligence (RAG 2.0)
- Hybrid Retrieval Engine: Implements a high-precision retrieval system that combines dense vector embeddings with BM25 keyword matching, optimized using Reciprocal Rank Fusion (RRF) to ensure the most relevant legal precedents are found.
- Indonesian Legal Grounding: The system is pre-seeded with a comprehensive foundation of Indonesian law, including the Civil Code (Buku III), Labor Laws (UU 13/2003, UU 6/2023), and Electronic Information regulations.
- Deep Reasoning Pipeline: Leverages Google’s Generative AI with structured "System 2" thinking prompts to synthesize retrieved facts into professional legal advice or contract drafts.
✍️ The "Legal Studio" Experience
- Integrated Drafting Environment: Features a specialized "Studio" layout that allows users to chat with the AI while simultaneously drafting or refining documents in a side-by-side pane.
- Citation Transparency: Every AI-generated response is supported by a "Sources" panel that explicitly lists the legal documents and specific sections used as references, ensuring full accountability.
🛡️ Enterprise-Grade Safety & Reliability
- Production Guardrails: Deployed a dedicated
GuardrailServicethat acts as a final filter, checking every response for factual grounding, hallucination, and toxicity before it reaches the user. - Automated Verification: The platform includes a suite of automated tests to validate the integrity of the retrieval logic and the effectiveness of the safety filters.
- Secure Infrastructure: Utilizes a hardened stack including Neo4j for graph-vector storage, JWT-based authentication, and Google OAuth 2.0 for secure access control.
Third Checkpoint
The v0.3 release of CLARA AI focuses on transitioning from a functional chatbot to a professional Integrated Legal Workspace.
🏗️ 1. Project-Based Workspace & File Management
- Project Organization: Introduced a multi-project architecture allowing users to organize documents, chats, and drafts into distinct legal matters.
- Unified Source Tracking: Implemented a comprehensive source management system that tracks all uploaded legal documents across the workspace, enabling easy reference and reuse.
- Persistent State Management: Added custom hooks (
useProjects,useSources,useChat) to manage complex workspace states and ensure real-time synchronization between the UI and backend.
✍️ 2. The "Legal Studio" Environment
- Split-Pane Interface: Deployed a "Studio" layout where the chat interface is integrated side-by-side with a drafting panel, facilitating a seamless workflow from legal research to document creation.
- Interactive Drafting Service: The backend now features a specialized
DrafterServicedesigned to assist in generating legal clauses and structuring documents based on conversational context. - Source Verification Panel: Integrated a dedicated
SourcesPanelthat highlights specific legal references used in AI responses, providing the transparency required for professional legal work.
🛡️ 3. Advanced Reasoning & Safety Guardrails
- Contextual Reasoning Engine: Upgraded the reasoning pipeline to synthesize retrieved legal context using high-level "System 2" deliberate thinking prompts.
- Production Safety Layers: Implemented a comprehensive
GuardrailServicethat automatically validates AI outputs for grounding (factual accuracy), toxicity, and hallucination before they are displayed to the user. - Automated Validation Suite: Added an internal test suite to verify the reliability of the guardrails and the accuracy of the hybrid retrieval system.
Second Checkpoint
The v0.2 release focuses on advancing the retrieval-augmented generation (RAG) pipeline, implementing rigorous safety guardrails, and grounding the system in specific legal contexts
🏗️ Advanced Retrieval & Reasoning
- Hybrid Search Implementation: Deployed a sophisticated hybrid retrieval system that combines dense vector search with BM25 keyword matching using Reciprocal Rank Fusion (RRF) for higher precision
- Symbolic Retrieval: Added a symbolic retrieval layer to query structured data within Neo4j, complementing the unstructured text search
- Enhanced Reasoning Pipeline: The reasoning service was updated to synthesize information from multiple retrieval sources before generating legal advice or contract analysis
⚖️ Legal Grounding & Knowledge Base
- Indonesian Legal Context: The system is now grounded in a specialized knowledge base including Indonesian labor laws (UU No. 13/2003, UU No. 6/2023), consumer protection (UU No. 8/1999), and electronic information regulations (UU No. 19/2016)
- Automated Seeding: Implemented scripts to automate the ingestion and vectorization of these legal documents into the Neo4j database
🛡️ Safety & Quality Assurance
- AI Guardrails: Introduced a dedicated
GuardrailServicethat evaluates AI-generated responses for grounding (factual accuracy), hallucination detection, and toxicity before they reach the user - Automated Testing: Added unit tests for critical path components, including the hybrid retrieval logic and guardrail validations, to ensure system reliability
🎨 Frontend & User Experience
- Project & Source Management: Developed a comprehensive UI for managing multiple legal projects and tracking document sources.
- Refined Chat Interface: The chat experience was upgraded with a
StudioPanelfor document drafting and aSourcesPanelto display the specific legal references used by the AI - Stateful UI Hooks: Implemented custom hooks (
useChat,useProjects,useSources) to handle complex frontend state and real-time updates
First Checkpoint
Release Notes: CLARA v0.1
CLARA (Contract & Legal AI Reasoning Assistant) v0.1 is now live! This initial release establishes the core infrastructure and foundational features for intelligent legal document processing and reasoning
🚀 Key Features
- Secure Authentication: Implemented Google OAuth integration via Passport for secure user access
- Asynchronous Document Analysis: Deployed an asynchronous OCR pipeline using Google Cloud Vision. This utilizes a worker queue to handle heavy document extraction and returns a
202 Acceptedstatus to prevent blocking - Contract Review Pipeline: Introduced a "Scan & Explain" endpoint specifically designed to process and review legal contracts.
- Interactive Legal Q&A: Enabled a dedicated querying system for users to ask specific legal questions
- Smart Document Drafter: Added a drafting chat interface (
/api/v1/drafter/chat) to assist users in structuring and generating legal documents
💻 Tech Stack & Architecture
- Frontend: Built with React 19 and Vite for fast performance and Hot Module Replacement. It utilizes Tailwind CSS (v4) for styling, React Hook Form for form handling, and Axios for API communication
- Backend: Powered by a robust Node.js/Express application written in TypeScript
- AI & Machine Learning: Integrated with Google Generative AI alongside Google Cloud Vision for advanced text processing and reasoning capabilities
- Database & Infrastructure: Configured Neo4j to handle schema and vector search capabilities, supported by Redis and BullMQ for managing background jobs
- API Documentation: Integrated Swagger UI for easily accessible and interactive API documentation at the
/api/docsendpoint