> ## Documentation Index
> Fetch the complete documentation index at: https://docs.thinnest.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Knowledge Node

> Look up a grounded answer from your agent's knowledge base at a specific point in the call, and branch on whether an answer was found.

# Knowledge Node

The **Knowledge** node looks up an answer from your agent's
[knowledge base](/docs/knowledge) at the exact point you place it in the flow —
then lets the call **branch on whether an answer was found**. It runs **instantly**
(no caller turn), so the caller hears no dead air.

<Info>
  **Why a node, when the agent already has a knowledge base?** Left to its own
  judgment, an agent *may* look something up — or it may answer from memory and get
  it wrong. The Knowledge node makes the lookup **guaranteed and on-script**: at this
  step, the answer always comes from your knowledge base, and you decide what happens
  when nothing is found. That determinism is the whole point of a workflow.
</Info>

## When to use it

<CardGroup cols={2}>
  <Card title="Grounded FAQ answers" icon="circle-question">
    "What are your hours / prices / return policy?" — answer from your own content
    instead of risking a made-up reply.
  </Card>

  <Card title="Branch on found / not-found" icon="code-branch">
    Route one way when the knowledge base has an answer, and a graceful fallback
    (transfer, apologize, take a message) when it doesn't.
  </Card>
</CardGroup>

## Configure it

Select the node on the canvas to open the **Inspector**.

| Setting                      | What it controls                                                                                                                                                                                                                |
| ---------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **Query**                    | What to search for. Defaults to the **caller's latest message** (`{{last_user_message}}`), so a Knowledge node placed right after a question "just works". You can also write your own query with `{{variable}}` interpolation. |
| **Knowledge source**         | Which source to search, picked from a dropdown. The default — **the agent's knowledge base (all sources)** — is the usual choice; pick a specific source only when you want to scope this node to one of them.                  |
| **Store answer in variable** | The [variable](/docs/voice/workflows/transitions) that receives the retrieved answer text — e.g. `{{knowledge_result}}`. A later Conversation node reads it aloud.                                                              |
| **Found flag → variable**    | *(Optional)* A **boolean** variable set to `true`/`false` depending on whether anything was found. Use it to branch.                                                                                                            |
| **Max passages**             | How many passages to pull from the knowledge base (default 5).                                                                                                                                                                  |

<Note>
  Declare the variables you reference (the answer variable and the found flag) in the
  **Variables** panel first, so the node has somewhere to store its results.
</Note>

## Reading the answer back to the caller

The Knowledge node doesn't speak — it **stores** the answer. The next
**Conversation** node reads it by referencing the variable in its prompt, for
example:

> *"Answer the caller's question using this information: `{{knowledge_result}}`.
> Keep it short and natural."*

This route-then-speak pattern keeps the spoken reply grounded in your content while
still sounding like the agent.

## Branch on whether an answer was found

Give the node a **Found flag** variable (say `{{kb_found}}`), then draw two edges
out of the Knowledge node:

<Steps>
  <Step title="Answer path">
    An [equation edge](/docs/voice/workflows/transitions)
    `{{kb_found}} == TRUE` → a Conversation node that reads `{{knowledge_result}}`.
  </Step>

  <Step title="Fallback path">
    An **unconditional** edge → a graceful fallback (apologize and offer to take a
    message, or a [Transfer](/docs/voice/workflows/nodes#transfer) to a human).
  </Step>
</Steps>

Equation edges are checked first, so the answer path wins when something was found
and the call falls through to the fallback otherwise.

## Worked example — return policy

<Steps>
  <Step title="Caller asks a question">
    On a Conversation node, the caller says *"What's your return policy?"*
  </Step>

  <Step title="Look it up">
    The flow routes to a **Knowledge** node. Its **Query** is left at the default
    (`{{last_user_message}}`), so it searches for exactly what the caller asked. The
    answer lands in `{{knowledge_result}}` and `{{kb_found}}` is set.
  </Step>

  <Step title="Answer or fall back">
    Edge `{{kb_found}} == TRUE` → an **Answer** Conversation node whose prompt reads
    `{{knowledge_result}}` back to the caller. The unconditional edge → a **"let me
    take a message"** node when nothing was found.
  </Step>
</Steps>

## Pairs well with Global nodes

Make the question-handling stretch a [Global node](/docs/voice/workflows/nodes#global-nodes)
so the caller can ask a factual question **at any point** — the flow jumps to the
Knowledge lookup, answers, then returns to whatever the caller was doing.

## Next steps

<CardGroup cols={2}>
  <Card title="Transitions & Variables" icon="code-branch" href="/docs/voice/workflows/transitions">
    Declare the answer and found-flag variables and write the equation edge that
    branches on them.
  </Card>

  <Card title="Node Types" icon="table-list" href="/docs/voice/workflows/nodes">
    See how Knowledge sits alongside Condition, API Request, and Tool.
  </Card>

  <Card title="Tool Node" icon="wrench" href="/docs/voice/workflows/tool">
    Run an integration action — SMS, calendar, CRM — at a specific step.
  </Card>

  <Card title="Knowledge Base" icon="book" href="/docs/knowledge">
    Add the sources this node searches.
  </Card>
</CardGroup>
