Build complete retrieval pipelines
Ingest files, URLs, office documents, archives, images, and media transcripts; synchronize durable sources; and search with lexical, vector, hybrid, transformed, and reranked retrieval.
@absolutejs/ragv0.6.2betaAIStandalone RAG runtime for Bun and Elysia apps: ingestion, hybrid retrieval, source sync, and evaluation over pluggable vector stores.
A standalone RAG runtime for Bun and Elysia apps covering the full pipeline: document ingestion and chunking, embedding, hybrid retrieval with reranking, source sync, and retrieval-quality evaluation. Vector storage is pluggable behind a single RAGVectorStore contract, with published adapters for Postgres (pgvector), SQLite, and Pinecone alongside a built-in in-memory store. It pairs with @absolutejs/ai for the model side and ships framework bindings for React, Vue, Svelte, and Angular via subpath exports.
bun add @absolutejs/ragA standalone RAG runtime for Bun and Elysia applications covering document ingestion, chunking, embeddings, hybrid retrieval, reranking, source synchronization, evaluation, client primitives, and framework bindings.
The built-in memory store supports development and tests. Published adapters provide PostgreSQL with pgvector, SQLite with optional vec0 acceleration, and Pinecone behind the same RAGVectorStore contract. Lexical and vector results can be fused, transformed, and reranked with provider or heuristic rerankers.
The ingestion pipeline handles files, directories, uploads, URLs, PDFs, office documents, archives, images, and media transcripts. Scheduled connectors can keep collections synchronized from email, GitHub, sitemaps, feeds, directories, and S3-compatible storage.
@absolutejs/rag/quality evaluates retrieval relevance and answer grounding, compares strategies and rerankers, and records runs against a baseline so retrieval changes can be tested before release.
@absolutejs/rag/client and /client/ui provide browser-side primitives.
@absolutejs/rag/react, /vue, /svelte, and /angular provide framework bindings.
@absolutejs/rag/adapter-kit exposes the contracts used by vector-store adapters.
@absolutejs/rag/ui exposes presentation-neutral UI contracts.
Pair the retrieval runtime with @absolutejs/ai when retrieved context should feed a model or streaming assistant.
One RAGVectorStore contract with an in-memory store built in and Postgres, SQLite, and Pinecone adapters published separately, so swapping backends does not touch retrieval code.
Embedding providers for OpenAI, Gemini, Mistral, Ollama, xAI, DeepSeek, and more, plus any OpenAI-compatible endpoint, behind a single provider interface.
Lexical and vector results fuse into hybrid search, with query transforms and rerankers (Cohere, Jina, Voyage, or heuristic) applied per collection.
Extractors for PDFs (including OCR), EPUB, office and legacy documents, archives, images, and media transcripts turn raw files, directories, uploads, and URLs into chunked documents.
Sync sources for email (Gmail, Microsoft Graph, IMAP), GitHub repos, sitemaps, feeds, directories, and S3-compatible storage keep collections current on a scheduler.
Evaluation suites score retrieval and answer grounding, compare strategies and rerankers, and persist run history so retrieval changes ship against a baseline.
Outcomes
Ingest files, URLs, office documents, archives, images, and media transcripts; synchronize durable sources; and search with lexical, vector, hybrid, transformed, and reranked retrieval.
Swap memory, PostgreSQL/pgvector, SQLite/vec0, and Pinecone stores behind one contract and expose retrieval through framework-neutral or framework-specific clients.
Hardening checklist
Follow in order
Working example for Quick start.
import {
createInMemoryRAGStore,
createRAGCollection,
ingestRAGDocuments,
openaiEmbeddings,
searchDocuments
} from '@absolutejs/rag';
const collection = createRAGCollection({
embedding: openaiEmbeddings({
apiKey: process.env.OPENAI_API_KEY ?? '',
defaultModel: 'text-embedding-3-small'
}),
store: createInMemoryRAGStore()
});
await ingestRAGDocuments(collection, {
documents: [{ id: 'intro', text: 'AbsoluteJS ships typed Bun primitives.' }]
});
const results = await searchDocuments(collection, {
query: 'What does AbsoluteJS ship?',
topK: 3
});Create a collection over the built-in in-memory store, ingest documents, and run a similarity search.
import {
createInMemoryRAGStore,
createRAGCollection,
ingestRAGDocuments,
openaiEmbeddings,
searchDocuments
} from '@absolutejs/rag';
const collection = createRAGCollection({
embedding: openaiEmbeddings({
apiKey: process.env.OPENAI_API_KEY ?? '',
defaultModel: 'text-embedding-3-small'
}),
store: createInMemoryRAGStore()
});
await ingestRAGDocuments(collection, {
documents: [
{
id: 'getting-started',
text: 'AbsoluteJS ships full-stack primitives for Bun and Elysia.',
title: 'Getting Started'
}
]
});
const results = await searchDocuments(collection, {
query: 'What does AbsoluteJS ship?',
topK: 3
});Swap the in-memory store for pgvector by installing @absolutejs/rag-postgres; the collection API stays identical.
import { createPostgresRAG } from '@absolutejs/rag-postgres';
const { collection, store } = createPostgresRAG({
storeOptions: {
connectionString: process.env.DATABASE_URL,
dimensions: 1536,
distanceMetric: 'cosine',
indexType: 'hnsw'
}
});Published vector-store adapters that implement the RAGVectorStore contract from @absolutejs/rag. Each ships as its own package, so you install only the backend (and its heavy dependencies) you actually use.
Search the declarations exported by the current package type files. Expand a symbol to inspect its source-backed signature.
Current package surface
Import surface · click to copy