Back to Docs

Packages

Six powerful packages with built-in compliance, guidelines, and context optimization

@aicofounder/compliance

NEW

Automatic HIPAA, SEC, GDPR, CCPA compliance enforcement

npm install @aicofounder/compliance

API

ComplianceEnforcerMain enforcement engine
PresetRules.hipaa()HIPAA compliance preset
PresetRules.sec()SEC/FINRA compliance
PresetRules.gdpr()GDPR compliance
PresetRules.ccpa()CCPA compliance
enforce()Enforce compliance on requests
getViolations()Get violation history
detectPII()Detect PII in content

Example

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

NEW

Dynamic behavioral control with context-aware rules

npm install @aicofounder/guidelines

API

GuidelineManagerMain manager class
createGuideline()Create custom guidelines
PresetGuidelines8+ preset guidelines
ConditionsCondition builders
match()Match guidelines to context
validate()Validate responses
getAnalytics()View guideline analytics

Example

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

NEW

Handle 400K+ token contexts with 70% cost savings

npm install @aicofounder/context-optimizer

API

ContextOptimizerMain optimizer class
optimize()Optimize context size
prioritizeFiles()File prioritization
chunkRepository()Smart chunking
scoreQuality()Content quality scoring
getCacheStats()Cache statistics

Example

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 style
translate()Translate to any language
classify()Classify into categories
extract()Extract structured data
sentiment()Analyze sentiment
answer()Answer questions from context
rewrite()Rewrite in different styles
generate()Generate content
compare()Compare texts
moderate()Content moderation

Example

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 class
register()Register prompts with versioning
execute()Execute with tracking
createABTest()A/B test variants
getAnalytics()View prompt analytics
usePrompt()React hook for prompts

Example

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 pipelines
createRAGPipeline()Custom pipeline builder
SemanticChunkerSemantic text chunking
HybridRetrieverVector + keyword search
CrossEncoderRerankerRe-ranking results
useRAG()React hook for RAG

Example

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?',
});