Back to Docs
Packages
Six powerful packages with built-in compliance, guidelines, and context optimization
@aicofounder/compliance
NEWAutomatic HIPAA, SEC, GDPR, CCPA compliance enforcement
npm install @aicofounder/compliance
API
ComplianceEnforcerMain enforcement enginePresetRules.hipaa()HIPAA compliance presetPresetRules.sec()SEC/FINRA compliancePresetRules.gdpr()GDPR compliancePresetRules.ccpa()CCPA complianceenforce()Enforce compliance on requestsgetViolations()Get violation historydetectPII()Detect PII in contentExample
import { ComplianceEnforcer, PresetRules } from '@aicofounder/compliance';
const enforcer = new ComplianceEnforcer([
PresetRules.hipaa(),
PresetRules.gdpr()
]);
const result = await enforcer.enforce({
request: userMessage,
response: aiResponse
});
if (result.action === 'block') {
console.log('Compliance violation:', result.violations);
}@aicofounder/guidelines
NEWDynamic behavioral control with context-aware rules
npm install @aicofounder/guidelines
API
GuidelineManagerMain manager classcreateGuideline()Create custom guidelinesPresetGuidelines8+ preset guidelinesConditionsCondition buildersmatch()Match guidelines to contextvalidate()Validate responsesgetAnalytics()View guideline analyticsExample
import { GuidelineManager, PresetGuidelines, Conditions } from '@aicofounder/guidelines';
const manager = new GuidelineManager();
await manager.addGuideline(
PresetGuidelines.noMedicalAdvice()
);
const matched = await manager.match({
topic: 'medical',
message: 'I have a headache'
});
console.log(matched); // Returns matching guidelines@aicofounder/context-optimizer
NEWHandle 400K+ token contexts with 70% cost savings
npm install @aicofounder/context-optimizer
API
ContextOptimizerMain optimizer classoptimize()Optimize context sizeprioritizeFiles()File prioritizationchunkRepository()Smart chunkingscoreQuality()Content quality scoringgetCacheStats()Cache statisticsExample
import { ContextOptimizer } from '@aicofounder/context-optimizer';
const optimizer = new ContextOptimizer({
strategy: 'hybrid',
maxTokens: 400000
});
const result = await optimizer.optimize({
files: repositoryFiles,
query: 'Explain the authentication flow'
});
console.log(result.tokens); // ~400K tokens (from 2.5M)
console.log(result.costSavings); // ~70%@aicofounder/helpers
10 one-line AI functions for common tasks
npm install @aicofounder/helpers
API
summarize()Summarize text with customizable styletranslate()Translate to any languageclassify()Classify into categoriesextract()Extract structured datasentiment()Analyze sentimentanswer()Answer questions from contextrewrite()Rewrite in different stylesgenerate()Generate contentcompare()Compare textsmoderate()Content moderationExample
import { summarize, translate, classify } from '@aicofounder/helpers';
const summary = await summarize(document, { style: 'brief' });
const spanish = await translate(text, { to: 'es' });
const category = await classify(email, ['spam', 'ham']);@aicofounder/prompts
Enterprise prompt management with versioning and A/B testing
npm install @aicofounder/prompts
API
PromptManagerMain manager classregister()Register prompts with versioningexecute()Execute with trackingcreateABTest()A/B test variantsgetAnalytics()View prompt analyticsusePrompt()React hook for promptsExample
import { PromptManager } from '@aicofounder/prompts';
const pm = new PromptManager({ workspace: 'app' });
await pm.register('greeting', {
template: 'Hello {{name}}!',
variables: ['name'],
});
const result = await pm.execute('greeting', {
variables: { name: 'John' },
});@aicofounder/rag
Advanced RAG with hybrid retrieval and re-ranking
npm install @aicofounder/rag
API
RAGPresetsPre-configured pipelinescreateRAGPipeline()Custom pipeline builderSemanticChunkerSemantic text chunkingHybridRetrieverVector + keyword searchCrossEncoderRerankerRe-ranking resultsuseRAG()React hook for RAGExample
import { RAGPresets } from '@aicofounder/rag';
const pipeline = RAGPresets.balanced();
await pipeline.index([
{ id: 'doc1', content: '...' },
]);
const result = await pipeline.query({
query: 'How does this work?',
});