ingest() is the high-level indexing workflow. It runs extraction, chunking, embedding, and storing in one call.
Use it when you want source content to become searchable without manually calling each stage.
Source Forms
You can pass one source type or combine several in the same ingest run. The sections below show equivalent full configurations for each supported source form. In SDK examples,RagRails(...) holds the default collection, vector store, and embedding model. The ingest() call only repeats those settings when it is intentionally overriding them for that run.
Scrape Website requires URL support to be installed and set up. See Extraction for
setup_url() / ragrails setup-url.Basic Usage
This example combines documents, a scraped website, an API endpoint, and direct Markdown in one ingest run.Concurrency
Useconcurrency to run document parsing, website scraping, and API fetching serially or in parallel before chunking begins.
Merge order remains deterministic:
docs, urls, api, then markdown.
Files
Use files when you know the exact documents to index. File entries can be local paths, HTTP/HTTPS file links, or dictionaries withpath, title, and description.
HTTP/HTTPS document links must end with a supported file extension, such as
.pdf, .md, .docx, or .xlsx. REST local file paths are read by the server process.Folders
Use folders when you want Ragrails to parse every supported document inside a directory.Folder paths are resolved where the SDK or server process runs. The CLI resolves the folder from the shell where you run the command.
Scrape Website
Useurls to scrape exact pages or crawl a website. SDK and REST can pass mode, max_depth, max_pages, verbose, and frontmatter. CLI exposes repeatable --source-url for exact URL ingestion through the high-level ingest command.
APIs
Useapi when content lives behind an HTTP endpoint. SDK and REST support method, headers, params, body, pagination, max_pages, timeout, and batch API configs. The CLI high-level ingest command accepts one --api-url.
The CLI pipeline command does not expose API headers, params, request bodies, pagination, or timeout flags. Use SDK or REST when the API source needs those fields.
Direct Markdown
Use direct Markdown for demos, generated content, or content you already normalized yourself. Markdown entries can be strings or dictionaries withtext, source, and metadata.
Stage Configuration
Use config blocks when you need to tune a specific part of ingest.SDK defaults live on the
RagRails(...) instance. CLI defaults come from .ragrails.toml or flags. REST defaults come from each request payload and any server-side configuration. The CLI pipeline exposes source flags, chunking flags, embedding provider/model, vector store settings, and one shared --batch-size; it does not expose API request config, URL crawl config, options, or ensure_collection.Response Fields
The ingest response summarizes each stage and keeps the detailed nested results available.Possible Errors
ingest() can fail in extraction, chunking, embedding, or storing. Stage-level failures are returned in the nested result plus the top-level errors list.

