# Knowledge

Leilani has two factual retrieval paths:

- [Knowledge Base](knowledge-base.md), for uploaded or crawled content owned by the agent
- [Web Search](web-search.md), for approved public domains

Use the Knowledge Base for information you control. Use web search only when callers need answers from public sources and you can restrict search to trusted domains.

## Retrieval order

The agent always has `knowledge_base_search` available.

The `web_search` tool is added only when the agent's Web Search Allowlist contains at least one domain. The built-in tool description tells the agent to prefer web search after Knowledge Base search returns no results, weak results, or is unavailable.

## What to document in instructions

For factual workflows, include rules such as:

- search the Knowledge Base before answering policy, pricing, schedule, or support questions
- summarize retrieved material conservatively
- say when the available source material does not answer the question
- use web search only for approved domains and only when configured
- do not invent facts when both retrieval paths are weak

## Related pages

[Knowledge Base](knowledge-base.md)

Upload text documents and configure website crawl jobs.

[Web Search](web-search.md)

Configure allowed domains for the optional web search tool.
