Chats, subagents and files
Run Taizen's agent in parallel chats from your own harness, and take out and share the files it makes
run_agent sends a message to Taizen's agent — the same one as in the app, with your calls, stores, skills and
integrations — and waits for its answer. Each conversation is a Taizen chat: it shows in the app, keeps its own
context, and keeps the files the agent wrote.
When to use run_agent and when the CLI
| You want | Use |
|---|---|
| A specific read or change you can name ("list my training plans", "publish this draft") | taizen_read / taizen_write |
| An answer that needs searching, reading and reasoning ("why did we lose Acme?") | run_agent |
| A file built for you: a deck, a report, a CSV | run_agent, then get_chat_file |
Chats
| Tool | Does |
|---|---|
new_conversation(project_id?) | Opens a new chat and returns its chat_id |
run_agent(message, chat_id?, project_id?) | One turn in a chat. Without chat_id, your current chat |
list_chats(project_id?, limit?) | Your chats in the project, newest first: chat_id, title, updated, turns |
Every run_agent reply ends with the chat_id it ran in. Passing a chat_id makes it your current chat, so later
calls without one continue it. A chat from list_chats — one you started in the app, say — continues the same way.
If the agent needs something from you, run_agent returns its question with the options. Your next message in that
chat answers it.
Subagents: one chat each
Each chat has its own context, so a harness can fan work out:
Open one chat per subagent
Call new_conversation once per task and keep each chat_id.
Run them in parallel
Call run_agent for each task with its own chat_id, at the same time. A chat answers one message at a time;
sending a second message to a chat that's still working gets "the agent is busy".
Collect the results
Each reply is that subagent's answer. Its files are in its chat — see below.
Example: three chats, one per competitor, each asked "write a one-page battlecard on Gong from our lost deals as a PDF in outputs" (with that chat's competitor), run together.
Files the agent made
The agent writes files to outputs/ in its chat; files you give it are in inputs/.
| Tool | Does |
|---|---|
chat_files(chat_id) | Lists outputs/ and inputs/ with path and size |
get_chat_file(chat_id, path) | Downloads one: text inline, other files as base64, up to 8 MB |
share_chat_file(chat_id, path, password?) | A share link to one file |
share_chat(chat_id, password?) | A share link to the whole chat |
To get a file out:
run_agent— "write a hello-world README.md in outputs".chat_files— findsoutputs/README.md.get_chat_filewith that path — returns its text.
A file over 8 MB isn't returned inline: share it, and download it from the link.
Share links
- Without a password, anyone with the link can open the file or chat.
- With a password (4 to 200 characters), the link asks for it first. A wrong password is refused, and nothing downloads until the right one is entered.
Every link you create also appears under Shared links, where you can revoke it.
A public link is public: anyone who gets it can read the file. Use a password for anything with customer names, pricing or call content.
Troubleshooting
| Symptom | Cause and fix |
|---|---|
chat_id must be a chat id | Pass the chat_id from new_conversation, list_chats or a run_agent reply, not a title |
no chat … of yours | The chat belongs to someone else, or the id is wrong. You can only use your own chats |
chat_files shows nothing in outputs/ | The agent answered without writing a file. Ask for the file by name and folder: "save it as outputs/report.pdf" |
too_large from get_chat_file | Over 8 MB. Use share_chat_file and download from the link |
path must be outputs/<name> or inputs/<name> | Use the path exactly as chat_files lists it |