Workflow steps

document.save

type: "document.save"

Writes a document into a storage and indexes it, so a later semantic search can find it by meaning.

storage and path requiredindexes itchunks reported
Using Python?

Switch any code block to Python: the choice applies to every page. Python SDK guide and resource reference.

storagestringrequired

Where it goes.

pathstringrequired

The document's name.

contentany

Text content.

contentBase64string

Bytes — a PDF, a DOCX.

{ id: "index", type: "document.save", config: {
    storage: "…", path: "digests/{{input.week}}.md",
    content: "{{steps.write.output.text}}" } }
{"id": "index", "type": "document.save", "config": {
    "storage": "…", "path": "digests/{{input.week}}.md",
    "content": "{{steps.write.output.text}}"}}

What indexing adds

It closes a loop a chain could not close on its own

Semantic search only finds what was indexed. Without this step a workflow could produce a hundred reports and never be able to find one of them by what it says.

Output

{{steps.index.output.document}}   // its identifier
{{steps.index.output.chunks}}     // how many pieces were indexed
{{steps.index.output.bytes}}
"{{steps.index.output.document}}"   # its identifier
"{{steps.index.output.chunks}}"     # how many pieces were indexed
"{{steps.index.output.bytes}}"

Finding it again

{ id: "recall", type: "storage.query", config: {
    storage: "…", action: "search", query: "{{input.question}}" } }
{"id": "recall", "type": "storage.query", "config": {
    "storage": "…", "action": "search", "query": "{{input.question}}"}}

What it costs

The bytes count against the storage, as any file does. The search that later finds it costs a credit per call.