@fabrknt/complr-core
v1.0.3
Published
AI-powered compliance engine for digital assets — regulatory intelligence, screening, and reporting
Readme
@fabrknt/complr-core
AI-powered compliance engine for digital assets -- regulatory intelligence, transaction screening, and SAR/STR reporting across MAS, SFC, and FSA jurisdictions.
Not every DeFi protocol needs TradFi compliance -- but if yours does, you shouldn't have to rebuild from scratch. Fabrknt plugs into your existing protocol with composable SDKs and APIs. No permissioned forks, no separate deployments.
Install
npm install @fabrknt/complr-coreQuick Start
import { Complr } from "@fabrknt/complr-core";
import type { TransactionDetails, Jurisdiction } from "@fabrknt/complr-core";
const complr = new Complr({ anthropicApiKey: process.env.ANTHROPIC_API_KEY });
// Add regulatory documents to the knowledge base
complr.addDocument({ id: "mas-psa", jurisdiction: "MAS", title: "...", content: "..." });
// Query regulations in natural language
const answer = await complr.query("What is the Travel Rule threshold?", "MAS");
// Check transaction compliance across jurisdictions
const result = await complr.checkTransaction({
transactionId: "tx_001",
senderWallet: "0xabc...",
recipientWallet: "0xdef...",
amount: "10000",
currency: "USDC",
});Features
- Multi-jurisdiction compliance checks (MAS, SFC, FSA) in a single call
- Natural language regulatory queries with TF-IDF semantic search
- Confidence scoring and citation verification to mitigate LLM hallucination
- SAR/STR report generation in regulator-specific formats
- Obligation extraction from regulatory documents
- Regulatory delta analysis between document versions
- Multi-chain wallet address support (EVM, Solana, Bitcoin) with auto-detection
- Zero external dependencies for search, scoring, and screening logic
API
Complr Class
new Complr({ anthropicApiKey, model?, port?, jurisdictions? })-- create an instanceaddDocument(doc)-- add a regulatory document to the knowledge basequery(question, jurisdiction)-- natural language regulatory queryqueryWithConfidence(question, jurisdiction)-- query with confidence scores and citationscheckTransaction(tx, jurisdictions?)-- compliance check across jurisdictionsgenerateReport(tx, riskIndicators, jurisdiction)-- generate SAR/STR reportanalyzeDocument(doc)-- extract structured obligations from a documentanalyzeDelta(oldDoc, newDoc)-- compare two regulation versions
Re-exported Modules
RegulatoryKnowledgeBase-- document store with TF-IDF semantic searchRegulatoryAnalyzer-- LLM-powered regulatory analysisPolicyEngine-- multi-jurisdiction compliance engineReportGenerator-- SAR/STR report generationConfidenceScorer-- confidence scoring and hallucination detectiondetectAddressFormat(address)-- identify chain from address format
Types
ComplrConfig-- engine configurationJurisdiction--"MAS" | "SFC" | "FSA"TransactionDetails-- transaction input for compliance checksComplianceCheckResult-- structured check resultSarReport-- generated suspicious activity reportRegulatoryDocument,RegulatoryObligation-- knowledge base typesRegulatoryQueryResult,ConfidenceFactor,Citation-- confidence-scored query typesRegDelta-- regulatory document diffAddressFormat-- detected address chain format
Documentation
See the Complr repository README for full documentation, including server setup, admin dashboard, API endpoints, SDK integration, and deployment guides.
Related Packages
| Package | Description |
|---------|-------------|
| @fabrknt/complr-sdk | Standalone SDK client with retry, batch checks, and webhook handler |
| @fabrknt/complr-qn-addon | QuickNode Marketplace add-on for managed compliance |
License
MIT
