Skip to main content
This quickstart creates a small support knowledge base, stores it in Qdrant, retrieves the matching chunk, then asks an LLM for a grounded answer. It starts with inline markdown because it is the fastest copy-paste path, then shows the same pipeline with documents, websites, and REST API sources. The example uses Voyage for embeddings, Qdrant for vector storage, and OpenAI gpt-4o-mini for chat.

1. Install

Set the provider keys used by this example:
Start local Qdrant:
OpenAI, Anthropic, and Google clients are included in the base package. There is no separate LLM extra.
Website scraping also needs the url extra and a one-time browser setup: pip install "ragrails[url,store-qdrant]" for SDK/CLI or pip install "ragrails[url,server-qdrant]" for REST, then run ragrails setup-url --browser chromium.

2. Ingest

The ingest pipeline runs extraction, chunking, embedding, and storage in one call.
You can swap the source input without changing the rest of the pipeline. Documents use docs, websites use urls, and REST endpoints use api.
The ingest result reports how many sources, chunks, embeddings, and stored records were produced. A successful run should have failed: 0.

3. Query

Query embeds your question and retrieves matching chunks from the collection.
The query result includes query, search_query, retrieved, items, failed, and errors. Each item contains the retrieved text, metadata, chunk ID, and score.

4. Chat

Chat retrieves context from the same collection, sends it to the configured LLM, and returns an answer with sources and updated history.
Expected answer:
Chat is stateless. Save the returned history and pass it into the next turn when you want conversation memory.

Use Your Own Data

Once the smoke test works, point the same ingest, query, and chat flow at your real source. Use Extraction for source-specific options such as folder parsing, site crawling, API headers, pagination, and output formats.

Extraction

Parse documents, scrape websites, and fetch APIs.

Overview

See how the full pipeline fits together.

Configuration

Set defaults with .ragrails.toml.

Vector Databases

Choose Qdrant, Pinecone, or Weaviate.