Status: v0.3.0 - Production-ready with AI SDK integration, MCP, and PostgreSQL support β
The TypeScript-first RAG toolkit. Simple, composable, production-ready.
Make knowledge usable. Anywhere.
- Ingest β Turn any source into structured, searchable knowledge
- Embed β Choose your adapter, your model, your storage
- Retrieve β Query with hybrid search (vector + lexical)
- Answer β Universal LLM support via AI SDK (20+ providers)
- Integrate β MCP for Claude Code, API for apps
π Product Roadmap | β Star on GitHub
NEW: Universal answerer supports OpenAI, Anthropic, Cohere, and 20+ providers with one line change:
import { createOrquel } from '@orquel/core';
import { aiSDKAnswerer } from '@orquel/answer-aisdk';
import { openai } from '@ai-sdk/openai';
import { anthropic } from '@ai-sdk/anthropic';
// OpenAI
const orq = createOrquel({
embeddings: openAIEmbeddings(),
vector: pgvectorStore({ connectionString: process.env.DATABASE_URL }),
answerer: aiSDKAnswerer({ model: openai('gpt-4-turbo') })
});
// Switch to Anthropic? Just change one line:
const orq = createOrquel({
embeddings: openAIEmbeddings(),
vector: pgvectorStore({ connectionString: process.env.DATABASE_URL }),
answerer: aiSDKAnswerer({ model: anthropic('claude-3-5-sonnet-20241022') })
});Stream with AI SDK tools:
import { createOrquelTools } from '@orquel/integration-aisdk';
import { streamText } from 'ai';
const tools = createOrquelTools(orq, {
search: { hybridSearch: true },
answer: { defaultTopK: 4 }
});
const result = streamText({
model: openai('gpt-4-turbo'),
tools, // AI can search your knowledge base
maxSteps: 5,
prompt: 'What is RAG?'
});Benefits:
- β One adapter, 20+ providers (OpenAI, Anthropic, Cohere, Mistral, Groq, local models)
- β Easy provider switching (change one line)
- β Streaming built-in via AI SDK
- β Tool calling for chat interfaces
- β Future-proof (new providers supported automatically)
Orquel is a TypeScript-first toolkit for building knowledge bases and RAG systems. Today's devs reinvent the wheel: writing chunkers, wiring embeddings, gluing vector stores. Orquel makes this simple, composable, and consistent.
| Feature | Orquel | LangChain | LlamaIndex | Vercel AI SDK |
|---|---|---|---|---|
| Focus | RAG pipelines | General LLM | RAG (Python) | Chat/streaming UI |
| TypeScript DX | βββββ Best | βββ Good | ββ Secondary | βββββ Best |
| Dependencies | 0 (core) | Heavy | Medium | Medium |
| Hybrid Search | β Built-in RRF | Manual | β Yes | β Manual |
| Benchmarking | β Built-in | β None | β Limited | β None |
| LLM Providers | 20+ via AI SDK | Many | Many | 20+ |
| API Complexity | Simple | Complex | Medium | Simple |
- DX First: 4 lines to get started; strict TypeScript; minimal, ergonomic API
- Zero Dependencies (Core): No supply chain risk, minimal bundle size
- Composable: Swap embeddings, vector DBs, lexical search, answerers via adapters
- Production Ready: PostgreSQL + pgvector, hybrid search, connection pooling
- AI SDK Integration: Universal answerer + streaming + tool calling
- MCP Native: 11 tools for Claude Code and AI assistants
- Performance Focused: Built-in benchmarking and evaluation harness
- Extensible: Clean adapter interfaces, easy to customize
Positioning: The "Express.js of RAG" β focused, minimal, developer-friendly.
- Node.js 18+
- OpenAI API key (or any AI SDK provider)
- PostgreSQL with pgvector (for production) or in-memory (for development)
# Option 1: Add to existing project
npm install @orquel/core @orquel/answer-aisdk ai @ai-sdk/openai
# Option 2: Create new project
npx create-orquel-app@latest my-rag-app
cd my-rag-app
cp .env.example .env
# Add your OPENAI_API_KEY
npm run devimport { createOrquel } from '@orquel/core';
import { openAIEmbeddings } from '@orquel/embeddings-openai';
import { memoryStore } from '@orquel/store-memory';
import { aiSDKAnswerer } from '@orquel/answer-aisdk';
import { openai } from '@ai-sdk/openai';
// 1. Create Orquel instance
const orq = createOrquel({
embeddings: openAIEmbeddings(),
vector: memoryStore(), // Use pgvectorStore() in production
answerer: aiSDKAnswerer({ model: openai('gpt-4-turbo') })
});
// 2. Ingest documents
const { chunks } = await orq.ingest({
source: { title: 'Product Guide' },
content: '# Features\nOur product has AI-powered search and analytics.'
});
// 3. Index for search
await orq.index(chunks);
// 4. Ask questions
const { answer, contexts } = await orq.answer('What features does the product have?');
console.log(answer);
// β "The product has AI-powered search and analytics features."Expose Orquel as AI SDK tools that the model can call:
import { createOrquelTools } from '@orquel/integration-aisdk';
import { streamText } from 'ai';
import { openai } from '@ai-sdk/openai';
const tools = createOrquelTools(orq, {
search: { hybridSearch: true, defaultLimit: 5 },
answer: { defaultTopK: 4 },
ingest: true // Allow dynamic knowledge updates
});
// Use in API route (Next.js example)
export async function POST(req: Request) {
const { messages } = await req.json();
const result = streamText({
model: openai('gpt-4-turbo'),
tools,
maxSteps: 5,
system: 'You are a helpful assistant with access to a knowledge base.',
messages
});
return result.toUIMessageStreamResponse();
}Use case: Chat interfaces, agent systems, dynamic knowledge updates
Automatically inject relevant context into every message:
import { createOrquelMiddleware } from '@orquel/integration-aisdk';
const middleware = createOrquelMiddleware(orq, {
autoInject: true,
topK: 3,
threshold: 0.7
});
const result = streamText({
model: openai('gpt-4-turbo'),
experimental_providerMetadata: { orquel: middleware },
messages
});
// Context automatically retrieved and injected!Use case: Transparent RAG, simpler applications, always-on context
Use Orquel directly without AI SDK for REST APIs:
// app/api/search/route.ts
export async function POST(req: Request) {
const { query } = await req.json();
const { results } = await orq.query(query, { hybrid: true });
return Response.json({ results });
}
// app/api/answer/route.ts
export async function POST(req: Request) {
const { question } = await req.json();
const { answer, contexts } = await orq.answer(question);
return Response.json({ answer, sources: contexts });
}Use case: REST APIs, batch processing, non-interactive systems
- β
@orquel/coreβ Core orchestrator, types, hybrid search, benchmarking - β
orquelβ Meta package with CLI - β
create-orquel-appβ Project scaffolder
- β
@orquel/answer-aisdkβ Universal answerer (20+ providers via AI SDK) - β
@orquel/integration-aisdkβ Helper tools (createOrquelTools, middleware)
- β
@orquel/store-pgvectorβ PostgreSQL + pgvector (production storage) - β
@orquel/lexical-postgresβ PostgreSQL full-text search - β
@orquel/embeddings-openaiβ OpenAI text-embedding-3-small/large β οΈ @orquel/answer-openaiβ DEPRECATED (use@orquel/answer-aisdk)
- β
@orquel/store-memoryβ In-memory vector storage
- β
@orquel/mcp-serverβ Model Context Protocol server (11 tools)
- β Minimal Node.js β Basic RAG implementation
- β AI SDK Basic β Chat interface with streaming
- β PostgreSQL Hybrid β Production setup
- β MCP Integrations β Claude Code integration
- π§
@orquel/store-pineconeβ Pinecone vector database - π§
@orquel/store-qdrantβ Qdrant vector database - π§
@orquel/rerank-cohereβ Cohere reranking - π§
@orquel/ingest-pdfβ PDF document parsing
Orquel uses an adapter-driven architecture that makes every component swappable:
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β Your Application β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β Orquel Orchestrator β
β βββββββββββββββ βββββββββββββββ βββββββββββββββ β
β β ingest β β index β β query β β
β β & chunk β β embeddings β β & answer β β
β βββββββββββββββ βββββββββββββββ βββββββββββββββ β
β βββββββββββββββ βββββββββββββββ βββββββββββββββ β
β β hybrid β β benchmark β β evaluation β β
β β search β β performance β β metrics β β
β βββββββββββββββ βββββββββββββββ βββββββββββββββ β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β Adapter Layer β
β ββββββββββββββββ ββββββββββββββββ ββββββββββββββββ β
β β Embeddings β β Vector Store β β Answerer β β
β β Adapter β β Adapter β β (AI SDK) β β
β ββββββββββββββββ ββββββββββββββββ ββββββββββββββββ β
β ββββββββββββββββ ββββββββββββββββ ββββββββββββββββ β
β β Lexical β β MCP β β Benchmark β β
β β Search β β Tools β β Suite β β
β ββββββββββββββββ ββββββββββββββββ ββββββββββββββββ β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β Implementation Layer β
β ββββββββββββββββ ββββββββββββββββ ββββββββββββββββ β
β β OpenAI β β PostgreSQL β β OpenAI β β
β β Embeddings β β + pgvector β β Anthropic β β
β β β β β β Cohere, etc. β β
β ββββββββββββββββ ββββββββββββββββ ββββββββββββββββ β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
Key Benefits:
- π Composable β Mix and match adapters
- π Upgradeable β Swap dev tools for production (memory β pgvector)
- π§ͺ Testable β Mock any component
- π― Focused β Each adapter has one job
- π Hybrid β Combine vector + lexical search
- π Measurable β Built-in benchmarking
Combine vector similarity and full-text search for superior results:
const results = await orq.query('machine learning applications', {
hybrid: true,
denseWeight: 0.7, // Vector similarity weight
lexicalWeight: 0.3, // Full-text search weight
k: 10
});Algorithms:
- Reciprocal Rank Fusion (RRF) β Robust, no score calibration needed
- Weighted Combination β Normalized score fusion
Built-in performance testing:
import { benchmarkVectorStore } from '@orquel/core';
const results = await benchmarkVectorStore(vectorStore, {
chunkCount: 1000,
queryCount: 100,
dimensions: 1536
});
console.log(`Avg query time: ${results.averageQueryTime}ms`);
console.log(`Throughput: ${results.queriesPerSecond} QPS`);Measure RAG quality:
import { RAGEvaluator } from '@orquel/core';
const evaluator = new RAGEvaluator(orq);
const metrics = await evaluator.evaluate(groundTruthQueries);
console.log(`F1 Score: ${metrics.f1Score.toFixed(3)}`);
console.log(`MRR: ${metrics.mrr.toFixed(3)}`);11 tools for Claude Code and AI assistants:
# Install MCP server
npm install @orquel/mcp-server
# Start server
orquel mcp serve --stdio
# Available tools:
# - ingest, query, answer, list-sources, clear
# - hybrid-search, optimize-search, benchmark
# - analyze-kb, reindex, semantic-clustersEnterprise-ready vector storage:
import { pgvectorStore } from '@orquel/store-pgvector';
import { postgresLexical } from '@orquel/lexical-postgres';
const orq = createOrquel({
embeddings: openAIEmbeddings(),
vector: pgvectorStore({
connectionString: process.env.DATABASE_URL,
dimensions: 1536,
indexType: 'hnsw' // or 'ivfflat'
}),
lexical: postgresLexical({
connectionString: process.env.DATABASE_URL
})
});Features:
- Connection pooling (20 max, 5 min)
- ACID transactions
- HNSW and IVFFlat indexes
- Health checks and stats
- Batch operations
// Build a help center
const docs = createOrquel({
embeddings: openAIEmbeddings(),
vector: pgvectorStore({ connectionString: '...' }),
lexical: postgresLexical({ connectionString: '...' }),
answerer: aiSDKAnswerer({ model: openai('gpt-4-turbo') })
});
await docs.ingest({ source: { title: 'API Guide' }, content: apiDocs });
const { answer } = await docs.answer('How do I authenticate?');// Analyze research papers
const research = createOrquel({
embeddings: openAIEmbeddings({ model: 'text-embedding-3-large' }),
vector: pgvectorStore({ connectionString: '...' }),
answerer: aiSDKAnswerer({ model: anthropic('claude-3-5-sonnet-20241022') })
});
// Semantic clustering
const clusters = await semanticClusters(research);// Make your codebase searchable
const codebase = createOrquel({
embeddings: openAIEmbeddings(),
vector: pgvectorStore({ connectionString: '...' }),
lexical: postgresLexical({ connectionString: '...' })
});
// Hybrid search for best results
const results = await codebase.query('authentication middleware', {
hybrid: true
});# Start MCP server for Claude Code
orquel mcp serve --stdio
# Use in Claude Code:
# "Search my knowledge base for authentication docs"
# Claude automatically calls Orquel MCP toolsimport type { EmbeddingsAdapter } from '@orquel/core';
export function customEmbeddings(): EmbeddingsAdapter {
return {
name: 'custom-embeddings',
dim: 768,
async embed(texts: string[]): Promise<number[][]> {
// Your implementation
return await yourService.embed(texts);
}
};
}git clone https://github.com/0xkoller/orquel.git
cd orquel
pnpm install
pnpm build
pnpm test# Run benchmarks
pnpm test:performance
# Integration tests (requires PostgreSQL)
pnpm test:integrationSee PRODUCT_ROADMAP.md for complete strategic vision.
- β AI SDK universal answerer (20+ providers)
- β AI SDK integration helpers (tools, middleware)
- β MCP server (11 tools)
- β PostgreSQL + pgvector
- β Hybrid search (RRF, weighted)
- β Benchmarking & evaluation
- More embeddings adapters (Cohere, Voyage)
- Vector store adapters (Pinecone, Qdrant)
- Document parsers (PDF, DOCX)
- Reranking (Cohere)
- Documentation site
- Stable API
- Comprehensive docs site
- Production templates
- Hosted platform (Supabase for RAG)
- TypeScript/Node.js developers
- Teams building RAG systems
- Developers who value clean code and type safety
- Projects needing production PostgreSQL
- AI assistant builders (MCP integration)
- Performance-conscious teams
- Startups and scale-ups
- Python-first teams β Use LlamaIndex or Haystack
- Need 100+ pre-built integrations β Use LangChain
- Chat UI only β Use Vercel AI SDK alone
- Enterprise legacy requirements β Use Haystack
- Use with Vercel AI SDK for streaming chat UIs
- Use with MCP for AI assistant integration
- Use with PostgreSQL for production storage
- Use with Next.js for web applications
We welcome contributions! Orquel is designed to be community-driven.
Ways to contribute:
- π Bug reports β Open an issue
- π‘ Feature requests β Start a discussion
- π Build adapters β Extend the ecosystem
- π Improve docs β Help others get started
- β Add tests β Increase reliability
Getting started:
- Fork the repository
- Create a feature branch:
git checkout -b feature/amazing-adapter - Make your changes and add tests
- Run
pnpm build && pnpm test - Submit a pull request
Popular contribution ideas:
- Adapters for Cohere, Voyage, Mistral (embeddings)
- Vector store adapters (Pinecone, Qdrant, Weaviate)
- Document parsers (PDF, DOCX, Notion)
- Examples for frameworks (Express, Remix, SvelteKit)
Need help?
- π¬ GitHub Discussions
- π¦ @0xKoller on Twitter
Orquel vs. Alternatives:
| Orquel | LangChain | LlamaIndex | Vercel AI SDK | |
|---|---|---|---|---|
| Best for | TypeScript RAG | General LLM tasks | Python RAG | Chat/streaming UI |
| Philosophy | Focused, minimal | Swiss Army knife | RAG specialist | UI/streaming |
| Core deps | 0 | Many | Medium | Medium |
| Learning curve | Gentle | Steep | Medium | Gentle |
| Provider flexibility | 20+ (AI SDK) | Many | Many | 20+ |
| Hybrid search | Built-in RRF | Manual | Yes | Manual |
| Benchmarking | Built-in | None | Limited | None |
| TypeScript DX | βββββ | βββ | ββ | βββββ |
Orquel's Sweet Spot: TypeScript teams building RAG systems who value simplicity, type safety, and performance over ecosystem breadth.
Prediction: Orquel aims to become the "Express.js of RAG" β focused, minimal, developer-friendly.
MIT
# Quick start
npx create-orquel-app@latest my-app
cd my-app
npm run dev
# Or add to existing project
npm install @orquel/core @orquel/answer-aisdk ai @ai-sdk/openaiπ View Examples | π Read Product Roadmap | β Star on GitHub
Make knowledge usable. Start building with Orquel today. π―