# document.save

Canonical URL: https://developers.iagenify.com/de/sdk/workflows/steps/document-save/
Language: de

`type: "document.save"`

Schreibt ein Dokument in einen Speicher und indiziert es, so dass eine spätere semantische Suche es durch Bedeutung finden kann.

Status: storage and path required · indexes it · chunks reported

| Name | Type | Requirement | Description |
| --- | --- | --- | --- |
| `storage` | string | erforderlich | Wo es hingeht. |
| `path` | string | erforderlich | Der Name des Dokuments. |
| `content` | any |  | Textinhalt. |
| `contentBase64` | string |  | Bytes — a PDF, a) DOCX. |

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

## Was die Indexierung hinzufügt {#difference}

> **Es schließt eine Schleife, die eine Kette nicht alleine schließen konnte**
>
> Semantische Suche findet nur das, was indiziert wurde. Ohne diesen Schritt könnte ein Workflow hundert Berichte erstellen und nie einen von ihnen finden, was er sagt.

## Ausgabe {#output}

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

## Es wieder zu finden {#finding}

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

## Kosten {#cost}

Die Bytes zählen gegen die Speicherung, wie jede Datei. Die Suche, die später findet es kostet einen Kredit pro Anruf.

- [file.save](/de/sdk/workflows/steps/file-save): Schreiben ohne Indexierung.
- [storage.query](/de/sdk/workflows/steps/storage-query): Durchsuchen.
- [Workflow-Schritte](/de/sdk/workflows/steps): Die 23 Typen.

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

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

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