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

# Knowledge Sources Overview

> Learn how to build your agent's knowledge base with web pages, custom text, and Q&A content

## What is a Knowledge Base?

A **knowledge base** is the foundation of your agent's intelligence. It's a collection of information sources that your agent draws from when answering visitor questions. The quality and relevance of your knowledge base directly determines how helpful your agent will be.

<Tip>
  Think of the knowledge base as your agent's memory. The more relevant, well-organized content you provide, the better your agent can assist visitors with accurate, contextual answers.
</Tip>

## How It Works

When a visitor asks your agent a question, here's what happens behind the scenes:

<Steps>
  <Step title="Query Processing">
    The visitor's question is analyzed and converted into a format that can be searched against your knowledge base.
  </Step>

  <Step title="Content Retrieval">
    The system searches through all your knowledge sources to find the most relevant content pieces that match the query.
  </Step>

  <Step title="Reranking">
    Retrieved content is reranked by relevance to ensure the best information is prioritized.
  </Step>

  <Step title="Response Generation">
    The AI generates a natural, conversational response using the retrieved content as context, ensuring accuracy based on your actual content.
  </Step>
</Steps>

This approach is called **Retrieval-Augmented Generation (RAG)** and ensures your agent provides accurate answers grounded in your content rather than making things up.

## Source Types

Your knowledge base can include three types of content sources:

| Source Type      | Description                                                 | Best Use Cases                                                       |
| ---------------- | ----------------------------------------------------------- | -------------------------------------------------------------------- |
| **Web Sources**  | Pages imported from your website via URL, sitemap, or crawl | Product pages, documentation, blog posts, service descriptions       |
| **Text Sources** | Custom content you write directly in the platform           | Internal knowledge, company policies, specialized information        |
| **Q\&A Sources** | Specific question-answer pairs you define                   | FAQs, common support queries, precise answers for specific questions |

<CardGroup cols={3}>
  <Card title="Web Sources" icon="globe" href="/sources/web-sources">
    Import content directly from your website pages, sitemaps, or through automated crawling.
  </Card>

  <Card title="Text Sources" icon="file-lines" href="/sources/text-sources">
    Add custom text content that may not exist on your website.
  </Card>

  <Card title="Q&A Sources" icon="circle-question" href="/sources/qa-sources">
    Create targeted question-answer pairs for precise responses.
  </Card>
</CardGroup>

## Managing Sources

All your knowledge sources are managed from the **Sources** tab in your agent's dashboard. From there you can:

* **Add** new sources of any type
* **View** all existing sources and their status — source URLs are clickable and open in a new tab for quick verification
* **Select All** sources at once using the checkbox in the table header to perform bulk operations
* **Edit** source content (for text and Q\&A)
* **Delete** sources you no longer need
* **Monitor** ingestion status and processing

<Note>
  When you add or update sources, your agent's knowledge base is automatically updated. Changes typically take effect within a few minutes after processing completes.
</Note>

## Source Status

Each source has a status indicating its current state:

| Status         | Meaning                                                |
| -------------- | ------------------------------------------------------ |
| **Pending**    | Source is queued for processing                        |
| **Processing** | Content is being extracted and indexed                 |
| **Ready**      | Source is active and available to your agent           |
| **Failed**     | Processing encountered an error (check source details) |

## Best Practices

<AccordionGroup>
  <Accordion icon="bullseye" title="Focus on quality over quantity">
    Adding hundreds of irrelevant pages can actually hurt your agent's performance. Be selective and include only content that visitors would actually ask about.
  </Accordion>

  <Accordion icon="sitemap" title="Organize content logically">
    Group related information together. If you have product pages, support articles, and company info, make sure each is well-structured and covers topics comprehensively.
  </Accordion>

  <Accordion icon="arrows-rotate" title="Keep content up to date">
    Remove outdated sources and add new content regularly. An agent giving outdated information can frustrate visitors and damage trust.
  </Accordion>

  <Accordion icon="layer-group" title="Use multiple source types together">
    Web sources are great for existing content, but supplement with Q\&A pairs for common questions and text sources for information not on your website.
  </Accordion>

  <Accordion icon="flask" title="Test after adding sources">
    After adding new sources, test your agent in the Playground with relevant questions to verify it's using the new content appropriately.
  </Accordion>
</AccordionGroup>

## Common Scenarios

### Scenario 1: Documentation Website

If you have technical documentation, import your docs pages via sitemap. Supplement with Q\&A pairs for the most common "how do I..." questions.

### Scenario 2: E-commerce Site

Import product pages and category descriptions. Add Q\&A pairs for shipping policies, return processes, and sizing guides that might not be in your main content.

### Scenario 3: Service Business

Import your services pages and case studies. Add text sources for internal processes and Q\&A pairs for pricing and availability questions.

## Next Steps

<CardGroup cols={2}>
  <Card title="Add Web Sources" icon="globe" href="/sources/web-sources">
    Learn how to import content from your website using URLs, sitemaps, or crawling.
  </Card>

  <Card title="Create Text Sources" icon="file-lines" href="/sources/text-sources">
    Add custom text content to your knowledge base.
  </Card>

  <Card title="Build Q&A Pairs" icon="circle-question" href="/sources/qa-sources">
    Create targeted question-answer pairs for precise responses.
  </Card>

  <Card title="Test Your Agent" icon="flask" href="/agents/playground">
    Verify your knowledge base is working in the Playground.
  </Card>
</CardGroup>
