> ## Documentation Index
> Fetch the complete documentation index at: https://docs.ragrails.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Overview

> Build searchable, chat-ready knowledge bases from websites, documents, APIs, and Markdown.

Ragrails turns source content into a retrieval-ready knowledge base. It extracts content from websites, documents, REST APIs, or Markdown, then chunks, embeds, stores, retrieves, and chats over that content through the SDK, CLI, or REST API.

Use it when you need AI search, grounded chat, support agents, documentation assistants, internal knowledge bases, or API copilots backed by your own data.

## What Ragrails gives you

| Capability             | What it means                                                                                    |
| ---------------------- | ------------------------------------------------------------------------------------------------ |
| Multi-source ingestion | Websites, local files, remote files, REST APIs, uploads, and direct Markdown.                    |
| End-to-end pipelines   | `ingest()` builds the index; `query()` searches it; `chat()` answers with retrieved context.     |
| Three interfaces       | Use the Python SDK, terminal CLI, or hosted REST API over the same pipeline.                     |
| Structured results     | Every stage returns counts, items, errors, metadata, and output shapes you can automate.         |
| Production controls    | Reranking, query rewriting, chat quality gates, streaming, resilient ingestion, and maintenance. |

## Install

```bash theme={null}
pip install "ragrails[voyage,qdrant]"
```

For website crawling, install URL support and set up a browser once:

```bash theme={null}
pip install "ragrails[url,voyage,qdrant]"
ragrails setup-url --browser chromium
```

See [Installation](/getting-started/installation) for provider and vector database extras.

## Quick Path

This example builds a `support` collection from one document, searches it, then asks a grounded chat question. The sample source says: "Customers can request a refund within 30 days of purchase."

<CodeGroup>
  ```python SDK theme={null}
  from ragrails import RagRails

  rag = RagRails(
      collection="support",
      vector_store={"provider": "qdrant", "url": "http://localhost:6333"},
      embedding={"provider": "voyage", "model": "voyage-3"},
      llm={"provider": "openai", "model": "gpt-4o-mini"},
  )

  rag.ingest(docs="files/refund-policy.pdf")

  matches = rag.query("How long do I have to request a refund?", retrieval={"top_k": 5})
  answer = rag.chat("How long do I have to request a refund?", history=[])

  print(matches.items[0].text)
  print(answer.answer)
  ```

  ```bash CLI theme={null}
  ragrails ingest \
    --docs files/refund-policy.pdf \
    --vector-db qdrant \
    --collection support \
    --url http://localhost:6333 \
    --provider voyage \
    --model voyage-3

  ragrails query "How long do I have to request a refund?" \
    --vector-db qdrant \
    --collection support \
    --url http://localhost:6333 \
    --top-k 5 \
    --provider voyage \
    --model voyage-3

  ragrails chat "How long do I have to request a refund?" \
    --vector-db qdrant \
    --collection support \
    --url http://localhost:6333 \
    --embedder-provider voyage \
    --embedder-model voyage-3 \
    --llm-provider openai \
    --llm-model gpt-4o-mini
  ```

  ```bash REST API theme={null}
  curl -X POST http://127.0.0.1:8000/v1/pipelines/ingest \
    -H "Content-Type: application/json" \
    -d '{
      "docs": "files/refund-policy.pdf",
      "embedding": {"provider": "voyage", "model": "voyage-3"},
      "storage": {"vector_db": "qdrant", "collection": "support", "url": "http://localhost:6333"}
    }'

  curl -X POST http://127.0.0.1:8000/v1/pipelines/query \
    -H "Content-Type: application/json" \
    -d '{
      "query": "How long do I have to request a refund?",
      "embedding": {"provider": "voyage", "model": "voyage-3"},
      "retrieval": {"vector_db": "qdrant", "collection": "support", "url": "http://localhost:6333", "top_k": 5}
    }'

  curl -X POST http://127.0.0.1:8000/v1/chat \
    -H "Content-Type: application/json" \
    -d '{
      "query": "How long do I have to request a refund?",
      "llm_provider": "openai",
      "llm_model": "gpt-4o-mini",
      "embedder_provider": "voyage",
      "embedder_model": "voyage-3",
      "vector_db": "qdrant",
      "collection": "support",
      "url": "http://localhost:6333",
      "history": []
    }'
  ```
</CodeGroup>

## Source Types

Use one source type or combine several in the same `ingest()` call.

| Source    | SDK                                                          | CLI                                       | Walkthrough                                      |
| --------- | ------------------------------------------------------------ | ----------------------------------------- | ------------------------------------------------ |
| Website   | `urls="https://example.com"`                                 | `--source-url https://example.com`        | [Build From a Website](/guides/website-to-rag)   |
| Documents | `docs="files/guide.pdf"` or `docs={"folder": "files/docs/"}` | `--docs`, `--folder`                      | [Build From Documents](/guides/docs-to-rag)      |
| REST API  | `api={"url": "https://api.example.com/items"}`               | `--api-url https://api.example.com/items` | [Build From an API](/guides/api-to-rag)          |
| Markdown  | `markdown="# Refunds\n..."`                                  | `--markdown "# Refunds..."`               | [Pipeline Overview](/features/pipeline-overview) |

<Note>SDK defaults live in `RagRails(...)`; CLI defaults live in `.ragrails.toml`; REST requests pass configuration in each request body.</Note>

## Where To Go Next

<CardGroup cols={2}>
  <Card title="Quickstart" icon="zap" href="/getting-started/quickstart">
    Build a working knowledge base and chat flow quickly.
  </Card>

  <Card title="How RAG Works" icon="book-open" href="/getting-started/concepts">
    Learn the pipeline terms before tuning them.
  </Card>

  <Card title="Pipeline Overview" icon="route" href="/features/pipeline-overview">
    See extraction, chunking, embedding, storing, retrieval, chat, and maintenance together.
  </Card>

  <Card title="Capabilities" icon="sliders-horizontal" href="/capabilities/overview">
    Turn on reranking, rewriting, quality controls, streaming, resilient ingestion, and tools.
  </Card>

  <Card title="Use Cases" icon="sparkles" href="/use-cases/overview">
    Pick a strong sample: support agent, docs assistant, internal KB, AI search, or API copilot.
  </Card>

  <Card title="Walkthroughs" icon="map" href="/guides/website-to-rag">
    Follow source-specific setup paths for websites, documents, APIs, or REST hosting.
  </Card>
</CardGroup>

## Interfaces

| Interface | Use it when                                                 | Start here                                  |
| --------- | ----------------------------------------------------------- | ------------------------------------------- |
| SDK       | You are building a Python app or worker.                    | [SDK Overview](/usage/sdk/overview)         |
| CLI       | You want terminal workflows, scripts, or local experiments. | [CLI Overview](/usage/cli/overview)         |
| REST API  | Your app is not Python or you want Ragrails as a service.   | [REST API Overview](/usage/server/overview) |

## Common Production Steps

1. Add [Reranking](/capabilities/reranking) when search results are relevant but poorly ordered.
2. Add [Query Rewriting](/capabilities/query-rewriting) for follow-up questions.
3. Add [Chat Tuning](/capabilities/chat-tuning) before exposing answers to users.
4. Add [Streaming](/capabilities/streaming) for long crawls or responsive chat UIs.
5. Add [Knowledge Base Maintenance](/features/knowledge-base-maintenance) so changed and deleted source content stays in sync.
