Clarity Labs is an applied AI research lab building the infrastructure for AI to work safely with insurance.
CL SDK is the open infrastructure layer for AI agents working with insurance — a pure TypeScript library for extracting, reasoning about, and acting on insurance documents. Provider-agnostic by design: bring any LLM via plain callback functions. No framework dependency.
Capabilities
Document Extraction
Agentic pipeline with 11 focused extractors that turns insurance PDFs into structured data — coverages, limits, exclusions, endorsements — with page-level provenance and review loops.
Query Agent
Citation-backed question answering over stored documents. Decomposes questions, retrieves evidence, reasons with intent-specific prompts, and verifies grounding.
Application Processing
Eight focused agents handle application intake — field extraction, auto-fill from prior answers, topic-based question batching, and PDF mapping.
Agent System
Composable prompt modules for building insurance-aware conversational agents across email, chat, SMS, Slack, and Discord.
Storage & Memory
DocumentStore and MemoryStore interfaces for persisting extracted documents, vector chunks, and conversation history. Includes SQLite reference implementation.
Install
npm install @claritylabs/cl-sdk pdf-lib zod
import { createExtractor } from "@claritylabs/cl-sdk";
const extractor = createExtractor({ generateText, generateObject });
const { document, chunks } = await extractor.extract(pdfBase64);
console.log(document.carrier); // "Hartford"
console.log(document.coverages); // [{ name: "General Liability", limit: "$1,000,000", ... }]
console.log(chunks.length); // 24 chunks ready for vector storage
Get started
Quickstart
Install CL SDK and run your first extraction in minutes.
Architecture
Understand the agentic extraction pipeline and how components fit together.
Provider Callbacks
Connect any LLM provider via plain callback functions.
Storage
Persist documents, chunks, and conversation history.
API Reference
Full reference for every exported function and type.