Back to Docs
Packages
Three powerful packages that work together or standalone
@rana/helpers
10 one-line AI functions for common tasks
npm install @rana/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 '@rana/helpers';
const summary = await summarize(document, { style: 'brief' });
const spanish = await translate(text, { to: 'es' });
const category = await classify(email, ['spam', 'ham']);@rana/prompts
Enterprise prompt management with versioning and A/B testing
npm install @rana/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 '@rana/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' },
});@rana/rag
Advanced RAG with hybrid retrieval and re-ranking
npm install @rana/rag
API
RAGPresetsPre-configured pipelinescreateRAGPipeline()Custom pipeline builderSemanticChunkerSemantic text chunkingHybridRetrieverVector + keyword searchCrossEncoderRerankerRe-ranking resultsuseRAG()React hook for RAGExample
import { RAGPresets } from '@rana/rag';
const pipeline = RAGPresets.balanced();
await pipeline.index([
{ id: 'doc1', content: '...' },
]);
const result = await pipeline.query({
query: 'How does this work?',
});