Skip to Content
We are live but in Staging 🎉

Templates — API Reference

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

Templates are catalog entries from Scriptum — the recipes new pipelines spawn from. K3 ships a production catalog of 24 audited templates across four categories. 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

Every template below ships with K3, is production-grade, and is discoverable via ListTemplates. Labels show the template’s intended modalities and (where applicable) warehouse_compatible: true — meaning the template emits structured rows suitable for a warehouse destination.

Core analysis (8)

Domain-agnostic processing — classification, extraction, summarization. All 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
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 — 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

Embedding — search pipelines (5)

Query-side counterparts to the _index templates. These are usually run ad-hoc (via Vector search) rather than bound as ingest pipelines, but you can wire them as free pipelines when needed.

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

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

E-commerce (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

Some additional templates exist in an unaudited category (real-estate, IT-ops, telecom, insurance, engineering, media, …). They’re discoverable via ListTemplates but not part of the production catalog — use at your own risk.

ListTemplates

Request

All templates:

curl -sS "https://k3.dev.dodil.io/admin/templates" \ -H "Authorization: Bearer $DODIL_TOKEN"

Filter by category:

curl -sS "https://k3.dev.dodil.io/admin/templates?category=embedding" \ -H "Authorization: Bearer $DODIL_TOKEN"

Free-text search:

curl -sS "https://k3.dev.dodil.io/admin/templates?search=ocr" \ -H "Authorization: Bearer $DODIL_TOKEN"

Response

{ "templates": [ { "templateId": "text_embedding_index", "name": "Text Embedding Index", "description": "Resolves a source object → chunks → embeds → indexes.", "category": "embedding", "labels": { "status": "ready", "modality": "text" } } ] }

GetTemplate

Returns one template with its full typed ScriptContract (input fields, output schema, accepted modalities). K3 reads the contract server-side to validate caller-supplied options when spawning pipelines.

Request

curl -sS "https://k3.dev.dodil.io/admin/templates/text_embedding_index" \ -H "Authorization: Bearer $DODIL_TOKEN"

Response

A Template — see Core Concepts → Template.

Using templates in pipeline creation

When you create a pipeline you either reference an existing Scriptum script by name (scriptum_template) or spawn a fresh script from a template ID (spawn_from_template) — see CreatePipeline.

Common pairings:

GoalTemplate to useBind to destination
RAG ingest for PDFs / docstext_embedding_indexa Vector collection
Code search across a repocode_embedding_indexa Vector collection
Multimodal asset libraryvisual_embedding_indexa Vector collection
Extract entities + PII to a tableentity_pii_extractiona Tables table
Triage incoming docsdocument_triagea Tables table
Transcribe meeting audioaudio_transcriptiona Tables table
Object detection on uploaded imagesobject_detectiona Tables table
Sentiment dashboardsentiment_intent_analysisa Tables table

For the “search” half of an embedding workflow (queries), use the matching _search template — typically run ad-hoc through Vector search, not bound as an ingest pipeline.


See also