Knowledge
Search, retrieve, and write to your knowledge bases from a workflow
The Knowledge block connects a workflow to your knowledge bases. It works with both knowledge-base engines:
- RAG knowledge bases — classic vector search over chunked documents.
- Memex knowledge bases — the structured, page-based knowledge graph.
- Company Context — your organization's single Memex knowledge base, available to authorized workflows as a read-only target.
The block is engine-aware: pick a knowledge base and the block automatically does the right thing for that engine. You don't choose the engine — the knowledge base already knows what it is.
Operations
| Operation | What it does | Workspace KB engines | Company Context |
|---|---|---|---|
| Search | Find relevant content for a query | RAG + Memex | Read-only |
| Read File | Read a single file's full content by reference | RAG + Memex | Read-only |
| Add Data | Add a new document/page from text | RAG + Memex | Not available |
Add Data is the write operation for workspace knowledge bases, and it works on both engines: a RAG base stores a chunked, embedded document; a Memex base ingests the text as a page (asynchronously — the page is queryable a moment later). It is the one write path you need for either workspace engine — there is no separate "upload chunk" step.
RAG documents are automatically split into searchable chunks; you can view and hand-edit a document's chunks in the document detail page of the Knowledge UI. That manual chunk editing is RAG-only (Memex stores whole pages, not chunks).
Company Context can be edited only from Settings → Organization → Company Context by an organization owner or administrator whose clearance permits the change. A workflow that tries to use Add Data against Company Context is rejected with COMPANY_CONTEXT_ADMIN_REQUIRED; it never falls back to another knowledge base.
Choosing the knowledge base
Every operation targets a Knowledge Base. There are two ways to set it:
- Pick from the list (Basic mode). The selector groups the knowledge bases you can access into Organization and Current workspace. For Search and Read File, the Organization group can include your organization's Company Context. This is the default.
- Type an id or a reference (Advanced mode). Switch the block to Advanced and a Knowledge Base (reference) field appears. Enter a literal id, or a
<…>reference resolved from the run — for example, an upstream block's output, or<start.processFlow.knowledgeBaseId>to target the knowledge base of the current process-flow instance (so one workflow reads/writes whichever run it belongs to, without a hard-coded id). When the Advanced field has a value, it wins over the picker.
<start.processFlow.knowledgeBaseId> only resolves when the workflow runs as a process-flow workflow action — a standalone run has no process-flow context, so the reference stays empty and the block reports no knowledge base. See Contextual KB across steps.
Folder (path scope)
Search and Add Data both take an optional Folder (path scope) — a
relative folder path inside the knowledge base, like qualification/scoring.
It does two symmetric things:
- On Add Data, the new document or page is filed under that folder.
- On Search, retrieval is restricted to that folder and everything nested
beneath it. A scope of
qualification/scoringalso coversqualification/scoring/rubric; it does not cover the siblingqualification/scoping.
The field is templatable, so a step can target a folder it computes at run
time — <start.stageSlug>/outputs, or a folder an upstream block returned.
That is the point: one workflow reused across stages can write each stage's
output into its own folder and later read back only that stage's folder.
| Value | Behaviour |
|---|---|
| Left blank (or a reference that resolves to empty) | The whole knowledge base — the default, and what an unfilled templated field produces. |
qualification/scoring | That folder and its subfolders. |
/ or a value that is only slashes | Rejected. A scope you asked for must name a real folder; silently widening a narrow read to the whole base is treated as an error, not a fallback. |
Anything containing . or .. | Rejected — no path traversal. |
Paths are normalized before they are stored or matched, so a//b and a/b
are the same folder. A document written through one form is findable by a
search for the other.
The folder scope narrows, it never widens. It is applied after classification filtering, so it can only remove results you were already cleared to see — a folder scope can never surface a file whose clearance is above your own. Selecting several knowledge bases in one Search applies the same folder scope to every one of them.
Read File
Use Read File (formerly Get Document) to pull a specific file — a RAG document or a Memex page — into your workflow so a downstream block (an Agent, an API call, a Function) can use its full text. It returns the complete content for both engines: for a RAG document the block reconstructs the full text from the document's chunks server-side, so you no longer need to run a Search just to read one known document.
To read a file stored in a Memex knowledge base, use Read File here — not the File block. The File block fetches by URL; a Memex page is not a URL, and there is no "path" string that addresses one. Pick the page from the list (or pass its id/slug) and Read File returns its content.
Reads honor classification (EG-020). If a file's clearance is above your own, Read File returns CLEARANCE_DENIED rather than its content — the same "no read-up" rule the Search agent applies.
The same rule applies to Company Context. Selecting the organization-wide base does not grant broader access: the block can read only pages the executing user and action are authorized to see.
Configure it
Select Operation → Read File.
Select the Knowledge Base. For a RAG base the picker lists documents; for a Memex base it lists pages by title.
Pick the Document/Page from the list, or use Reference Override to pass a value from an upstream block. The override accepts:
- a Memex page id or slug, or
- a RAG document id.
When the override is set, it wins over the picker — handy when an earlier block (a Search, a Function) decides which page to read.
Outputs
| Output | Description |
|---|---|
content | The file's full text. For a Memex page this is the page body; for a RAG document it is the chunks stitched back together in order. Empty string when a RAG document has not finished indexing (see metadata.indexed). |
metadata | Title, reference ids, and fileType. For a Memex page: title, pageId, folderPath, slug. For a RAG document: documentId, indexed, and (when not indexed) processingStatus / processingError. |
documentRef | The resolved reference id. |
Example: read a Memex page, then summarize it
Knowledge → Read File, select your Memex knowledge base, pick the page (e.g. “RFP Template Rollout”).
Agent block — reference <knowledge.content> in the prompt: “Summarize the following document for a customer email: <knowledge.content>”.
API / Response block — send the summary onward.
This is the supported replacement for trying to feed a Memex file path into the File block.
Search
Select Search, choose the knowledge base, optionally set a Folder (path scope), and enter a query. The block runs a grounded agentic loop over the knowledge base: it retrieves candidate material, reads content in depth, and uses the org's default language model to synthesize a natural-language answer with citations. The same kernel powers both engines.
Because Search synthesizes an answer, it makes model calls. This consumes LLM tokens (billed against your org's usage) and adds latency (Memex: one short planning call, then up to 12 reasoning rounds — 16 for questions that span several documents or ask for a complete list — within a time limit of 60 s per answer by default, which organization admins change under Settings → Governance → Agent Control; near the limit the agent stops searching and answers from what it has read; RAG: up to 5 rounds of up to 30 s each). If you only need ranked results for further processing and do not need a synthesized answer, pass the results output to a downstream Agent block instead of reading answer directly.
How retrieval works per engine
- RAG — searches by vector similarity, then reads full document text chunk-by-chunk.
- Memex — navigates the knowledge base the way you would navigate a folder of files. It first classifies the question (one document, several documents, or a complete list), then finds the right documents by file name or by searching their full text, looks at a long document's section outline, and reads only the relevant line ranges instead of whole documents. It can look up where a defined term is defined, resolve a name it has indexed (organisations by legal name, contract parties and their roles, dates, amounts, citations, links) to its aliases, list every document that mentions something (filtered by kind, author or date), and expand from one document to its conversation or to the documents that cite it. When it searches, each matching document comes back with its best-matching passages (up to five), ranked on the words in the question that point to a passage rather than the ones that name the document. So a value deep in a long document (a price, a clause, a name) is found even when it appears nowhere in the document's summary, and a "which / who / list all" question is answered from the complete set.
Company Context always follows the Memex path; its engine is not selectable.
In both cases the agent follows up across multiple rounds until it has enough evidence to write a grounded answer.
Outputs
| Output | Type | Description |
|---|---|---|
answer | string | The synthesized natural-language answer, grounded in the knowledge base. Empty string when the knowledge base has no relevant content. |
citations | json | Array of sources the answer used. Each entry: { ref, snippet, confidence, span? }. ref is a page or source id for Memex KBs, or a document id for RAG KBs. confidence is a 0–1 score the model assigned. For Memex, span — when present — is the exact location the platform verified in the source: { sourceId, charStart, charEnd, startLine, endLine }, and snippet is that verified text (≤ 500 characters). A citation the platform could not verify against the document has no span, and its snippet is the model's quote. |
results | json | The hydrated source rows with content — both the structured metadata and the text the model read. Useful for downstream blocks that need to act on individual sources. |
query | string | The query that was run (echo of the input, useful for chaining). |
Example: ask a question, then email the answer
Knowledge → Search, select your Memex knowledge base, enter the query (e.g. "What is our refund policy for enterprise contracts?").
Agent block — reference <knowledge.answer> and <knowledge.citations> in the prompt: "Draft a concise customer reply based on this answer: <knowledge.answer>".
Response block — send the drafted reply.
When there is no answer
If the knowledge base contains no relevant content, or the org has no LLM integration configured, answer is an empty string and citations is an empty array. results may still contain retrieval candidates. The block does not error in this case — use a Condition block downstream to branch on answer being empty if you need to handle that path explicitly.
Errors you might see
| Error | Meaning |
|---|---|
KB_NOT_FOUND | The selected knowledge base doesn't exist or you can't read it. |
DOCUMENT_NOT_FOUND | No Memex page matched the id/slug (and folder) you gave. |
DOCUMENT_NOT_FOUND_FOR_ENGINE | The reference doesn't match a document in this knowledge base's engine (e.g. a RAG document id against a Memex base). |
CLEARANCE_DENIED | The file's classification is above your clearance — Read File withholds the content (EG-020 no read-up). |
400 — "must reference a folder, not the knowledge-base root" | The Folder (path scope) you set resolved to the root (/, or only slashes). Leave the field blank to search the whole base; a scope that is present has to name a folder. |
400 — "path traversal segments are not allowed" | The folder scope contained a . or .. segment. |
COMPANY_CONTEXT_ADMIN_REQUIRED | A write operation targeted Company Context. Use its dedicated organization-administration page instead. |
storage_write_failed | Create Document couldn't write to the organization's object storage (the message names the backend status, e.g. "object storage (s3 returned HTTP 403)"). The knowledge base and your access are fine — the org's storage configuration is wrong: bad credentials, a missing bucket, or an unreachable endpoint. Fix it in Settings → Organization → Storage (a 403 is almost always wrong credentials or a missing bucket). For local development, switching the provider to Local avoids object storage entirely. |
Related
- Company Context — administer the organization-wide source and understand its read-only boundaries.
- Knowledge bases — compare conversation, workspace, and Company Context knowledge.