RAGtime is a lightweight and intuitive Retrieval-Augmented Generation (RAG) framework built for LLM workflows. It supports PDF and raw text embedding, storage, and retrieval using OpenAI embeddings and Qdrant vector search.
Text is automatically chunked and embedded with relevant summaries, and queries return contextually similar results via cosine similarity.
- 📄 Embed PDFs and raw text content
- ⚙️ Chunking with optional summarisation
- 🧠 Vector embeddings with OpenAI
- 📦 Embedding storage in Qdrant
- 🔍 Querying across single or multiple collections
- 🧪 Tests double as usage examples
- Bun runtime
- Docker + Docker Compose (for Qdrant)
- OpenAI API Key
- Install Dependencies
bun install
- Setup Qdrant and Run Tests
bun run setup
This will:
- Build and run Qdrant via Docker Compose
- Run the full test suite to verify embedding/query workflows
import OpenAI from 'openai'
import { EmbeddingProcessingService } from '@@services/EmbeddingProcessing.service'
const openai = new OpenAI({ apiKey: process.env.OPENAI_API_KEY })
const embeddingProcessor = new EmbeddingProcessingService(openai)
const { embeddingId } = await embeddingProcessor.embedPDF('path/to/file.pdf')
const input = [
'Some historical account...',
'Details about your hardware...',
]
const { embeddingId } = await embeddingProcessor.embedText(input)
import { EmbeddingQueryService } from '@@services/EmbeddingQuery.service'
import { EmbeddingManagementService } from '@@services/EmbeddingManagement.service'
const queryService = new EmbeddingQueryService(
new EmbeddingManagementService(),
embeddingProcessor
)
const results = await queryService.query('What year did I get the Amiga 500?', embeddingId!)
console.log(results)
const results = await queryService.queryCollections(
'What GPUs did I use and how is key exchange done?',
[embeddingId1, embeddingId2],
2
)
console.log(results)
Create a .env
file in your project root with:
OPENAI_API_KEY=your-key-here
Run all tests with:
bun test
Test files in spec/
demonstrate full examples of:
- PDF embedding and querying
- Text chunking and embedding
- Multi-document collection search
- Expected RAG-based responses
MIT © Eugene Odeluga