This page is generated from
inspect.signature(RagRails). Run RAGRAILS_SOURCE=/path/to/ragrails uv run python scripts/generate-reference.py from the docs repo after SDK signature changes.RagRails(...) instance. They do not write .ragrails.toml and they do not change CLI or REST defaults.
Use SDK Overview for workflow guidance. Use this page when you need exact method signatures.
Constructor
| Method | Signature | |||||
|---|---|---|---|---|---|---|
RagRails | `RagRails(*, collection: ‘str | None’ = None, vector_store: ‘dict[str, Any] | None’ = None, embedding: ‘dict[str, Any] | None’ = None, llm: ‘dict[str, Any] | None’ = None, reranker: ‘dict[str, Any] | None’ = None) -> ‘None’` |
Ingestion
| Method | Signature | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
setup_url | setup_url(*, browser: 'str' = 'chromium') -> 'dict' | ||||||||||
scrape | `scrape(url: ‘str | list[str | dict] | None’ = None, *, mode: “Literal[‘each’, ‘full’]” = ‘each’, max_depth: ‘int’ = 3, max_pages: ‘int’ = 200, verbose: ‘bool’ = False, frontmatter: ‘bool’ = False, output_format: “Literal[‘markdown’, ‘json’]” = ‘markdown’, output_dest: “Literal[‘response’, ‘file’]” = ‘response’, output_dir: ‘str | None’ = None, dlq: ‘DLQ | str | None’ = None) -> ‘ScrapeResult’` | ||||
scrape_stream | `scrape_stream(url: ‘str | list[str | dict] | None’ = None, *, mode: “Literal[‘each’, ‘full’]” = ‘each’, max_depth: ‘int’ = 3, max_pages: ‘int’ = 200, verbose: ‘bool’ = False, frontmatter: ‘bool’ = False)` | |||||||
parse | `parse(files: ‘str | list[str | dict] | None’ = None, *, folder: ‘str | None’ = None, frontmatter: ‘bool’ = False, output_format: “Literal[‘markdown’, ‘json’]” = ‘markdown’, output_dest: “Literal[‘response’, ‘file’]” = ‘response’, output_dir: ‘str | None’ = None) -> ‘ParseResult’` | |||||
fetch | `fetch(url: ‘str | None’ = None, *, title: ‘str | None’ = None, description: ‘str’ = ”, method: ‘str’ = ‘GET’, headers: ‘dict | None’ = None, params: ‘dict | None’ = None, body: ‘dict | None’ = None, pagination: ‘dict | None’ = None, max_pages: ‘int’ = 100, timeout: ‘float | None’ = None, apis: ‘list[str | dict] | None’ = None, frontmatter: ‘bool’ = False, output_format: “Literal[‘markdown’, ‘json’]” = ‘markdown’, output_dest: “Literal[‘response’, ‘file’]” = ‘response’, output_dir: ‘str | None’ = None) -> ‘ApiIngestResult’` |
Chunking
| Method | Signature | ||
|---|---|---|---|
chunk | `chunk(*, markdown: ‘str | list[str | dict[str, Any]]’, title: ‘str’ = ”, source: ‘str’ = ”, chunk_size: ‘int’ = 2000, chunk_overlap: ‘int’ = 200, min_chunk_length: ‘int’ = 100) -> ‘ChunkResult’` |
Embedding
| Method | Signature | |||
|---|---|---|---|---|
embedder | `embedder(*, provider: ‘str | None’ = None, model: ‘str | None’ = None, input_type: ‘str’ = ‘document’, options: ‘dict[str, Any] | None’ = None)` |
embed | embed(*, chunks: 'list[dict]', embedder=None, input_type: 'str' = 'document', batch_size: 'int' = 64) -> 'EmbedResult' |
Storing
| Method | Signature | ||||
|---|---|---|---|---|---|
store | `store(*, embedded_chunks: ‘list[dict]’, vector_db: “Literal[‘qdrant’, ‘qdrant_cloud’, ‘pinecone’, ‘weaviate’] | None” = None, collection: ‘str | None’ = None, url: ‘str | None’ = None, batch_size: ‘int’ = 64, ensure_collection: ‘bool’ = True, options: ‘dict[str, Any] | None’ = None) -> ‘StoreResult’` |
edit | `edit(*, chunks: ‘list[dict]’, embedder=None, vector_db: “Literal[‘qdrant’, ‘qdrant_cloud’, ‘pinecone’, ‘weaviate’] | None” = None, collection: ‘str | None’ = None, url: ‘str | None’ = None, batch_size: ‘int’ = 64, options: ‘dict[str, Any] | None’ = None) -> ‘EditResult’` |
delete | `delete(*, ids: ‘list[str]’, vector_db: “Literal[‘qdrant’, ‘qdrant_cloud’, ‘pinecone’, ‘weaviate’] | None” = None, collection: ‘str | None’ = None, url: ‘str | None’ = None, options: ‘dict[str, Any] | None’ = None) -> ‘DeleteResult’` |
Retrieval
| Method | Signature | ||||
|---|---|---|---|---|---|
reranker | `reranker(*, provider: ‘str | None’ = None, model: ‘str | None’ = None, options: ‘dict[str, Any] | None’ = None)` | |
retrieve | `retrieve(query: ‘str’, *, embedder=None, vector_db: “Literal[‘qdrant’, ‘qdrant_cloud’, ‘pinecone’, ‘weaviate’] | None” = None, collection: ‘str | None’ = None, url: ‘str | None’ = None, options: ‘dict[str, Any] | None’ = None, top_k: ‘int’ = 10, use_query_rewrite: ‘bool’ = False, rewrite_llm=None, rewrite_context: ‘str’ = ”, session_context: ‘str’ = ”, use_rerank: ‘bool’ = False, reranker=None, rerank_top_k: ‘int’ = 5) -> ‘RetrieveResult’` |
Chat
| Method | Signature | |||||||||
|---|---|---|---|---|---|---|---|---|---|---|
llm | `llm(*, provider: ‘str | None’ = None, model: ‘str | None’ = None, max_tokens: ‘int | None’ = None)` | ||||||
chat | `chat(query: ‘str’, *, llm=None, embedder=None, vector_db: ‘str | None’ = None, collection: ‘str | None’ = None, url: ‘str | None’ = None, options: ‘dict | None’ = None, reranker=None, history: ‘list[dict] | None’ = None, history_compaction: ‘HistoryCompactionConfig | None’ = None, query_rewrite: ‘QueryRewriteConfig | None’ = None, intent_routing: ‘IntentRoutingConfig | None’ = None, retrieval_quality: ‘ChatRetrievalQualityConfig | None’ = None, persona: ‘str’ = ”, retrieval_config=None) -> ‘ChatResult’` |
chat_stream | `chat_stream(query: ‘str’, *, llm=None, embedder=None, vector_db: ‘str | None’ = None, collection: ‘str | None’ = None, url: ‘str | None’ = None, options: ‘dict | None’ = None, reranker=None, history: ‘list[dict] | None’ = None, history_compaction: ‘HistoryCompactionConfig | None’ = None, query_rewrite: ‘QueryRewriteConfig | None’ = None, intent_routing: ‘IntentRoutingConfig | None’ = None, retrieval_quality: ‘ChatRetrievalQualityConfig | None’ = None, persona: ‘str’ = ”, retrieval_config=None)` |
Pipeline
| Method | Signature | |||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
ingest | `ingest(*, docs: ‘str | list[str | dict] | dict[str, Any] | None’ = None, urls: ‘str | list[str | dict] | dict[str, Any] | None’ = None, api: ‘str | list[str | dict] | dict[str, Any] | None’ = None, markdown: ‘str | list[str | dict[str, Any]] | None’ = None, ingestion: ‘dict[str, Any] | None’ = None, chunking: ‘dict[str, Any] | None’ = None, embedding: ‘dict[str, Any] | None’ = None, storage: ‘dict[str, Any] | None’ = None, concurrency: ‘str’ = ‘serial’) -> ‘IngestPipelineResult’` |
query | `query(query: ‘str’, *, embedding: ‘dict[str, Any] | None’ = None, retrieval: ‘dict[str, Any] | None’ = None) -> ‘RetrieveResult’` |
Important validation notes
rag.llm()requires a model unlessllm={"model": ...}was configured on the constructor.- Provider, embedding, vector-store, and reranker defaults are constructor defaults only.
- SDK
fetch(apis=...)supports batch API ingestion; REST/v1/ingest/apicurrently requiresurl.
Config objects
| Class | Used with | Description |
|---|---|---|
DLQ(path, items) | scrape(dlq=...) | Dead-letter queue for retryable scrape failures |
QueryRewriteConfig(enabled, session_context, llm) | chat(query_rewrite=...) | Query rewriting config |
HistoryCompactionConfig(enabled, history_limit, keep_recent) | chat(history_compaction=...) | History summarisation config |
IntentRoutingConfig(enabled) | chat(intent_routing=...) | Intent routing config |
ChatRetrievalQualityConfig(min_retrieval_score, min_rerank_score, low_confidence_mode, max_context_chunks) | chat(retrieval_quality=...) | Retrieval quality thresholds |

