🌊

TideRAG

@carloscortezcloud/tiderag

RAG pipeline that runs 100% on Cloudflare free tier. Ingest documents, embed with Workers AI, store in Vectorize, query with ~20ms latency. Everyone else charges $70+/month for this. TideRAG costs $0.

Install
npm install @carloscortezcloud/tiderag

Cost Comparison

TideRAGPineconeSupabase
Monthly cost$0$70+$25+
EmbeddingsFree$0.02/1K$0.02/1K
Vectors (free)5M0~100K
Latency~20ms~80ms~50ms

Cloudflare Free Tier Stack

Vectorize
5M vectors
Workers AI
Free embeddings
D1
5GB SQLite
R2
10GB storage

Usage

import { TideRAG } from '@carloscortezcloud/tiderag';

const rag = new TideRAG({
  vectorize: env.VECTORIZE,  // CF binding
  ai: env.AI,                // CF binding
  d1: env.DB,                // CF binding
});

// Ingest
await rag.ingest({
  content: markdownText,
  metadata: { source: 'docs/api.md' },
  chunkStrategy: 'markdown',
});

// Query
const results = await rag.query('How do I authenticate?', { topK: 5 });
// → [{ text: "## Auth\nUse Bearer...", score: 0.87, metadata }]
GitHub →npm →Demo →

When to Use TideRAG

3 Chunking Strategies

markdown

Splits by headers (## ###). Best for documentation.

paragraph

Splits by double newlines. Best for prose/articles.

sliding

Fixed window with overlap. Best for unstructured text.

Use as Agent Tool

// Integrate as a Tinkuy agent tool:
const searchKnowledge = defineTool({
  name: 'search_knowledge',
  description: 'Search docs for answers',
  execute: async (args) => rag.query(args.question),
});