Source and output
Embedding takes chunk dictionaries from Chunking and returns the same chunks with an addedembedding vector.
embedded result:
The SDK and REST API return embedded chunks in memory. The CLI writes
embedded.json to --output-dir. Vector database persistence happens in Storing, not embedding.
What gets embedded
Each input chunk must be a dictionary with non-emptytext. If the chunk also has embed_text, Ragrails sends embed_text to the embedding model and keeps text for citations and display.
embed_text is created by the chunking stage from the title, heading path, description, and visible text. This improves semantic retrieval without changing the text you show users later.
If
embed_text is missing, Ragrails embeds the chunk text field.Providers
Ragrails ships with Voyage embeddings and a registry for custom embedders.
Voyage requires
VOYAGE_API_KEY in the environment that runs embedding.
Input type
Embedding providers may optimize vectors differently for indexed documents and user queries. Ragrails usesinput_type="document" by default for embed() because embedding is an indexing step.
Retrieval and chat create query embeddings with input_type="query" for you. You normally only set input_type manually when constructing an embedder or using /v1/embed for a non-indexing workflow.
Batching
batch_size controls how many chunks are sent to the embedding stage per request batch.
batch_size must be an integer greater than 0. If one provider batch fails, each chunk in that batch gets a retryable embed error and other valid batches can still succeed.
Output shape
id is resolved from the chunk id, then metadata.id, then metadata.chunk_id. The source is resolved from the chunk source, then metadata.source.
Ingest pipeline
High-level ingestion embeds after chunking and before storing. Pass embedding options through theembedding object.
Possible errors
Interface validation errors raise immediately in SDK and REST. Chunk validation and provider failures are returned in the resulterrors list when processing can continue. See Errors for the shared shapes.

