RAG API

RAG in Two API Calls

Ingest a document or URL. Query with natural language. Get an LLM answer with source attribution. No vector DB, no embedding service, no chunking library — just two endpoints.

How it works

📄
URL or content
Pass a URL or raw text to POST /rag/ingest
→
✂️
Auto-chunk
Splits at sentence boundaries automatically
→
🧮
Embed
Built-in model generates dense vectors
→
🗄️
Store
Saved to the Neureus vector store
→
🔍
Semantic search
POST /rag/query finds relevant chunks
→
🤖
LLM answer
Any of 10 providers generates the answer
→
✅
Answer + sources
Response includes answer text and source chunks

API reference

Ingest a URL (cURL)
curl -X POST https://app.neureus.ai/rag/ingest \
  -H "Authorization: Bearer nr_your_key" \
  -H "Content-Type: application/json" \
  -d '{"url": "https://your-docs.com/getting-started"}'

# Or raw content
curl -X POST https://app.neureus.ai/rag/ingest \
  -H "Authorization: Bearer nr_your_key" \
  -d '{
    "content": "Our return policy allows returns within 30 days...",
    "title": "Return Policy"
  }'
Query (cURL)
curl -X POST https://app.neureus.ai/rag/query \
  -H "Authorization: Bearer nr_your_key" \
  -d '{
    "query": "What is the return policy?",
    "model": "gpt-4o-mini",
    "k": 5
  }'

# Response
{
  "answer": "Returns are accepted within 30 days of purchase...",
  "sources": [
    { "documentId": "doc_abc", "title": "Return Policy", "excerpt": "..." }
  ],
  "logId": "log_xyz"
}
TypeScript SDK
import { NeureuClient } from '@neureus/sdk';
const client = new NeureuClient({ apiKey: process.env.NEUREUS_API_KEY });

await client.rag.ingest({ url: 'https://your-docs.com/api-reference' });

const result = await client.rag.query({
  query: 'How do I authenticate?',
  model: 'claude-haiku-4-5',  // or meta/llama-3.3-70b (free)
});
console.log(result.answer);
console.log(result.sources);
Document management
// List all ingested documents
const docs = await client.rag.listDocuments();
// → [{ documentId, title, chunkCount, createdAt }, ...]

// Delete a document (removes all its chunks)
await client.rag.deleteDocument('doc_abc');

What's included

Zero setup

No vector DB to provision, no embedding model to deploy, no chunking library to configure. Two endpoints.

Auto-chunking

Documents split at sentence boundaries automatically. No chunk_size parameters to tune.

Semantic search

Dense vector similarity via the Neureus vector store. Finds conceptually related content, not just keyword matches.

Any LLM for answers

Route to any of 10 providers for answer generation. Use free built-in models or premium models — same endpoint.

Source attribution

Every answer includes the document chunks used. Cite sources, debug retrieval quality, audit answers.

Multi-tenant isolation

Each API key has its own document namespace. Serve multiple clients from one deployment.

Common use cases

Internal knowledge base

Ingest your company wiki, runbooks, and docs. Let employees ask natural-language questions and get answers with source links.

Customer support bot

Ingest your product documentation and FAQ. Customers get instant, accurate answers without a human.

Document Q&A

Ingest contracts, reports, or research papers. Extract information, summarize sections, or compare across documents.

Research assistant

Ingest multiple sources on a topic. Query across all of them to synthesize findings and trace claims to sources.

Simple pricing

Free
$0/mo
  • 50 documents
  • RAG query included
  • Built-in models for answers (free)
  • 500 Neurons/mo total
Start free
Most popular
Builder
$29/mo
  • Unlimited documents
  • RAG query included
  • All 10 providers for answers
  • 10,000 Neurons/mo
Start building

Add document Q&A to your app in minutes

Start free. 50 documents, no credit card required.