> For the complete documentation index, see [llms.txt](https://docs.zaia.app/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.zaia.app/knowledge-bases/linking-a-knowledge-base-to-an-agent.md).

# Linking a Knowledge Base to an Agent

Creating a Knowledge Base is only the first step — to make it functional, you need to **link** it to an Agent or Squad.\
This connection is established through the **Knowledge Tool**, available inside each Agent’s configuration.

***

### 🧠 How Linking Works

Every Agent has its own list of **Tools**.\
When you add the **Knowledge Tool**, you can choose which Knowledge Bases that Agent will use as reference sources.

An Agent can:

* Use **multiple Knowledge Bases** simultaneously.
* Share the **same Knowledge Base** with other Agents or Squads.
* Retrieve relevant data dynamically based on context.

This flexibility allows you to build complex ecosystems where shared information powers multiple intelligent Agents.

***

### ⚙️ Linking a Knowledge Base

1. Go to **Builder → Agents → \[Select your Agent] → Tools**
2. Click **Add Tool +**
3. Choose the **Knowledge Tool** from the list
4. In the configuration window:
   * Select one or more **Knowledge Bases** to link
   * Adjust retrieval parameters (if available)
   * Save changes

Once linked, the Agent will automatically begin using the data for contextual reasoning and responses.

***

### 🧩 Linking to a Squad

When Agents belong to a **Squad**, any Knowledge Base connected to those Agents via the Knowledge Tool becomes available to the entire Squad context.\
This enables shared knowledge environments for teams of Agents collaborating on the same workflow.

***

### 💬 Example Scenario

**Knowledge Base:** *Zaia Commercial Knowledge*\
**Linked via:** *Knowledge Tool*\
**Used by:**

* Agent Ju da Zaia → Handles customer inquiries
* Agent Alfred → Builds custom workflows
* Squad da Zaia → Combines both agents in collaborative operations

All three entities reference the same Knowledge Base.\
If the base is updated or retrained, the changes immediately propagate to all Agents and Squads that use it.

***

### 🧭 Best Practices

* **Keep one source of truth.** Reuse Knowledge Bases across Agents when possible.
* **Modularize content.** Create separate bases for topics like Sales, Product, and Support.
* **Test context boundaries.** Ensure Agents are not over-retrieving from unrelated sources.
* **Monitor performance.** Retrain or clean content periodically for consistency.
