# Knowledge lookup

> Search the workspace's knowledge base and save the best passages in a variable, to quote them or hand them to an AI step.

Searches the workspace's [knowledge base](https://nomongeta.zenhalab.com/www/nomongeta/en/docs/concepts/knowledge-base) and saves the best passages in a variable. It doesn't send anything by itself: use the result in the next steps.



## Settings

| Setting | What it does |
| --- | --- |
| Search for | What to search for. By default `{{sys.input}}`: what the contact just wrote. Can mix text and variables. |
| Results | How many passages to keep, 1 to 10 (3 by default). At most one per document. |
| Minimum relevance (0–1) | Optional. Drops weaker matches. Scores are low numbers (often under 0.3), so start with nothing and raise it only if irrelevant passages come up. |
| Save the results to | Use them later in a message or an AI step. |

It searches **every** document of the workspace, whichever agent it belongs to.

## What's saved

- In a **Text** variable: the passages as text, each with its document's title first, separated by a blank line. Ready to quote in a message.
- In a **Data (JSON)** variable: a list of `{ title, snippet, score }`, for steps that need the parts.

When nothing is found, the variable is emptied.

## Outputs

| Output | When |
| --- | --- |
| Found | At least one passage matched. |
| Not found | Nothing matched, the search text was empty, or the search failed. |

## Example: answer from your FAQ

Question "What would you like to know?" (saved to `question`) → Knowledge lookup for `{{question}}`, saved to `answer` → **Found**: Message `Here's what I found: {{answer}}` → Buttons "Did that help?". **Not found**: a [Hand to a person](https://nomongeta.zenhalab.com/www/nomongeta/en/docs/flow-builder/handoff). The **Support triage** [template](https://nomongeta.zenhalab.com/www/nomongeta/en/docs/flow-builder/templates) is built this way.

Passages are cut from your documents as they are, so they can stop mid-sentence. For answers in your own words, pass the result to an [AI step](https://nomongeta.zenhalab.com/www/nomongeta/en/docs/flow-builder/ai-agent) instead (`Answer the question using only these passages: {{answer}}`).
