Services SDK
Overview

Universal Services SDK

The AICR Universal Services SDK provides a collection of reusable capability services that enable "build once, sell many" architecture for enterprise applications.

Installation

# Install all services
pnpm add @aicr/da-core @aicr/design-core @aicr/dispute-core @aicr/oversight-core @aicr/gocc-client
 
# Install utility services
pnpm add @aicr/document-parser @aicr/document-generator @aicr/email-service @aicr/knowledge-base

Service Catalog

ServicePackageDescription
Document Analysis@aicr/da-coreAI-powered document analysis with extraction and scoring
Document Parser@aicr/document-parserParse PDF, DOCX, XLSX into structured data
Document Generator@aicr/document-generatorGenerate DOCX, XLSX with templates
Email Service@aicr/email-serviceTransactional email with Resend
Knowledge Base@aicr/knowledge-baseRAG, embeddings, and semantic search
Design Service@aicr/design-coreFramework generation and playbooks
Dispute Service@aicr/dispute-coreCase management and resolution
Oversight Service@aicr/oversight-coreApprovals, audit, and compliance
GOCC@aicr/gocc-clientTrust layer for policy and PII

Architecture Pattern

All services follow the X*M Module Pattern:

DESIGN → OPERATE → DISPUTE → OVERSEE
  1. Design - Create frameworks, plans, configurations
  2. Operate - Execute analysis, generate documents
  3. Dispute - Handle exceptions and resolution
  4. Oversee - Audit, approve, and govern

Trust Layer Integration

All services route through GOCC (Governance Operations Control Center) for:

  • Policy evaluation before actions
  • PII detection and redaction
  • Audit logging and compliance
  • Usage metering and billing
import { createGOCCClient } from '@aicr/gocc-client';
 
const gocc = createGOCCClient({ baseUrl: '/api/gocc' });
 
// Check policy before action
const allowed = await gocc.evaluatePolicy({
  action: 'document.export',
  resource: documentId,
  actor: userId
});

Quick Start

// 1. Parse a document
import { parseDocument } from '@aicr/document-parser';
const parsed = await parseDocument(pdfBuffer, { filename: 'report.pdf' });
 
// 2. Analyze with AI
import { analyzeDocument } from '@aicr/da-core';
const analysis = await analyzeDocument({
  content: parsed.text,
  templateId: 'gap-analysis'
});
 
// 3. Generate report
import { generateDOCX } from '@aicr/document-generator';
const report = await generateDOCX({
  title: 'Analysis Report',
  sections: analysis.sections
});
 
// 4. Send notification
import { sendTemplateEmail } from '@aicr/email-service';
await sendTemplateEmail('analysis-complete', {
  to: 'user@example.com',
  data: { documentName: 'Q4 Report', status: 'completed' }
});