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-baseService Catalog
| Service | Package | Description |
|---|---|---|
| Document Analysis | @aicr/da-core | AI-powered document analysis with extraction and scoring |
| Document Parser | @aicr/document-parser | Parse PDF, DOCX, XLSX into structured data |
| Document Generator | @aicr/document-generator | Generate DOCX, XLSX with templates |
| Email Service | @aicr/email-service | Transactional email with Resend |
| Knowledge Base | @aicr/knowledge-base | RAG, embeddings, and semantic search |
| Design Service | @aicr/design-core | Framework generation and playbooks |
| Dispute Service | @aicr/dispute-core | Case management and resolution |
| Oversight Service | @aicr/oversight-core | Approvals, audit, and compliance |
| GOCC | @aicr/gocc-client | Trust layer for policy and PII |
Architecture Pattern
All services follow the X*M Module Pattern:
DESIGN → OPERATE → DISPUTE → OVERSEE- Design - Create frameworks, plans, configurations
- Operate - Execute analysis, generate documents
- Dispute - Handle exceptions and resolution
- 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' }
});