Skip to main content

What it does

The Write to Knowledge Base tool allows agents to save files directly to your organization’s knowledge bases during conversations. Agents can save existing conversation attachments (user-uploaded or tool-generated files) or create new text files from content they generate.
For complete information about Knowledge Bases, including setup, file upload, and management, see Knowledge Bases.

Key features

  • Save Attachments: Save user-uploaded or tool-generated files from the conversation to a KB
  • Create New Files: Write inline content (summaries, reports, notes) as new KB files
  • Automatic Processing: Saved files are automatically chunked, embedded, and indexed for search
  • Writable KB Allowlist: Restrict which knowledge bases each agent can write to
  • Size Limits: 10 MB maximum for inline content writes

Parameters

Configuration

Writable Knowledge Bases

When enabling this tool on an agent, you must select which knowledge bases the agent is allowed to write to. This prevents agents from writing to unintended KBs. Configure this in Control Hub > Edit Agent > Tools > Write to Knowledge Base.

Common use cases

Save a conversation summary

Agent creates a new markdown file with generated content.

Save an uploaded document

A user-uploaded PDF from the conversation is copied to the knowledge base.

Save a tool-generated file

A file generated by another tool (e.g., Run Code) is saved to the KB.

Best practices

  • Use descriptive file names that help with future search and organization
  • Choose the right knowledge base — agents can only write to KBs in their allowlist
  • For inline content, use markdown formatting for best search results
  • Combine with Search Knowledge Base to build agents that both read and write knowledge

Troubleshooting

“Knowledge base not in writable list”
  • The agent’s tool configuration doesn’t include this KB. Update the writable KB list in the agent’s tool settings.
“Content exceeds maximum size”
  • Inline content is limited to 10 MB. For larger files, upload them directly to the KB.
“No matching attachment found”
  • The file_name must exactly match an attachment in the conversation (case-insensitive). Check the exact filename of the uploaded or generated file.
“Knowledge base not found”
  • Verify the knowledge base ID exists and belongs to your organization.
  • Search Knowledge Base - Search KB content that this tool writes to
  • Run Code - Generate files that can then be saved to a KB
  • Call API - Fetch external data to save into knowledge bases