> Source: https://builder.ema.ai/v2/agent-reference/knowledge-search
> Title: Knowledge Search Agent

# Knowledge Search Agent

The Knowledge Search agent retrieves the relevant sections from your knowledge base — ingested documents and scraped websites — and answers from them, with source citations. When an AI Employee (AIE) needs to ground a reply in _your_ content rather than the model's general knowledge, this is the agent to use.

In the AI Employee builder, the Knowledge Search Agent appears in the **Planning & Resources** group of the agent library. It is a preset built on the `search_respond` base type, tuned for knowledge-base retrieval and shipped with retrieval-focused instructions.

## When to use it

Use Knowledge Search whenever the answer should come from documents you have ingested or websites you have scraped:

-   Answer policy, product, or support questions from your knowledge base.
-   Look up the relevant section of a long document and summarize it with a citation.
-   Provide a grounded reply that the user can trace back to the source.

It is closely related to [Search and Respond](/builder/v2/agent-reference/search-and-respond) — both run the same agentic retrieval loop. Knowledge Search is the preset framed around knowledge-base retrieval, with its citation-oriented instructions pre-written. If you need a more general research agent (for example one that also leans on attached Tools), use Search and Respond directly.

## How it works

Knowledge Search runs the shared `search_respond` agentic loop (see [Search and Respond](/builder/v2/agent-reference/search-and-respond) for the full retrieval mechanics): it searches the attached knowledge bases, looks at the results, refines its query if needed, and synthesizes a cited answer. Retrieved chunks are injected into the Instructions with numbered `[N]` source labels, and the agent is told to answer using only knowledge-base content — if the knowledge base doesn't cover the question, it says so rather than inventing an answer.

The preset hides the output-schema control (`type_config.output_schema`), because Knowledge Search always returns the standard answer-plus-sources shape. The search-iteration budget defaults to 3 — see the iteration-limit section below.

## Configuration

Knowledge Search ships with its instructions pre-filled and exposes these advanced settings in the builder:

Setting

Purpose

Instructions

The system prompt. Ships pre-filled to search the attached knowledge bases and answer with citations; edit it to scope or shape the answer. Supports `{{input.<field>}}` placeholders.

LLM configuration

The model and generation settings, served through EmaFusion™.

HITL

Optional human-in-the-loop, letting the agent pause to ask a clarifying question via `ask_human`.

You attach knowledge bases to the node so the agent has something to retrieve from. The default Instructions are:

```text
You are a knowledge search assistant. Search the attached knowledge bases to
find relevant information and provide a comprehensive answer with source
citations.

User instructions: {{input.instructions}}
```

The optional `type_config.max_iterations` field tunes the search/refine budget:

```json
{ "max_iterations": 3 }
```

Field

Required

Default

Range

`max_iterations`

No

3

1–10

A value of zero or below falls back to 3. The agent may search up to this many times, then must commit to an answer. (This is the conceptual search budget surfaced to the model; the shared engine also applies its own hard loop ceilings — see the [Agent Reference overview](/builder/v2/agent-reference#loop-and-budget-limits).)

## Inputs and output

The preset declares one input field, `instructions` — what to search for. You wire it on the node through `input_mapping`.

**Input**

```json
{ "instructions": "What is our refund policy for annual plans?" }
```

**Output**

```json
{
  "answer": "Annual plans can be refunded within 30 days of purchase...",
  "sources": [
    { "title": "Refund Policy 2026.pdf", "uri": "https://..." }
  ]
}
```

Each entry in `sources` is an object with a `title` (the document title from a search result the agent actually used) and an optional `uri`. The agent is instructed to cite only documents that appeared in its search results — the `sources` array drives the citation chips shown to the user. The response also carries structured `cited_sources` derived from the numbered results, which the UI uses to render richer citations. In the builder, the node exposes `answer` and `citations` output ports.

## Example

A help-desk AI Employee that answers from the company knowledge base:

1.  A user asks, "How many vacation days do I get in my first year?"
2.  A **Knowledge Search** node, with the HR knowledge base attached, retrieves the relevant policy section and synthesizes a grounded answer with a citation.
3.  A publish node delivers the answer and its source to the user.

## What's next

-   [Search and Respond Agent](/builder/v2/agent-reference/search-and-respond) — the general research agent that shares this retrieval loop, including knowledge-base filtering and Tools.
-   [Search Query Planner Agent](/builder/v2/agent-reference/search-query-planner) — formulate an optimal single-pass search query.
-   [Agent Reference overview](/builder/v2/agent-reference) — the type model, catalog, and shared execution engine.
