Blocks

Save to knowledge

The save-to-knowledge step: write a document into a workspace knowledge base (or remove one) so agent steps can retrieve it — index a repo, a docs site, tickets.

Write one document into a workspace knowledge base — chunked and embedded, so an agent step bound to the base retrieves it. The source name is the document's identity: save the same name again and the earlier version is replaced; delete mode removes it.

Config

  • Knowledge base — pick the base (created in Settings → data → knowledge bases). The AI writes the base's exact name.
  • Mode — save stores the text under the source name; delete removes the document with that name (a no-op when absent).
  • Source name — template-rendered. Use the natural stable name: a file path, a URL, a ticket id. Re-runs replace instead of duplicating.
  • Text — template-rendered; usually a whole-string reference to a prior step's output such as {{ steps.read_file.output.text }}. Empty text on save removes the document.
  • Kind — prose (paragraph chunks with a short model-written context line per chunk) or source (a code file: chunks cut at definition boundaries and stamped with the path, no model call).

Output

{ "mode": "save", "source": "lib/mad_max/sms.ex", "chunks": 6, "kind": "source",
  "knowledge_id": "…", "knowledge_name": "madmax repo" }

Patterns

  • Index a repository — on each push, read every changed file with GitHub's get_file and save it under its path (kind: source); delete removed paths. A reviewer agent bound to the base then sees the code around a diff, not just the hunk.
  • Keep docs searchable — a schedule fetches pages and saves each under its URL; a support agent answers from the base.
  • Let an agent file what it learned — add the base as a tool on the agent step (Tools → knowledge bases) and the agent saves or deletes documents itself.
  • Store or knowledge base? — a keyed row another step looks up by key belongs in a data store. Text an agent should find by meaning belongs here.