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

# Train Your Fliqr AI Agent Using a Knowledge Base Source

> Add URLs, PDFs, plain text, and YouTube transcripts to ground your AI Agent in your own content instead of the model's general training data.

By default, an AI Agent draws on a language model's general training data to answer questions. That works for generic tasks, but it produces unreliable results when customers ask about your specific products, policies, or procedures. A Knowledge Base solves this by giving the agent a curated set of content to retrieve from before generating any response.

## Overview

When a customer sends a message, Fliqr AI searches the Knowledge Base for content chunks that are relevant to their question. Those chunks are passed to the language model alongside the system prompt and conversation history. The model then writes a response grounded in your actual content rather than its general training.

This retrieval-augmented approach means the agent does not need to memorize your entire website — it finds the right sections at query time. The quality of that retrieval depends on how specific and well-organized your source content is.

## Prerequisites

* An AI Agent created in Fliqr AI — see [AI Providers](/docs/core-concepts/ai-agents/ai-providers)
* Source content to add: a website, PDFs, text documents, or YouTube video URLs
* A system prompt that instructs the agent to use the knowledge base — see [Prompt Engineering](/docs/core-concepts/ai-agents/prompt-engineering)

## Supported Source Types

| Source type               | Notes                                                                    |
| ------------------------- | ------------------------------------------------------------------------ |
| **Website URL**           | Fliqr AI crawls the URL and linked pages up to the configured page limit |
| **PDF / document upload** | Supports PDF, DOCX, and plain text files                                 |
| **Plain text**            | Paste content directly — useful for policies, FAQs, or product specs     |
| **YouTube video URL**     | Extracts the video's caption transcript; standard uploaded videos only   |

<Warning>
  YouTube Shorts and live stream URLs are not supported. Only standard uploaded videos with published captions can be indexed. If a video has auto-generated captions only, accuracy may vary — review the indexed content after training.
</Warning>

## Add a Knowledge Source

<Steps>
  <Step title="Open the Knowledge Base tab">
    Go to **AI Agents** → select your agent → **Knowledge Base** tab.
  </Step>

  <Step title="Add a source">
    Click **Add Source** and choose the source type: Website URL, File Upload, Plain Text, or YouTube URL.
  </Step>

  <Step title="Enter the URL or upload the file">
    For a website, enter the root URL. Fliqr AI will discover linked pages up to the page limit. For a file, select it from your device. For plain text, paste your content directly.
  </Step>

  <Step title="Start training">
    Click **Train**. Fliqr AI fetches the content, splits it into chunks, and builds a vector index. Indexing time depends on content size — most sources complete within a few minutes.
  </Step>

  <Step title="Check indexing status">
    The source list shows a status badge for each entry: **Indexed**, **Indexing**, or **Failed**. Expand an indexed website source to see which pages were included.

    Review the page list and remove any low-value pages that could dilute retrieval quality.
  </Step>

  <Step title="Test with the Playground">
    Open the **Playground** tab and ask questions that should be answered from your knowledge base. Verify that responses cite your content — not generic information from the model's training data.
  </Step>
</Steps>

## What the Agent Actually Does with the Knowledge Base

It is worth being precise about retrieval: the agent does not read your entire knowledge base for every message. Instead, it performs a semantic search across all indexed chunks and retrieves the most relevant passages based on the user's question. Those passages are injected into the context window before the model generates a reply.

This means:

* A document buried 20 pages into a PDF is just as retrievable as the first page, as long as it is semantically relevant.
* Very short chunks (a sentence or two) may not contain enough context to generate a useful answer — prefer well-structured paragraphs.
* Duplicate or contradictory content across multiple sources can cause the agent to return inconsistent answers.

<Note>
  The agent retrieves the most relevant chunks based on the user's question. It does not scan the full document top-to-bottom. If users ask a question and get a generic answer instead of your specific policy, the relevant content may not be present in your sources — add it directly.
</Note>

## Improving Retrieval Quality

<Tip>
  After indexing a website URL, review which pages were included. Exclude low-value pages such as tag archives, pricing comparison tables, or paginated lists. These pages add noise without adding answerable content, which lowers the relevance score of genuinely useful pages.
</Tip>

<Tip>
  After training, use the Playground to ask questions that your knowledge base should answer. If the agent responds with generic information instead of your specific content, one of three things is likely: the relevant content was not indexed, the chunk containing it is too short to be retrieved, or the question phrasing does not match your content vocabulary. Try rephrasing the question or adding more explicit content to your sources.
</Tip>

Additional practices that improve retrieval accuracy:

* Use descriptive headings and clear paragraph breaks in your source content — they help the chunking algorithm create meaningful segments.
* For PDFs, ensure they are text-based rather than scanned images. Scanned PDFs without OCR will index as empty content.
* Keep each source focused on one topic area. A single 100-page document covering unrelated topics is harder to retrieve from than four focused 25-page documents.
* Re-train a source after making significant updates to the original content. Fliqr AI does not automatically re-index sources when source content changes.

## What's Next

<CardGroup cols={2}>
  <Card title="Prompt Engineering" icon="pen-to-square" href="/docs/core-concepts/ai-agents/prompt-engineering">
    Write system prompts that tell the agent how to use retrieved knowledge in its answers.
  </Card>

  <Card title="Functions & Actions" icon="bolt" href="/docs/core-concepts/ai-agents/functions-actions">
    Connect the agent to live external data sources for real-time information retrieval.
  </Card>
</CardGroup>
