Back to Docs
Quick Start
Get up and running with RANA in 5 minutes
1Install Packages
npm install @rana/helpers @rana/prompts @rana/rag
2Use @rana/helpers for One-Line AI
import { summarize, translate, classify, extract } from '@rana/helpers';
// Summarize any text
const summary = await summarize(longDocument, { style: 'brief' });
// Translate to any language
const spanish = await translate(text, { to: 'es' });
// Classify into categories
const category = await classify(email, ['support', 'sales', 'billing']);
// Extract structured data
const data = await extract(resume, {
name: 'string',
email: 'string',
skills: 'string[]'
});3Use @rana/prompts for Enterprise Management
import { PromptManager } from '@rana/prompts';
const pm = new PromptManager({ workspace: 'my-app' });
// Register a prompt with versioning
await pm.register('greeting', {
template: 'Hello {{name}}, how can I help you today?',
variables: ['name'],
});
// Execute with automatic tracking
const result = await pm.execute('greeting', {
variables: { name: 'John' },
});
// A/B test different variants
await pm.createABTest('greeting', {
variants: [
{ name: 'formal', template: 'Good day, {{name}}.' },
{ name: 'casual', template: 'Hey {{name}}!' },
],
metric: 'user_satisfaction',
});4Use @rana/rag for Advanced Retrieval
import { RAGPresets, createRAGPipeline } from '@rana/rag';
// Use a preset for quick setup
const pipeline = RAGPresets.balanced();
// Index your documents
await pipeline.index([
{ id: 'doc1', content: 'Your documentation content...' },
{ id: 'doc2', content: 'More content here...' },
]);
// Query with automatic citations
const result = await pipeline.query({
query: 'How do I configure authentication?',
});
console.log(result.answer); // Generated answer
console.log(result.citations); // Source references
console.log(result.sources); // Unique documents usedWhat You Get
70% automatic cost reduction
9 LLM providers supported
Intelligent caching
Automatic retries & fallbacks
Real-time cost tracking
TypeScript support
React hooks included
Enterprise security