//Hybrid Search & RAG

Hybrid Semantic Search & RAG

ButtrBase provides a native Discovery Layer that combines traditional full-text search with modern AI-powered semantic search. It is strictly multi-tenant isolated and RAG-ready.

1. Indexing Documents

Push any JSON document to the index. ButtrBase automatically generates embeddings and indexes metadata for filtering.
await client.search.index({
  id: 'doc-123',
  content: 'User is having trouble with their pro subscription renewal.',
  metadata: { status: 'open', category: 'billing' }
});

2. Hybrid Querying

Search by meaning or keyword, with SQL-like filtering.
const results = await client.search.query('money issues', {
  filters: { status: 'open' },
  hybrid: true // Combines keyword + semantic results
});

3. RAG for AI Agents

Use the context helper to retrieve perfectly formatted snippets for your LLM prompts.
const context = await client.search.getContext('How do I cancel my plan?', { limit: 3 });
// Pass this context directly to Claude/GPT