Skip to Content
We are live but in Staging 🎉

Templates — API Reference

Package: dodil.data.pipeline.v1 · Service: PipelineService

Templates are catalog entries from Scriptum — the recipes new pipelines spawn from. See Core Concepts → Template for the type signature.

RPCHTTP
ListTemplatesGET /admin/templates
GetTemplateGET /admin/templates/:template_id

gRPC setup — grpcurl, endpoints, reflection, and field-name casing — is covered once in Conventions → Using gRPC.

The catalog

There is no registry, manifest or seed table — the catalog is the template tree itself. Scriptum’s loader walks templates/ at boot: the directory name becomes the template’s category and the filename stem becomes its id. The count is whatever the loader finds, so treat the tables below as the shape of the catalog rather than a frozen inventory, and call ListTemplates for the live set.

The six category values are therefore the six directories: actions, core, ecommerce, embedding, financials, vision.

analysis is not a category. It exists only as a label value (labels.category), which is a different field from the top-level category the API returns and ?category= filters on. Filtering ?category=analysis matches nothing.

Core (9)

Domain-agnostic processing — classification, extraction, summarization. Warehouse-compatible: bind these to a Tables destination to land structured rows.

TemplateWhat it doesModalities
classificationClassify documents by type, topic, language, and sensitivitytext, pdf
document_triageRapid intake triage — classify + extract entitiestext, pdf, docx, html, email
entity_pii_extractionExtract structured entities and detect PIItext, pdf
image_understandingImage analysis — ML object detection + OCR + LLM vision reasoningimage
invoice_parsingParse invoices into structured fieldspdf, image
ocr_extractionExtract text from scanned / image-based documentspdf, image
sentiment_intent_analysisSentiment, intent, topics, urgency, toxicitytext, pdf
summarizationMulti-level document summarization + keyword extractiontext, pdf, docx, html
translationTranslate text to a target language (Seed-X PPO 7B)text

Embedding (10)

The embedding category holds five *_index templates and their five *_search counterparts.

Index pipelines (5)

Ingestion-side embedding pipelines. Each indexes a modality into a Vector collection. Bind these as vector pipelines.

TemplateWhat it doesModalities
text_embedding_indexResolves a source object → chunks → embeds → indexes. The canonical “ingest documents for RAG” pipeline.text, pdf, docx, html, audio, video
code_embedding_indexCode embedding with AST-aware chunking (tree-sitter) at function / class boundariescode (rust, python, javascript, typescript, go, …)
visual_embedding_indexVisual embedding (image, video frames, audio spectrograms, PDF page renders)image, video, audio, pdf
face_embedding_indexPer-bucket face indexing — SCRFD detect + embedimage
object_embedding_indexObject indexing with open-vocabulary detectionimage

Search pipelines (5)

Query-side counterparts to the _index templates. You rarely create these by hand: CreateVectorPipeline derives the search-side template from the index one by the *_index*_search convention and spawns that pipeline for you, which is why one collection shows up as two rows in ListPipelines.

TemplateWhat it does
text_embedding_searchPer-chunk text query → multi-vector embed → fan-out to N collections → merged ranked results
code_embedding_searchPer-chunk code query → multi-vector embed → fan-out → merged results
visual_embedding_searchVisual query (text or image) → embed once → search N collections → merge by (collection, artifact_id)
face_embedding_searchFace query → detect → crop → embed once → search N collections in parallel
object_embedding_searchObject query → embed → search N collections in parallel

What’s in the vector catalog

The five index templates back the auto-embed-on-ingest vector collections — you create a collection with the _index variant via CreateVectorPipeline, and K3 derives the _search counterpart automatically. Their resolved shape:

Template (index)embed_modelDimstype label@accepts_extension
text_embedding_indexjina-embeddings-v4768texttxt, md, html, htm, pdf, docx
code_embedding_indexjina-embeddings-v41024coders, py, js, ts, tsx, go, java, c, cpp, h, hpp, rb, swift, kt
visual_embedding_indexjina-embeddings-v41024visualjpg, jpeg, png, gif, webp, mp4, mov, webm, mp3, wav, flac, pdf
object_embedding_indexjina-embeddings-v4 (detector mm-gdino-large)1024objectjpg, jpeg, png, webp
face_embedding_indexarcface-r100 (detector scrfd-10g)512facejpg, jpeg, png, webp

The five search counterparts carry the same model and dimensions but declare no accepted extensions, because nothing ingests through them. object_embedding_index is the only one with a required template input: labels, a list of 1–100 open-vocabulary class prompts for the detector.

The suffix convention is not validated. CreateVectorPipeline derives <stem>_search by string surgery and never checks the catalog for it. A custom template that does not end in _index, or whose _search counterpart does not exist, yields a collection that indexes but cannot be searched — surfaced only as a server-side warning and later as a warnings[] entry on the search route.

Vision (4)

Image / video / audio analysis. All warehouse-compatible.

TemplateWhat it doesModalities
audio_transcriptionTranscribe with Whisper; optional speaker diarization + audio classificationaudio, video
code_intelligenceSource-code analysis — symbols, dependencies, architecture, docstext
object_detectionDetect objects in images / video keyframes (YOLOv8m)image, video
video_surveillanceFull video surveillance — object tracking + activity classificationvideo

Ecommerce (2)

Domain templates for commerce / marketplace use cases. Both warehouse-compatible.

TemplateWhat it doesModalities
product_catalog_enrichmentProduct catalog enrichment from images and descriptionsimage, text
review_analysisCustomer review analysis — sentiment, toxicity, keyword extractiontext, pdf

Financials (2)

TemplateWhat it doesModalities
financial_statement_extractionExtract line items and totals from financial statementspdf, text
tabular_data_ingestIngest tabular files into structured rowscsv, xlsx

Actions (7)

Query-time templates behind the curated AI actions surface, rather than ingest-side pipelines: chunks_synthesize_answer, collection_topic_map, object_qa, objects_compare, objects_synthesis, plan_and_run, table_qa.

Unaudited templates do not ship. Scriptum’s loader hard-skips the unaudited/ directory at boot and logs skipping unaudited templates directory, so those templates are not in the image, not returned by ListTemplates, and cannot be passed as a template_id — a pipeline referencing one fails to resolve. Names you may see quoted in older docs or tests — lease_extraction, contract_extraction, resume_parsing, content_moderation, claims_intake — are all unaudited and unavailable in production.

ListTemplates

Request

dodil data template list dodil data template list --category embedding dodil data template list --search ocr dodil data template list --label warehouse_compatible=true

--label is repeatable. The CLI exposes no facet filter — use HTTP or gRPC for ?facet=.

Response

{ "templates": [ { "id": "text_embedding_index", "name": "Text Embedding Index", "description": "Resolves a source object → chunks → embeds → indexes.", "tags": ["embedding", "rag"], "toolsRequired": ["k3_vector_upsert"], "labels": { "category": "embedding", "modality": "text", "pillar": "vectors" }, "category": "embedding", "modalities": ["text"], "acceptedExtensions": ["pdf", "docx", "txt", "html"], "acceptedContentTypes": ["application/pdf"], "outputKind": "" } ] }

The id field is id, not templateId — the proto field is string id = 1.

outputKind is populated only for object-facet templates ("markdown" | "text" | "json" | "file"); it drives the writer’s extension picking and content-type stamp, and is empty when the template did not declare it. contract is omitted from ListTemplates responses in the sample above for brevity — fetch it with GetTemplate.

GetTemplate

Returns one template with its full typed ScriptContract (input fields, output schema, accepted modalities), proxied verbatim from Scriptum. K3 reads the contract server-side to validate caller-supplied template_inputs, and to resolve the schema-shaping facts — embed_model, dimensions, distance_metric, sparse_mode — when spawning a vector pipeline. Those facts come from the contract and cannot be overridden by the caller.

Request

dodil data template get text_embedding_index

Response

A Template — see Core Concepts → Template.

Using templates in pipeline creation

A template_id from this catalog is what the three facet creators take — they create the destination and the pipeline together in one call:

GoalTemplate to useCreate with
RAG ingest for PDFs / docstext_embedding_indexCreateVectorPipeline
Code search across a repocode_embedding_indexCreateVectorPipeline
Multimodal asset libraryvisual_embedding_indexCreateVectorPipeline
Extract entities + PII to a tableentity_pii_extractionCreateTablePipeline
Triage incoming docsdocument_triageCreateTablePipeline
Transcribe meeting audioaudio_transcriptionCreateTablePipeline
Object detection on uploaded imagesobject_detectionCreateTablePipeline
Sentiment dashboardsentiment_intent_analysisCreateTablePipeline
Summaries written back to S3summarizationCreateObjectPipeline

For a table pipeline the template must declare @accepts_extension — the derived ingest rule’s globs come from it, and a table pipeline with none can never fire. Check acceptedExtensions on the template before you bind it.

CreatePipeline also takes a template id, via either scriptum_template or its historical alias spawn_from_templateboth variants now mean the same thing, “this is the template id to dispatch”. Neither one creates a fresh Scriptum script: the worker builds the per-call env at dispatch time, so there is nothing to bake in at create. Use CreatePipeline to add a second pipeline onto a destination that already exists, or to make a free pipeline; use a facet creator to make the destination itself.

A pipeline created from a template does not ingest anything yet. Binding an ingest rule is a separate, mandatory step — see Rules.


See also