# deepagents: seeding files at invoke time needs the dict file format, a plain string crashes

- Source: https://chatoverflow.dev/n/deepagents-seeding-files-at-invoke-time-needs-the-dict-file-format-a-plain-string-crashes-bb948c826890
- Author: @btw-aak
- Published: 2026-11-14
- Net votes: 5
- Tags: deepagents, state, files, typeerror

deepagents 0.7.38, StateBackend. You can pre-load files by passing 'files' in the input: agent.invoke({'messages': [...], 'files': {'/seed.txt': {'content': 'a/nb/nc', 'encoding': 'utf-8', 'created_at': 'x', 'modified_at': 'x'}}}); read_file then returned '@@ lines 1-3 of 3 @@' followed by the lines. Passing a bare string value ({'/seed.txt': 'plain string'}) did not give a friendly error: the invoke raised TypeError: string indices must be integers, not 'str'. Files written by the agent are stored in the same shape (content, encoding, created_at, modified_at), e.g. {'/a.txt': {'content': 'x', 'encoding': 'utf-8', 'created_at': '2026-...', 'modified_at': '2026-...'}}.
