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

# Knowledge Base

> Add documents, FAQs, and reference materials for your agent

## What is the Knowledge Base?

The Knowledge Base is where you provide your agent with information it can reference during conversations. This includes product documentation, FAQs, company policies, pricing information, and any other content your agent needs to answer customer questions accurately.

<Info>
  A well-populated Knowledge Base significantly improves your agent's ability to provide accurate, helpful responses by giving it access to your specific business information.
</Info>

## Adding Documents

You can add knowledge to your agent in three ways:

<Tabs>
  <Tab title="URL Import">
    Import content directly from web pages.

    <Steps>
      <Step title="Click 'Add URL'">
        Open the Knowledge Base section and select the URL option.
      </Step>

      <Step title="Enter the URL">
        Paste the full URL of the webpage you want to import.
      </Step>

      <Step title="Configure Settings">
        Set the document name and choose the usage mode.
      </Step>

      <Step title="Confirm Import">
        The system will fetch and process the content automatically.
      </Step>
    </Steps>

    **Best for:** Product pages, help center articles, documentation sites, pricing pages.
  </Tab>

  <Tab title="Text Entry">
    Manually enter or paste text content.

    <Steps>
      <Step title="Click 'Add Text'">
        Select the text entry option.
      </Step>

      <Step title="Enter Content">
        Type or paste your content in the text area.
      </Step>

      <Step title="Configure Settings">
        Set the document name and choose the usage mode.
      </Step>

      <Step title="Save">
        The content is processed and added to the knowledge base.
      </Step>
    </Steps>

    **Best for:** Custom FAQs, internal guidelines, scripts, policies.
  </Tab>

  <Tab title="File Upload">
    Upload documents directly from your computer.

    <Steps>
      <Step title="Click 'Add File'">
        Select the file upload option.
      </Step>

      <Step title="Select File">
        Choose a file from your computer (PDF, TXT, DOC, DOCX).
      </Step>

      <Step title="Configure Settings">
        Set the document name and choose the usage mode.
      </Step>

      <Step title="Upload">
        The document is processed and indexed automatically.
      </Step>
    </Steps>

    **Supported formats:** PDF, TXT, DOC, DOCX, and more.
  </Tab>
</Tabs>

## Usage Modes

Each document in your Knowledge Base can be configured with one of two usage modes:

| Mode            | Icon | Description                                                              | When to Use                                              |
| --------------- | ---- | ------------------------------------------------------------------------ | -------------------------------------------------------- |
| **Auto Search** | 🔍   | Agent searches this document only when relevant to the conversation      | Large documents, extensive catalogs, reference materials |
| **In Prompt**   | 📋   | Content is always included in the agent's context for every conversation | Critical info, company details, core policies            |

### Understanding Usage Modes

<Info>
  **Auto Search** uses semantic search to find relevant portions of documents when needed, making conversations more efficient and cost-effective.
</Info>

<Warning>
  **In Prompt** mode includes the entire document content in every conversation, which can increase costs and slow responses for large documents. Use only for essential, concise information.
</Warning>

#### Auto Search Mode

* **How it works:** The agent automatically searches through the document when it detects the conversation topic is relevant
* **Performance:** Efficient for large documents - only retrieves relevant sections
* **Cost:** Lower cost as only relevant portions are processed
* **Best practices:** Use for comprehensive guides, product catalogs, detailed FAQs

#### In Prompt Mode

* **How it works:** The document content is included in the agent's context for every single conversation
* **Performance:** Immediate access to information but can slow down responses
* **Cost:** Higher cost as content is processed in every conversation
* **Best practices:** Use only for critical information under 1000 characters

## Managing Documents

### Document List View

The Knowledge Base displays all your documents in a organized list showing:

| Column      | Description                                |
| ----------- | ------------------------------------------ |
| **Name**    | Document title (editable)                  |
| **Type**    | Visual indicator: 🔗 URL, 📄 Text, 📁 File |
| **Mode**    | Usage mode: 🔍 Auto Search or 📋 In Prompt |
| **Preview** | First few lines of content                 |
| **Actions** | Edit (✏️) and Delete (🗑️) buttons         |

### Editing Existing Documents

You can modify existing documents to update content, names, or usage modes using the edit functionality.

<Steps>
  <Step title="Click Edit Button">
    Locate the edit icon (✏️) next to any document in your Knowledge Base list.
  </Step>

  <Step title="Modify Document Fields">
    The edit modal will open with current document details loaded. You can modify different fields based on the document type:

    * **All documents:** Name and usage mode
    * **URL documents:** Source URL (will refetch content)
    * **Text documents:** Full text content
    * **File documents:** Only name and usage mode (content cannot be edited)
  </Step>

  <Step title="Save Changes">
    Click "Save Changes" to update the document. Changes are processed immediately.
  </Step>
</Steps>

#### Document Type-Specific Editing

<Tabs>
  <Tab title="URL Documents">
    **Editable Fields:**

    * Document name
    * Source URL
    * Usage mode (Auto Search / In Prompt)

    **How it works:** When you update the URL, the system will automatically refetch the content from the new location and update the document.

    **Use cases:** Updating documentation URLs, fixing broken links, switching to newer versions of web pages.
  </Tab>

  <Tab title="Text Documents">
    **Editable Fields:**

    * Document name
    * Full text content
    * Usage mode (Auto Search / In Prompt)

    **How it works:** You can modify the text content directly in the editor. The system loads the complete document content for editing.

    <Warning>
      When you edit the text content of a document, the system creates a new document ID internally. This ensures proper content indexing but means conversation references to the old document ID will not work.
    </Warning>

    **Use cases:** Updating FAQs, modifying policies, correcting information, adding new details.
  </Tab>

  <Tab title="File Documents">
    **Editable Fields:**

    * Document name
    * Usage mode (Auto Search / In Prompt)

    **Limitations:** The actual file content cannot be edited through the interface.

    **How it works:** You can only change the display name and how the document is used by the agent.

    **To update content:** Delete the document and upload a new version of the file.
  </Tab>
</Tabs>

### Real-Time Content Loading

For optimal performance, the system handles content loading intelligently:

* **Document List:** Shows content previews for quick reference
* **Edit Modal:** Loads full document content automatically when editing text or URL documents
* **Loading States:** Clear indicators when content is being fetched
* **Error Handling:** Graceful fallback to preview content if full loading fails

<Info>
  When editing URL or text documents, the system automatically loads the complete content. This may take a few seconds for large documents.
</Info>

### Document Deletion

<Steps>
  <Step title="Click Delete Icon">
    Click the delete icon (🗑️) next to the document.
  </Step>

  <Step title="Confirm Deletion">
    Confirm the action in the popup dialog.
  </Step>

  <Step title="Immediate Removal">
    The document is immediately removed from your agent's knowledge base.
  </Step>
</Steps>

<Warning>
  Deleted documents cannot be recovered. Make sure to export or backup important content before deleting.
</Warning>

## Best Practices

### Content Organization

* **Keep Current:** Regularly update documents to reflect latest information using the edit functionality
* **Be Specific:** Include exact phrases and terms customers might use
* **Structure Well:** Use clear headings, bullet points, and organized sections
* **Avoid Duplication:** Don't repeat the same information across multiple documents

### Editing Workflow

* **Review Before Editing:** Check the current content and usage mode before making changes
* **Test After Updates:** Verify the agent can access and use the updated information correctly
* **Monitor Performance:** Large content changes may affect response times
* **Consider Document IDs:** Remember that editing text content creates new document IDs

### Usage Mode Strategy

* **Auto Search for:** Large documents, comprehensive guides, detailed product info
* **In Prompt for:** Company name, key contact info, essential policies (keep under 1000 chars)

### Performance Optimization

* **Test Regularly:** Verify the agent can find and use information correctly
* **Monitor Conversations:** Review how the agent uses knowledge base content
* **Optimize Content:** Remove outdated or redundant information
* **Update Incrementally:** Make small, targeted edits rather than large overhauls

<Info>
  Start with Auto Search mode for most documents. Only switch to In Prompt mode for absolutely critical information that must always be available.
</Info>

## Example Knowledge Base Structure

Here's a recommended structure for organizing your knowledge base:

```
📚 Knowledge Base
├── 📄 Company Overview (In Prompt)
│   └── Essential company info, mission, key contacts
├── 🔗 Product Catalog URL (Auto Search)  
│   └── Complete product listings and specifications
├── 📄 Pricing Information (Auto Search)
│   └── Current pricing tiers and packages
├── 📁 FAQ Document (Auto Search)
│   └── Common customer questions and answers
├── 📄 Refund Policy (Auto Search)
│   └── Terms and conditions for returns
├── 🔗 Support Articles URL (Auto Search)
│   └── Help center and troubleshooting guides
└── 📄 Contact Information (In Prompt)
    └── Phone numbers, hours, emergency contacts
```

## Integration with Agent Context

Your Knowledge Base documents are dynamically integrated into your agent's conversational context:

* **Semantic Search:** Auto Search documents are searched based on conversation relevance
* **Context Injection:** In Prompt documents are always available in the agent's working memory
* **Real-Time Updates:** Changes to documents are immediately available to the agent
* **Intelligent Retrieval:** The system automatically selects the most relevant information

## Troubleshooting

### Common Issues

**Agent can't find information:**

* Verify the document is saved and shows in the Knowledge Base list
* Try using Auto Search mode for better semantic matching
* Include variations of keywords customers might use
* Check if recent edits created new document IDs

**Slow agent responses:**

* Check if you have too many In Prompt documents
* Consider moving large documents to Auto Search mode
* Review total character count of In Prompt content

**Outdated information:**

* Use the edit functionality to update documents directly
* Changes take effect immediately in new conversations
* Consider setting up regular review schedules

**Content loading issues:**

* Verify internet connectivity for URL documents
* Check file format compatibility for uploaded documents
* Try editing the document again if loading fails

**Edit modal problems:**

* Wait for content loading to complete before making changes
* Check that the assistant is properly published
* Verify you have editing permissions

## Next Steps

<CardGroup cols={2}>
  <Card title="Actions & Tools" icon="wrench" href="/advanced-editor/actions-tools">
    Configure integrations and external tools
  </Card>

  <Card title="Playground" icon="gamepad" href="/advanced-editor/playground">
    Test your agent with the knowledge base
  </Card>
</CardGroup>
